Per-board configuration files
This commit is contained in:
parent
d65bf26771
commit
8d6c3d655d
@ -7,6 +7,10 @@
|
|||||||
* This is the default configuration. You can copy values from here and use them in
|
* This is the default configuration. You can copy values from here and use them in
|
||||||
* your instance-config.php
|
* 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(
|
$config = Array(
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
if (file_exists('inc/instance-config.php')) {
|
if (file_exists('inc/instance-config.php')) {
|
||||||
require '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']))
|
if(!isset($config['post_url']))
|
||||||
$config['post_url'] = $config['root'] . $config['file_post'];
|
$config['post_url'] = $config['root'] . $config['file_post'];
|
||||||
@ -74,6 +77,8 @@
|
|||||||
$board['dir'] = sprintf($config['board_path'], $board['uri']);
|
$board['dir'] = sprintf($config['board_path'], $board['uri']);
|
||||||
$board['url'] = sprintf($config['board_abbreviation'], $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'])) 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']['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);
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user