per-board javascript files

This commit is contained in:
Michael Save 2012-03-14 21:55:22 +11:00
parent d3b1f4cfa3
commit 9df2ce179e

View File

@ -60,6 +60,8 @@
echo "Generating Javascript file...\n"; echo "Generating Javascript file...\n";
buildJavascript(); buildJavascript();
$main_js = $config['file_script'];
$boards = listBoards(); $boards = listBoards();
foreach($boards as &$board) { foreach($boards as &$board) {
@ -69,6 +71,12 @@
echo "Creating index pages...\n"; echo "Creating index pages...\n";
buildIndex(); buildIndex();
if($config['file_script'] != $main_js) {
// different javascript file
echo "Generating Javascript file...\n";
buildJavascript();
}
$query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error()); $query = query(sprintf("SELECT `id` FROM `posts_%s` WHERE `thread` IS NULL", $board['uri'])) or error(db_error());
while($post = $query->fetch()) { while($post = $query->fetch()) {
echo "Rebuilding #{$post['id']}...\n"; echo "Rebuilding #{$post['id']}...\n";