Browse Source

Per-board configuration files

pull/40/head
Savetheinternet 12 years ago
parent
commit
8d6c3d655d
  1. 4
      inc/config.php
  2. 5
      inc/functions.php

4
inc/config.php

@ -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(

5
inc/functions.php

@ -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);

Loading…
Cancel
Save