From 0380f6d579b99b5c0d8184b06e94df9d233c4152 Mon Sep 17 00:00:00 2001 From: 8chan Date: Fri, 6 Mar 2015 02:04:14 -0800 Subject: [PATCH] Sort catalog before catalog.js does it --- templates/themes/catalog/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 88f6ad5b..ed55d247 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -43,7 +43,7 @@ $query = query(sprintf("SELECT *, `id` AS `thread_id`, (SELECT COUNT(`id`) FROM ``posts_%s`` WHERE `thread` = `thread_id`) AS `reply_count`, (SELECT SUM(`num_files`) FROM ``posts_%s`` WHERE `thread` = `thread_id` AND `num_files` IS NOT NULL) AS `image_count`, - '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `bump` DESC", + '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC", $board_name, $board_name, $board_name, $board_name, $board_name)) or error(db_error()); while ($post = $query->fetch(PDO::FETCH_ASSOC)) {