diff options
| author | Appleman1234 <applemansigloo@gmail.com> | 2016-12-16 02:28:54 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-16 02:28:54 +0900 |
| commit | fddd1904eb84e1e0f350d8aedc60a3e674d4dd55 (patch) | |
| tree | 6b0986df636f8b7b0d3083597d06eb19fc682b15 /templates/themes | |
| parent | cae526e65a20f3da2d8884c4d8e8978c54120000 (diff) | |
| parent | b14d12bc0b79f8e28a92d9a4c52fbd65e75afda5 (diff) | |
Merge pull request #81 from lainchan/clean_prod_vichan_update
Adding catalog.json and threads.json support to ukko theme for mega.
Diffstat (limited to 'templates/themes')
| -rw-r--r-- | templates/themes/ukko/theme.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index a3f30dd4..6c5d5d15 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -18,6 +18,10 @@ if ($config['api']['enabled']) { $jsonFilename = $settings['uri'] . '/0.json'; file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/catalog.json'; + file_unlink($jsonFilename); + $jsonFilename = $settings['uri'] . '/threads.json'; + file_unlink($jsonFilename); } } elseif ($action == 'rebuild') { @@ -120,6 +124,18 @@ $jsonFilename = $board['dir'] . '0.json'; $json = json_encode($api->translatePage($apithreads)); 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( 'config' => $config, |
