From 36ae42b0b389081f6e7a992324bf408a97c23291 Mon Sep 17 00:00:00 2001 From: Repellent Date: Wed, 28 Jan 2026 18:30:33 +0500 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- class/comment.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/class/comment.php b/class/comment.php index 0deb93b..2f6a4a4 100644 --- a/class/comment.php +++ b/class/comment.php @@ -367,6 +367,9 @@ function commentListShow($tpl_dir) $sql_sort = "comment_published ASC"; break; } + + // ОПРЕДЕЛЯЕМ НАПРАВЛЕНИЕ ДЛЯ ID (чтобы не было конфликта при одинаковых датах) + $final_direction = (stripos($sql_sort, 'DESC') !== false) ? 'DESC' : 'ASC'; if ($settings['comment_use_page_nav'] == 1) { @@ -374,7 +377,7 @@ function commentListShow($tpl_dir) if ($limit <= 0) { - $sql = $AVE_DB->Query("SELECT * FROM " . PREFIX . "_module_comment_info WHERE document_id = '" . $document_id . "' " . $where_visibility . " ORDER BY parent_id ASC, " . $sql_sort); + $sql = $AVE_DB->Query("SELECT * FROM " . PREFIX . "_module_comment_info WHERE document_id = '" . $document_id . "' " . $where_visibility . " ORDER BY " . $sql_sort . ", Id " . $final_direction); $page_nav = ''; } else @@ -394,7 +397,7 @@ function commentListShow($tpl_dir) parent_id != '0' ) " . $where_visibility . " - ORDER BY comment_published ASC + ORDER BY " . $sql_sort . ", Id " . $final_direction . " "); if ($num > $limit) @@ -417,7 +420,7 @@ function commentListShow($tpl_dir) else { // Если навигация отключена - $sql = $AVE_DB->Query("SELECT * FROM " . PREFIX . "_module_comment_info WHERE document_id = '" . $document_id . "' " . $where_visibility . " ORDER BY parent_id ASC, " . $sql_sort); + $sql = $AVE_DB->Query("SELECT * FROM " . PREFIX . "_module_comment_info WHERE document_id = '" . $document_id . "' " . $where_visibility . " ORDER BY " . $sql_sort . ", Id " . $final_direction); $page_nav = ''; }