summaryrefslogtreecommitdiff
path: root/templates/themes/catalog/theme.php
diff options
context:
space:
mode:
authorBenjamin Southall <applemansigloo@gmail.com>2016-09-25 16:34:47 +0900
committerBenjamin Southall <applemansigloo@gmail.com>2016-09-25 16:34:47 +0900
commita3b9c4405c6d4cca2a70dbb400e3ba3f65e7ea04 (patch)
tree5a2ebdb801748586e3fde7c12cbeda169b2c3e31 /templates/themes/catalog/theme.php
parent9436524a306c8e3d6d8a6ed195e2a3c56d5cde39 (diff)
parenta4b619ae5eaab5755dc215a496854dee8f7ce395 (diff)
Merged lainchan with vichan master at 25/9/2016 a4b619ae5eaab5755dc215a496854dee8f7ce395 @czaks czaks committed on GitHub 2 days ago
Diffstat (limited to 'templates/themes/catalog/theme.php')
-rw-r--r--templates/themes/catalog/theme.php40
1 files changed, 28 insertions, 12 deletions
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php
index 1199b54a..24cdcbb8 100644
--- a/templates/themes/catalog/theme.php
+++ b/templates/themes/catalog/theme.php
@@ -15,23 +15,30 @@
// - post-thread (a thread has been made)
if ($action === 'all') {
foreach ($boards as $board) {
- if ($config['smart_build']) {
+ $b = new Catalog();
+
+ $action = generation_strategy("sb_catalog", array($board));
+ if ($action == 'delete') {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
- } else {
- $b->build($board);
+ file_unlink($config['dir']['home'] . $board . '/index.rss');
+ }
+ elseif ($action == 'rebuild') {
+ $b->build($settings, $board);
}
}
- } elseif (in_array($board, $boards) &&
- $action == 'post-thread' ||
- ($settings['update_on_posts'] && $action == 'post') ||
- ($settings['update_on_posts'] && $action == 'post-delete'))
- {
- if ($config['smart_build']) {
+ } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && in_array($board, $boards)) {
+ $b = new Catalog();
+
+ $action = generation_strategy("sb_catalog", array($board));
+ if ($action == 'delete') {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
- } else {
- $b->build($board);
+ file_unlink($config['dir']['home'] . $board . '/index.rss');
}
- }
+ elseif ($action == 'rebuild') {
+ $b->build($settings, $board);
+ }
+
+ }
// FIXME: Check that Ukko is actually enabled
if ($settings['enable_ukko'] && (
@@ -210,10 +217,13 @@
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
}
}
+ } else {
+ $post['file'] = $config['root'] . $config['image_deleted'];
}
if (empty($post['image_count']))
$post['image_count'] = 0;
+ $post['pubdate'] = date('r', $post['time']);
$posts[] = $post;
}
@@ -247,5 +257,11 @@
'board' => $board_name,
'link' => $board_link
)));
+
+ file_write($config['dir']['home'] . $board_name . '/index.rss', Element('themes/catalog/index.rss', Array(
+ 'config' => $config,
+ 'recent_posts' => $recent_posts,
+ 'board' => $board
+ )));
}
}