From d6b8447233b2bf7e45cef6c211d8ca589ae74538 Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 28 Dec 2013 19:46:50 +0100 Subject: revise 4chan api support --- inc/functions.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 676b6554..8b0745d3 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1132,6 +1132,9 @@ function index($page, $mod=false) { $thread->add(new Post($po, $mod ? '?/' : $config['root'], $mod)); } + $thread->images = $num_images; + $thread->replies = isset($omitted['post_count']) ? $omitted['post_count'] : count($replies); + if ($omitted) { $thread->omitted = $omitted['post_count'] - ($th['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']); $thread->omitted_images = $omitted['image_count'] - $num_images; @@ -1416,6 +1419,10 @@ function buildIndex() { $json = json_encode($api->translateCatalog($catalog)); $jsonFilename = $board['dir'] . 'catalog.json'; file_write($jsonFilename, $json); + + $json = json_encode($api->translateCatalog($catalog, true)); + $jsonFilename = $board['dir'] . 'threads.json'; + file_write($jsonFilename, $json); } if ($config['try_smarter']) -- cgit v1.3