diff options
| author | czaks <marcin@6irc.net> | 2016-05-08 10:54:30 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2016-05-08 10:54:30 +0200 |
| commit | b6f0317bde1b6d9a9ac5d81a660865a7aa9ad13d (patch) | |
| tree | 6c6523b9081d2d561080f1b2d8378d93e2a237e1 /templates/themes/catalog/theme.php | |
| parent | 644f227ab33f247dc82e0208fe2125d5d002f4f4 (diff) | |
advanced build (1/2): a small refactor of index generating procedure; generation strategies
Diffstat (limited to 'templates/themes/catalog/theme.php')
| -rw-r--r-- | templates/themes/catalog/theme.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 239d4dff..4f512c03 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -16,20 +16,25 @@ if ($action == 'all') { foreach ($boards as $board) { $b = new Catalog(); - if ($config['smart_build']) { + + $action = generation_strategy("sb_catalog", array($board)); + if ($action == 'delete') { file_unlink($config['dir']['home'] . $board . '/catalog.html'); + file_unlink($config['dir']['home'] . $board . '/index.rss'); } - else { + elseif ($action == 'rebuild') { $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(); - if ($config['smart_build']) { + $action = generation_strategy("sb_catalog", array($board)); + if ($action == 'delete') { file_unlink($config['dir']['home'] . $board . '/catalog.html'); + file_unlink($config['dir']['home'] . $board . '/index.rss'); } - else { + elseif ($action == 'rebuild') { $b->build($settings, $board); } } |
