diff --git a/inc/config.php b/inc/config.php index 83af50f8..dbb9bbd6 100644 --- a/inc/config.php +++ b/inc/config.php @@ -85,7 +85,9 @@ define('DIR_IMG', 'src/', true); define('DIR_THUMB', 'thumb/', true); define('DIR_RES', 'res/', true); - + + define('DIR_TEMPLATE', getcwd() . '/templates', true); + // The root directory, including the trailing slash, for Tinyboard. // examples: '/', 'http://boards.chan.org/', '/chan/' define('ROOT', '/', true); diff --git a/inc/template.php b/inc/template.php index 95fa2ff7..ff65c0c3 100644 --- a/inc/template.php +++ b/inc/template.php @@ -8,7 +8,7 @@ // Standard configuration // // Folder where the template files are kept - $templateDir = './templates'; + $templateDir = DIR_TEMPLATE; // // Enable global things like %gentime, etc. $templateGlobals = true; diff --git a/post.php b/post.php index 3e4e6934..4458164c 100644 --- a/post.php +++ b/post.php @@ -1,11 +1,11 @@ 'b', 'name' => 'Beta', 'title' => 'In development.'); + $board['dir'] = sprintf(BOARD_PATH, $board['uri']); $board['url'] = sprintf(BOARD_ABBREVIATION, $board['uri']); + if(!file_exists($board['dir'])) mkdir($board['dir'], 0777); + chdir($board['dir']); + $body = ''; // Fix for magic quotes diff --git a/test.php b/test.php index 06249c38..3e50443a 100644 --- a/test.php +++ b/test.php @@ -3,10 +3,10 @@ require 'inc/functions.php'; require 'inc/display.php'; - require 'inc/template.php'; if (file_exists('inc/instance-config.php')) { require 'inc/instance-config.php'; } + require 'inc/template.php'; require 'inc/config.php'; require 'inc/user.php';