diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-04-16 17:33:13 +1000 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-04-16 17:33:13 +1000 |
| commit | 7101fa540b86a2d90d50ff1121359f5881b507cd (patch) | |
| tree | 31008d9c0344f73425ab824b7ca7114129c60b1a | |
| parent | 41e1a2481b4d2b3217b667063d9bf5115dfec9ab (diff) | |
rebuilding
| -rw-r--r-- | inc/mod/pages.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 2532e2e7..98851c52 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -447,18 +447,24 @@ function mod_rebuild() { continue; openBoard($board['uri']); - $log[] = '<strong>' . sprintf($config['board_abbreviation'], $board['uri']) . '</strong>: Creating index pages'; - if (!in_array($config['file_script'], $rebuilt_scripts)) { + if (isset($_POST['rebuild_index'])) { + buildIndex(); + $log[] = '<strong>' . sprintf($config['board_abbreviation'], $board['uri']) . '</strong>: Creating index pages'; + } + + if (isset($_POST['rebuild_javascript']) && !in_array($config['file_script'], $rebuilt_scripts)) { $log[] = '<strong>' . sprintf($config['board_abbreviation'], $board['uri']) . '</strong>: Rebuilding <strong>' . $config['file_script'] . '</strong>'; buildJavascript(); $rebuilt_scripts[] = $config['file_script']; } - $query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); - while ($post = $query->fetch(PDO::FETCH_ASSOC)) { - $log[] = '<strong>' . sprintf($config['board_abbreviation'], $board['uri']) . '</strong>: Rebuilding thread #' . $post['id']; - buildThread($post['id']); + if (isset($_POST['rebuild_thread'])) { + $query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { + $log[] = '<strong>' . sprintf($config['board_abbreviation'], $board['uri']) . '</strong>: Rebuilding thread #' . $post['id']; + buildThread($post['id']); + } } } |
