From bb06593ef5f21b4bc4432530e5ca634f09764773 Mon Sep 17 00:00:00 2001 From: Dan Saunders Date: Sun, 25 Aug 2013 23:26:41 -0400 Subject: Added post-delete handling on themes that should use it. --- templates/themes/catalog/theme.php | 2 +- templates/themes/recent/theme.php | 2 +- templates/themes/sitemap/theme.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 96550683..424a813b 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -20,7 +20,7 @@ $b = new Catalog(); $b->build($settings, $board); } - } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') && in_array($board, $boards)) { + } 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); } diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 08d910f8..4bbf1469 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -24,7 +24,7 @@ $this->excluded = explode(' ', $settings['exclude']); - if ($action == 'all' || $action == 'post' || $action == 'post-thread') + if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete') file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings)); } diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php index 226f8357..7e5b1984 100644 --- a/templates/themes/sitemap/theme.php +++ b/templates/themes/sitemap/theme.php @@ -11,7 +11,7 @@ // - post (a post has been made) // - thread (a thread has been made) - if ($action != 'post' && $action != 'post-thread') + if ($action != 'post' && $action != 'post-thread' && $action != 'post-delete') return; $boards = explode(' ', $settings['boards']); -- cgit v1.3 From 5aaa6887f647a2d16b5db995c434cea4ce98538d Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 28 Aug 2013 18:02:28 +1000 Subject: Add `ip` index to post tables for faster ?/IP/ (and flood detection, etc.) --- install.php | 6 +++++- templates/posts.sql | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/install.php b/install.php index 8725df6d..3054bf10 100644 --- a/install.php +++ b/install.php @@ -1,7 +1,7 @@ Date: Wed, 28 Aug 2013 18:30:01 +1000 Subject: Sitemap theme: Minimum time between generating, and only generate on post-thread and post-delete --- templates/themes/sitemap/info.php | 9 +++++++++ templates/themes/sitemap/theme.php | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/themes/sitemap/info.php b/templates/themes/sitemap/info.php index 43b529fa..0ea2ba9d 100644 --- a/templates/themes/sitemap/info.php +++ b/templates/themes/sitemap/info.php @@ -35,6 +35,15 @@ 'default' => 'hourly', 'size' => '20' ); + + $theme['config'][] = Array( + 'title' => 'Minimum time between regenerating', + 'name' => 'regen_time', + 'type' => 'text', + 'comment' => '(in seconds)', + 'default' => '0', + 'size' => '8' + ); $__boards = listBoards(); $__default_boards = Array(); diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php index 7e5b1984..1e36422d 100644 --- a/templates/themes/sitemap/theme.php +++ b/templates/themes/sitemap/theme.php @@ -11,9 +11,16 @@ // - post (a post has been made) // - thread (a thread has been made) - if ($action != 'post' && $action != 'post-thread' && $action != 'post-delete') + if ($action != 'post-thread' && $action != 'post-delete') return; + if ($settings['regen_time'] > 0) { + if ($last_gen = @filemtime($settings['path'])) { + if (time() - $last_gen < (int)$settings['regen_time']) + return; // Too soon + } + } + $boards = explode(' ', $settings['boards']); $threads = array(); -- cgit v1.3