]> git.mjollnir.org Git - s9y.git/commitdiff
fix bug #1377095 - wrong entry count
authorgarvinhicking <garvinhicking>
Sat, 10 Dec 2005 21:46:13 +0000 (21:46 +0000)
committergarvinhicking <garvinhicking>
Sat, 10 Dec 2005 21:46:13 +0000 (21:46 +0000)
docs/NEWS
include/functions_entries.inc.php

index eb4339d3827df3c0a1e01c80fb70c1e12e6998f7..cb8bc922c67fe2e93827be88f71df337ad8ae04f 100644 (file)
--- 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
index 283e5ea5c65c0af6c52f6900860ba9d912283c82..06acfa68eccab2515f26050333c67a0c3386d5bc 100644 (file)
@@ -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) {