Build overboard json
This commit is contained in:
parent
13bebb70d0
commit
7004f2b437
|
@ -35,11 +35,13 @@ class Api {
|
||||||
'cycle' => 'cyclical',
|
'cycle' => 'cyclical',
|
||||||
'bump' => 'last_modified',
|
'bump' => 'last_modified',
|
||||||
'embed' => 'embed',
|
'embed' => 'embed',
|
||||||
|
'board' => 'board',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->threadsPageFields = array(
|
$this->threadsPageFields = array(
|
||||||
'id' => 'no',
|
'id' => 'no',
|
||||||
'bump' => 'last_modified'
|
'bump' => 'last_modified',
|
||||||
|
'board' => 'board',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->fileFields = array(
|
$this->fileFields = array(
|
||||||
|
|
|
@ -458,5 +458,21 @@
|
||||||
'recent_posts' => $recent_posts,
|
'recent_posts' => $recent_posts,
|
||||||
'board' => $board
|
'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…
Reference in New Issue