Sitemap theme: Minimum time between generating, and only generate on post-thread and post-delete
This commit is contained in:
parent
5aaa6887f6
commit
f8f375ec30
@ -36,6 +36,15 @@
|
||||
'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();
|
||||
foreach ($__boards as $__board)
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user