diff --git a/README.md b/README.md index 26dd29e..5d8877d 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Installing 7. Navigate your browser to **imgboard.php** and the following will take place: - The database structure will be created. - Directories will be verified to be writable. - - The file **index.html** will be created containing the new image board. + - The board index will be written to ``TINYIB_INDEX``. Moderating ------------ diff --git a/imgboard.php b/imgboard.php index 4ef021e..e197ebf 100644 --- a/imgboard.php +++ b/imgboard.php @@ -540,10 +540,10 @@ if (isset($_POST['message']) || isset($_POST['file'])) { } echo managePage($text, $onload); -} elseif (!file_exists('index.html') || countThreads() == 0) { +} elseif (!file_exists(TINYIB_INDEX) || countThreads() == 0) { rebuildIndexes(); } if ($redirect) { - echo '--> --> -->'; + echo '--> --> -->'; } diff --git a/inc/defines.php b/inc/defines.php index 9774e90..4b7f24b 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -9,6 +9,9 @@ define('TINYIB_RESPAGE', true); // The following are provided for backward compatibility and should not be relied upon // Copy new settings from settings.default.php to settings.php +if (!defined('TINYIB_INDEX')) { + define('TINYIB_INDEX', 'index.html'); +} if (!defined('TINYIB_MAXREPLIES')) { define('TINYIB_MAXREPLIES', 0); } diff --git a/inc/html.php b/inc/html.php index 11adb6b..452b8e9 100644 --- a/inc/html.php +++ b/inc/html.php @@ -475,7 +475,7 @@ function rebuildIndexes() { $htmlposts .= buildPost($thread, TINYIB_INDEXPAGE) . implode('', array_reverse($htmlreplies)) . "\n
"; if (++$i >= TINYIB_THREADSPERPAGE) { - $file = ($page == 0) ? 'index.html' : $page . '.html'; + $file = ($page == 0) ? TINYIB_INDEX : ($page . '.html'); writePage($file, buildPage($htmlposts, 0, $pages, $page)); $page++; @@ -485,7 +485,7 @@ function rebuildIndexes() { } if ($page == 0 || $htmlposts != '') { - $file = ($page == 0) ? 'index.html' : $page . '.html'; + $file = ($page == 0) ? TINYIB_INDEX : ($page . '.html'); writePage($file, buildPage($htmlposts, 0, $pages, $page)); } } diff --git a/settings.default.php b/settings.default.php index ddb9211..3a7836e 100644 --- a/settings.default.php +++ b/settings.default.php @@ -20,6 +20,7 @@ define('TINYIB_CAPTCHA', ''); // Reduce spam by requiring users to pass define('TINYIB_REQMOD', ''); // Require moderation before displaying posts: files / all (see README for instructions, only MySQL is supported) ['' to disable] // Board appearance +define('TINYIB_INDEX', 'index.html'); // Index file define('TINYIB_LOGO', ''); // Logo HTML define('TINYIB_THREADSPERPAGE', 10); // Amount of threads shown per index page define('TINYIB_PREVIEWREPLIES', 3); // Amount of replies previewed on index pages