Add support for catalog.json and threads.json to ukko theme.
This commit is contained in:
parent
5b8213a7d8
commit
b8b7380da0
|
@ -18,6 +18,10 @@
|
||||||
if ($config['api']['enabled']) {
|
if ($config['api']['enabled']) {
|
||||||
$jsonFilename = $settings['uri'] . '/0.json';
|
$jsonFilename = $settings['uri'] . '/0.json';
|
||||||
file_unlink($jsonFilename);
|
file_unlink($jsonFilename);
|
||||||
|
$jsonFilename = $settings['uri'] . '/catalog.json';
|
||||||
|
file_unlink($jsonFilename);
|
||||||
|
$jsonFilename = $settings['uri'] . '/threads.json';
|
||||||
|
file_unlink($jsonFilename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($action == 'rebuild') {
|
elseif ($action == 'rebuild') {
|
||||||
|
@ -120,6 +124,17 @@
|
||||||
$jsonFilename = $board['dir'] . '0.json';
|
$jsonFilename = $board['dir'] . '0.json';
|
||||||
$json = json_encode($api->translatePage($apithreads));
|
$json = json_encode($api->translatePage($apithreads));
|
||||||
file_write($jsonFilename, $json);
|
file_write($jsonFilename, $json);
|
||||||
|
|
||||||
|
$catalog = array();
|
||||||
|
$catalog[0] = $apithreads;
|
||||||
|
|
||||||
|
$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);
|
||||||
}
|
}
|
||||||
return Element('index.html', array(
|
return Element('index.html', array(
|
||||||
'config' => $config,
|
'config' => $config,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user