diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 20:43:18 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2010-11-05 20:43:18 +1100 |
| commit | 247772323ecb035885778c8a6cc8f83f60482c30 (patch) | |
| tree | 9d564be9c480de329395263109ece65a0e73d015 /inc/config.php | |
| parent | f6abfa61c693b9b55937be0db0a54ca074349cc6 (diff) | |
Allowed change of root directory for systems where it is not the current directory.
Diffstat (limited to 'inc/config.php')
| -rw-r--r-- | inc/config.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/config.php b/inc/config.php index 40ea923a..397257fe 100644 --- a/inc/config.php +++ b/inc/config.php @@ -90,6 +90,11 @@ // The root directory, including the trailing slash, for Tinyboard. // examples: '/', '/board/', '/chan/' define('ROOT', '/', true); + + // If for some reason the folders and static HTML index files aren't in the current working direcotry, + // enter the directory path here. Otherwise, keep it false. + define('ROOT_FILE', false); + define('POST_URL', ROOT . 'post.php', true); define('FILE_INDEX', 'index.html', true); define('FILE_PAGE', '%d.html', true); @@ -105,11 +110,14 @@ define('BUTTON_NEWTOPIC', 'New Topic', true); define('BUTTON_REPLY', 'New Reply', true); - + define('ALWAYS_NOKO', false, true); - + define('URL_MATCH', '/^' . (@$_SERVER['HTTPS']?'https':'http').':\/\/'.$_SERVER['HTTP_HOST'] . '(' . preg_quote(ROOT, '/') . '|' . preg_quote(ROOT, '/') . '' . preg_quote(FILE_INDEX, '/') . '|' . preg_quote(ROOT, '/') . '' . str_replace('%d', '\d+', preg_quote(FILE_PAGE, '/')) . ')$/', true); - + + if(ROOT_FILE) { + chdir(ROOT_FILE); + } if(!defined('IS_INSTALLATION')) { if(!file_exists(DIR_IMG)) @mkdir(DIR_IMG) or error("Couldn't create " . DIR_IMG . ". Install manually.", true); if(!file_exists(DIR_THUMB)) @mkdir(DIR_THUMB) or error("Couldn't create " . DIR_IMG . ". Install manually.", true); |
