From 771a1e16299ca6fbf24a174e65392073daa48176 Mon Sep 17 00:00:00 2001 From: nonmakina Date: Mon, 18 Jan 2021 04:35:34 -0600 Subject: [PATCH] Add offset --- templates/themes/semirand/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/themes/semirand/theme.php b/templates/themes/semirand/theme.php index 11403bd3..7db5ef9e 100644 --- a/templates/themes/semirand/theme.php +++ b/templates/themes/semirand/theme.php @@ -101,7 +101,7 @@ * Retrieve count of images and posts in a thread */ private function fetchThreadCount($board, $thread_id, $preview_count) { - $query = prepare("SELECT COUNT(NULLIF(TRIM(files), '')) as file_count, COUNT(id) as post_count FROM ``posts_$board`` WHERE `thread` = :id ORDER BY `time` DESC OFFSET :offset"); + $query = prepare("SELECT COUNT(NULLIF(TRIM(files), '')) as file_count, COUNT(id) as post_count FROM ``posts_$board`` WHERE `thread` = :id ORDER BY `time` DESC LIMIT :offset , 18446744073709551615;"); $query->bindValue(':id', $thread_id, PDO::PARAM_INT); $query->bindValue(':offset', $preview_count, PDO::PARAM_INT); $query->execute() or error(db_error($query));