From 4635f333ae6840357c304b3bf52b157a8f5cd1e1 Mon Sep 17 00:00:00 2001 From: jgen Date: Sat, 7 Dec 2013 23:16:20 -0500 Subject: [PATCH] This should have been moved earlier in the fix for Issue 346. --- ext/comment/main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/comment/main.php b/ext/comment/main.php index 398c43c0..48d4f013 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -293,6 +293,8 @@ class CommentList extends Extension { $user_ratings = Ratings::get_user_privs($user); } + $where = SPEED_HAX ? "WHERE posted > now() - interval '24 hours'" : ""; + $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 $where GROUP BY image_id) AS s1") / 10); @@ -307,7 +309,6 @@ class CommentList extends Extension { $threads_per_page = 10; $start = $threads_per_page * ($current_page - 1); - $where = SPEED_HAX ? "WHERE posted > now() - interval '24 hours'" : ""; $get_threads = " SELECT image_id,MAX(posted) AS latest FROM comments $where