summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-12-28 19:46:50 +0100
committerczaks <marcin@6irc.net>2013-12-28 19:46:50 +0100
commitd6b8447233b2bf7e45cef6c211d8ca589ae74538 (patch)
treedaac40d8ad575090e5ab911867d3eb8bfd042c89 /inc/functions.php
parent62fe8571e2d7c6477f0f6d9c51be5f1eeec50624 (diff)
revise 4chan api support
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php7
1 files changed, 7 insertions, 0 deletions
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'])