summaryrefslogtreecommitdiff
path: root/templates/themes/sitemap/theme.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-28 18:30:01 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-28 18:30:01 +1000
commitf8f375ec302e0fb8de334d0d6c2ffc85d35ebb1a (patch)
tree42e3b7d7c12927c7332ec8ca98d955bafbaff71a /templates/themes/sitemap/theme.php
parent5aaa6887f647a2d16b5db995c434cea4ce98538d (diff)
Sitemap theme: Minimum time between generating, and only generate on post-thread and post-delete
Diffstat (limited to 'templates/themes/sitemap/theme.php')
-rw-r--r--templates/themes/sitemap/theme.php9
1 files changed, 8 insertions, 1 deletions
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();