summaryrefslogtreecommitdiff
path: root/templates/themes/catalog/theme.php
diff options
context:
space:
mode:
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
+ )));
}
}