forked from leftypol/leftypol
Build overboard json
This commit is contained in:
parent
0bdbe0f927
commit
2ca72c6a7c
2 changed files with 19 additions and 1 deletions
|
@ -458,5 +458,21 @@
|
|||
'recent_posts' => $recent_posts,
|
||||
'board' => $board
|
||||
)));
|
||||
|
||||
if ($config['api']['enabled']) {
|
||||
$api = new Api();
|
||||
|
||||
$threads = array();
|
||||
|
||||
foreach ($recent_posts as $post) {
|
||||
$threads[] = new Thread($post);
|
||||
}
|
||||
|
||||
$json = json_encode($api->translateCatalogPage($threads));
|
||||
file_write($config['dir']['home'] . $board_name . '/catalog.json', $json);
|
||||
|
||||
$json = json_encode($api->translateCatalogPage($threads, true));
|
||||
file_write($config['dir']['home'] . $board_name . '/threads.json', $json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue