From 7d11c7a8842b36df9555d6d3569b30a248fdb4a5 Mon Sep 17 00:00:00 2001 From: 8chan Date: Fri, 21 Nov 2014 16:17:00 -0800 Subject: [PATCH] Fix mod mode for read.php --- inc/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index bf28009d..521d994a 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -1197,7 +1197,7 @@ function index($page, $mod=false) { $threads = array(); while ($th = $query->fetch(PDO::FETCH_ASSOC)) { - if ($config['cache']['enabled'] && !($thread = cache::get("thread_index_display_{$board['uri']}_{$th['id']}"))) { + if (($config['cache']['enabled'] && !($thread = cache::get("thread_index_display_{$board['uri']}_{$th['id']}")) || $mod)) { $thread = new Thread($th, $mod ? '?/' : $config['root'], $mod); if ($config['cache']['enabled']) { @@ -1247,7 +1247,7 @@ function index($page, $mod=false) { $thread->omitted_images = $omitted['image_count'] - $num_images; } - if ($config['cache']['enabled']) + if ($config['cache']['enabled'] && !$mod) cache::set("thread_index_display_{$board['uri']}_{$th['id']}", $thread); } @@ -2035,7 +2035,7 @@ function buildThread($id, $return = false, $mod = false) { if (event('build-thread', $id)) return; - if (!($thread = cache::get("thread_{$board['uri']}_{$id}"))) { + if (!($thread = cache::get("thread_{$board['uri']}_{$id}")) || $mod) { unset($thread); $query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE (`thread` IS NULL AND `id` = :id) OR `thread` = :id ORDER BY `thread`,`id`", $board['uri'])); $query->bindValue(':id', $id, PDO::PARAM_INT);