Per-board configuration files

This commit is contained in:
Savetheinternet 2011-02-16 19:41:34 +11:00
parent d65bf26771
commit 8d6c3d655d
2 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,10 @@
* This is the default configuration. You can copy values from here and use them in
* your instance-config.php
*
* You can also create per-board configuration files. Once a board is created, locate its directory and
* create a new file named config.php (eg. b/config.php). Like instance-config.php, you can copy values
* from here and use them in your per-board configuration files.
*
*/
$config = Array(

View File

@ -8,6 +8,9 @@
if (file_exists('inc/instance-config.php')) {
require 'instance-config.php';
}
if(isset($board['dir']) && file_exists($board['dir'] . '/config.php')) {
require $board['dir'] . '/config.php';
}
if(!isset($config['post_url']))
$config['post_url'] = $config['root'] . $config['file_post'];
@ -74,6 +77,8 @@
$board['dir'] = sprintf($config['board_path'], $board['uri']);
$board['url'] = sprintf($config['board_abbreviation'], $board['uri']);
loadConfig();
if(!file_exists($board['dir'])) mkdir($board['dir'], 0777);
if(!file_exists($board['dir'] . $config['dir']['img'])) @mkdir($board['dir'] . $config['dir']['img'], 0777) or error("Couldn't create " . $config['dir']['img'] . ". Check permissions.", true);
if(!file_exists($board['dir'] . $config['dir']['thumb'])) @mkdir($board['dir'] . $config['dir']['thumb'], 0777) or error("Couldn't create " . $config['dir']['thumb'] . ". Check permissions.", true);