diff options
Diffstat (limited to 'templates/themes/sitemap/theme.php')
| -rw-r--r-- | templates/themes/sitemap/theme.php | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php index 6bc035bb..a04b9f7c 100644 --- a/templates/themes/sitemap/theme.php +++ b/templates/themes/sitemap/theme.php @@ -23,26 +23,21 @@ } } - $action = generation_strategy('sb_sitemap', array()); + $action = generation_strategy('sb_sitemap', []); if ($action == 'delete') { file_unlink($settings['path']); } elseif ($action == 'rebuild') { - $boards = explode(' ', $settings['boards']); + $boards = explode(' ', (string) $settings['boards']); - $threads = array(); + $threads = []; 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()); $threads[$board] = $query->fetchAll(PDO::FETCH_ASSOC); } - file_write($settings['path'], Element('themes/sitemap/sitemap.xml', Array( - 'settings' => $settings, - 'config' => $config, - 'threads' => $threads, - 'boards' => $boards, - ))); + file_write($settings['path'], Element('themes/sitemap/sitemap.xml', ['settings' => $settings, 'config' => $config, 'threads' => $threads, 'boards' => $boards])); } } |
