From f5edb4fb4e3c7c59d02f5102ec350e4e46edbec2 Mon Sep 17 00:00:00 2001 From: Shish Date: Fri, 20 Jan 2012 05:24:29 +0000 Subject: [PATCH] the 24 hour limit can apply to the page count too, making that also 70x faster --- ext/comment/main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/comment/main.php b/ext/comment/main.php index 4dcb5090..3f889cd6 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -277,7 +277,7 @@ class CommentList extends SimpleExtension { $total_pages = $database->cache->get("comment_pages"); if(empty($total_pages)) { - $total_pages = (int)($database->get_one("SELECT COUNT(c1) FROM (SELECT COUNT(image_id) AS c1 FROM comments GROUP BY image_id) AS s1") / 10); + $total_pages = (int)($database->get_one("SELECT COUNT(c1) FROM (SELECT COUNT(image_id) AS c1 FROM comments $where GROUP BY image_id) AS s1") / 10); $database->cache->set("comment_pages", $total_pages, 600); }