From 90489000bb044f316eb32bca8aac327ab24bff84 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Sat, 10 Dec 2005 21:46:13 +0000 Subject: [PATCH] fix bug #1377095 - wrong entry count --- docs/NEWS | 4 ++++ include/functions_entries.inc.php | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index eb4339d..cb8bc92 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 1.0 () ------------------------------------------------------------------------ + * Fix Bug #1377095 - Not counting correct number of entries on the + /archives page. The page was counting entries belonging to more + then one categories multiple times. (garvinhicking) + * Fix MoveableType importer to better import comments (garvinhicking) * Allow category sidebar plugin to hide the parent category, if diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index 283e5ea..06acfa6 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -1357,9 +1357,13 @@ function serendipity_printArchives() { AND timestamp >= $s AND timestamp <= $e " . (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND timestamp <= " . time() : '') - . (!empty($cat_sql) ? ' AND ' . $cat_sql : '') - ); - $entry_count = $entries[0][0]; + . (!empty($cat_sql) ? ' AND ' . $cat_sql : '') . " + GROUP BY ec.entryid", false, 'assoc'); + if (is_array($entries)) { + $entry_count = count($entries); + } else { + $entry_count = 0; + } /* A silly hack to get the maximum amount of entries per month */ if ($entry_count > $max) { -- 2.39.5