if ($action != 'post-thread' && $action != 'post-delete')
if ($action != 'all') {
return;
if ($action != 'post-thread' && $action != 'post-delete')
return;
if (isset($settings['regen_time']) && $settings['regen_time'] > 0) {
if ($last_gen = @filemtime($settings['path'])) {
if (isset($settings['regen_time']) && $settings['regen_time'] > 0) {
if (time() - $last_gen < (int)$settings['regen_time'])
if ($last_gen = @filemtime($settings['path'])) {
return; // Too soon
if (time() - $last_gen < (int)$settings['regen_time'])
return; // Too soon
}
}
}
}
}
$boards = explode(' ', $settings['boards']);
if ($config['smart_build']) {
file_unlink($settings['path']);
}
else {
$boards = explode(' ', $settings['boards']);
$threads = array();
$threads = array();
foreach ($boards as $board) {
foreach ($boards as $board) {
$query = query(sprintf("SELECT `id`, `id` AS `thread_id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error());
$query = query(sprintf("SELECT `id`, `id` AS `thread_id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error());