From c58abed47e3e7ca73e31a6e7d712ed4ab4d1940b Mon Sep 17 00:00:00 2001 From: Repellent Date: Thu, 8 Jan 2026 23:02:37 +0500 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D1=83=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=9E=D1=82=D0=B2=D0=B5=D1=87=D0=B0=D1=82=D1=8C=20=D1=81?= =?UTF-8?q?=D0=B0=D0=BC=D0=BE=D0=BC=D1=83=20=D1=81=D0=B5=D0=B1=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/comment.php | 5 ++++- lang/ru.txt | 2 ++ sql.php | 12 ++++++------ templates/admin_settings.tpl | 10 +++++++--- templates/comments_tree_sub.tpl | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/class/comment.php b/class/comment.php index a652a7e..af39b27 100644 --- a/class/comment.php +++ b/class/comment.php @@ -303,6 +303,7 @@ function commentListShow($tpl_dir) $assign['comment_max_file_size'] = $settings['comment_max_file_size'] ?? 2048; $assign['comment_max_files'] = (int)($settings['comment_max_files'] ?? 5); $assign['ajax_replies_limit'] = (int)($settings['comment_ajax_replies_limit'] ?? 0); + $assign['comment_allow_self_answer'] = (int)($settings['comment_allow_self_answer'] ?? 0); $comments = array(); // --- ВЫБОРКА ИЗ БД --- @@ -1472,7 +1473,8 @@ function commentAdminSettingsEdit($tpl_dir) // Получаем основные настройки $post_max_chars = $_POST['comment_max_chars'] ?? 0; $post_user_groups = $_POST['comment_user_groups'] ?? array(); - $post_user_groups_read = $_POST['comment_user_groups_read'] ?? array(); + $post_user_groups_read = $_POST['comment_user_groups_read'] ?? array(); + $post_allow_self_answer = $_POST['comment_allow_self_answer'] ?? 0; $post_need_approve = $_POST['comment_need_approve'] ?? 0; $post_active = $_POST['comment_active'] ?? 0; @@ -1536,6 +1538,7 @@ function commentAdminSettingsEdit($tpl_dir) comment_use_page_nav = '" . (int)$post_use_page_nav . "', comment_page_nav_count = '" . (int)$post_page_nav_count . "', comment_ajax_replies_limit = '" . (int)$post_ajax_replies_limit . "', + comment_allow_self_answer = '" . (int)$post_allow_self_answer . "', comment_allow_files = '" . (int)$post_allow_files . "', comment_allow_files_anon = '" . (int)$post_allow_files_anon . "', comment_allowed_extensions = '" . addslashes($clean_extensions) . "', diff --git a/lang/ru.txt b/lang/ru.txt index 17ec1f3..732d8ff 100644 --- a/lang/ru.txt +++ b/lang/ru.txt @@ -143,6 +143,8 @@ COMMENT_SPAMPROTECT = "Использовать CAPTCHA" COMMENT_USE_PAGE_TITEL = "Настройка постраничной навигации" COMMENT_USE_PAGE_NAV = "Использовать постраничную навигацию" COMMENT_USE_PAGE_ANSWER = "Кол-во ответов в ветке:" +COMMENT_USE_ANSWER_ALL = "Разрешить отвечать самому себе:" +COMMENT_USE_ANSWER_ALL_A = "(автору комментария)" COMMENT_USE_PAGE_NO_LIMIT = "(0 - без лимита)" COMMENT_SAFE_LIMIT_TITEL = "Защита и ограничения" COMMENT_SAFE_LIMIT_TIME_EDIT = "Время на редактирование комментария:" diff --git a/sql.php b/sql.php index 3d35ab0..b6480f0 100644 --- a/sql.php +++ b/sql.php @@ -3,19 +3,18 @@ /** * AVE.cms - Модуль Комментарии - * (Структура по аналогии с модулем Forms) */ $module_sql_install = array(); $module_sql_deinstall = array(); $module_sql_update = array(); - // 1. УДАЛЕНИЕ (Чистим всё перед установкой) + // 1. УДАЛЕНИЕ $module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_comments`;"; $module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_comment_info`;"; $module_sql_deinstall[] = "DROP TABLE IF EXISTS `%%PRFX%%_module_comment_votes`;"; - // 2. УСТАНОВКА (Создаем таблицы сразу со всеми нужными полями) + // 2. УСТАНОВКА $module_sql_install[] = " CREATE TABLE IF NOT EXISTS `%%PRFX%%_module_comments` ( `Id` tinyint(1) unsigned NOT NULL AUTO_INCREMENT, @@ -46,6 +45,7 @@ `comment_edit_time` int(11) NOT NULL DEFAULT '60', `comment_cookie_life` int(11) NOT NULL DEFAULT '30', `comment_ajax_replies_limit` tinyint(3) NOT NULL DEFAULT '5', + `comment_allow_self_answer` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`Id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=1; "; @@ -96,10 +96,10 @@ ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 AUTO_INCREMENT=1; "; - // Начальные настройки - $module_sql_install[] = "INSERT INTO `%%PRFX%%_module_comments` VALUES (1, 1000, '1,3', '1,2,3,4', '0', '1', '1' , '0', '', 1, 0, '', 1, 0, '', 0, 'jpg,jpeg,png,gif,webp', 2048, 5, 0, 1, 0, 0, 0, 0, 60, 30, 5);"; + // Начальные настройки (Добавлен 0 в конце для comment_allow_self_answer) + $module_sql_install[] = "INSERT INTO `%%PRFX%%_module_comments` VALUES (1, 1000, '1,3', '1,2,3,4', '0', '1', '1' , '0', '', 1, 0, '', 1, 0, '', 0, 'jpg,jpeg,png,gif,webp', 2048, 5, 0, 1, 0, 0, 0, 0, 60, 30, 5, 0);"; - // 3. ОБНОВЛЕНИЕ (Только системная информация) + // 3. ОБНОВЛЕНИЕ $module_sql_update[] = " UPDATE `%%PRFX%%_module` SET diff --git a/templates/admin_settings.tpl b/templates/admin_settings.tpl index 0f3ff21..97cb6f5 100644 --- a/templates/admin_settings.tpl +++ b/templates/admin_settings.tpl @@ -57,8 +57,13 @@ {#COMMENT_USE_PAGE_NO_LIMIT#} - - + {#COMMENT_USE_ANSWER_ALL#} + +
+ + {#COMMENT_USE_ANSWER_ALL_A#} +
+ @@ -253,7 +258,6 @@ -