From b6f0317bde1b6d9a9ac5d81a660865a7aa9ad13d Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 8 May 2016 10:54:30 +0200 Subject: advanced build (1/2): a small refactor of index generating procedure; generation strategies --- templates/themes/recent/theme.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'templates/themes/recent/theme.php') diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index f44e2529..95921c35 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -25,10 +25,11 @@ $this->excluded = explode(' ', $settings['exclude']); if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete') { - if ($config['smart_build']) { + $action = generation_strategy('sb_recent', array()); + if ($action == 'delete') { file_unlink($config['dir']['home'] . $settings['html']); } - else { + elseif ($action == 'rebuild') { file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings)); } } -- cgit v1.3 From fed9065cf1fe759e20ec10baf0aba1309ee6f8ab Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 19 Jun 2016 02:23:24 +0200 Subject: skip non-image files in recent themes; fixes vichan-devel/vichan#185 --- templates/themes/recent/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/themes/recent/theme.php') diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 95921c35..a826048f 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -65,7 +65,7 @@ if (isset($post['files'])) $files = json_decode($post['files']); - if ($files[0]->file == 'deleted') continue; + if ($files[0]->file == 'deleted' || $files[0]->thumb == 'file') continue; // board settings won't be available in the template file, so generate links now $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] -- cgit v1.3