diff options
| author | czaks <marcin@6irc.net> | 2015-04-02 20:54:28 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2015-04-02 20:54:28 +0200 |
| commit | 61d2729a40e8249fef8b3c0c584a9b5f7ae0777c (patch) | |
| tree | ef95fbac196a17ede3dc49736116f973eb1120f1 /templates/themes/catalog/theme.php | |
| parent | e1a8c4aa7dc62186e7c74436db9fe89071647b3d (diff) | |
themes can use smart_build now
Diffstat (limited to 'templates/themes/catalog/theme.php')
| -rw-r--r-- | templates/themes/catalog/theme.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index f8f1146e..34b28e48 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -16,11 +16,22 @@ if ($action == 'all') { foreach ($boards as $board) { $b = new Catalog(); - $b->build($settings, $board); + if ($config['smart_build']) { + file_unlink($config['dir']['home'] . $board . '/catalog.html'); + } + else { + $b->build($settings, $board); + } } } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && in_array($board, $boards)) { $b = new Catalog(); - $b->build($settings, $board); + + if ($config['smart_build']) { + file_unlink($config['dir']['home'] . $board . '/catalog.html'); + } + else { + $b->build($settings, $board); + } } } @@ -28,8 +39,12 @@ class Catalog { public function build($settings, $board_name) { global $config, $board; - - openBoard($board_name); + + if ($board['uri'] != $board_name) { + if (!openBoard($board_name)) { + error(sprintf(_("Board %s doesn't exist"), $board_name)); + } + } $recent_images = array(); $recent_posts = array(); |
