Fixed bug causing templates to fail after a chdir()
This commit is contained in:
parent
6f5966e380
commit
4dc13a3a92
@ -86,6 +86,8 @@
|
|||||||
define('DIR_THUMB', 'thumb/', true);
|
define('DIR_THUMB', 'thumb/', true);
|
||||||
define('DIR_RES', 'res/', true);
|
define('DIR_RES', 'res/', true);
|
||||||
|
|
||||||
|
define('DIR_TEMPLATE', getcwd() . '/templates', true);
|
||||||
|
|
||||||
// The root directory, including the trailing slash, for Tinyboard.
|
// The root directory, including the trailing slash, for Tinyboard.
|
||||||
// examples: '/', 'http://boards.chan.org/', '/chan/'
|
// examples: '/', 'http://boards.chan.org/', '/chan/'
|
||||||
define('ROOT', '/', true);
|
define('ROOT', '/', true);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
// Standard configuration
|
// Standard configuration
|
||||||
//
|
//
|
||||||
// Folder where the template files are kept
|
// Folder where the template files are kept
|
||||||
$templateDir = './templates';
|
$templateDir = DIR_TEMPLATE;
|
||||||
//
|
//
|
||||||
// Enable global things like %gentime, etc.
|
// Enable global things like %gentime, etc.
|
||||||
$templateGlobals = true;
|
$templateGlobals = true;
|
||||||
|
6
post.php
6
post.php
@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
require 'inc/functions.php';
|
require 'inc/functions.php';
|
||||||
require 'inc/display.php';
|
require 'inc/display.php';
|
||||||
require 'inc/template.php';
|
|
||||||
if (file_exists('inc/instance-config.php')) {
|
if (file_exists('inc/instance-config.php')) {
|
||||||
require 'inc/instance-config.php';
|
require 'inc/instance-config.php';
|
||||||
}
|
}
|
||||||
require 'inc/config.php';
|
require 'inc/config.php';
|
||||||
|
require 'inc/template.php';
|
||||||
require 'inc/user.php';
|
require 'inc/user.php';
|
||||||
|
|
||||||
// For example, we're on /b/
|
// For example, we're on /b/
|
||||||
@ -14,8 +14,12 @@
|
|||||||
'uri' => 'b',
|
'uri' => 'b',
|
||||||
'name' => 'Beta',
|
'name' => 'Beta',
|
||||||
'title' => 'In development.');
|
'title' => 'In development.');
|
||||||
|
$board['dir'] = sprintf(BOARD_PATH, $board['uri']);
|
||||||
$board['url'] = sprintf(BOARD_ABBREVIATION, $board['uri']);
|
$board['url'] = sprintf(BOARD_ABBREVIATION, $board['uri']);
|
||||||
|
|
||||||
|
if(!file_exists($board['dir'])) mkdir($board['dir'], 0777);
|
||||||
|
chdir($board['dir']);
|
||||||
|
|
||||||
$body = '';
|
$body = '';
|
||||||
|
|
||||||
// Fix for magic quotes
|
// Fix for magic quotes
|
||||||
|
2
test.php
2
test.php
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
require 'inc/functions.php';
|
require 'inc/functions.php';
|
||||||
require 'inc/display.php';
|
require 'inc/display.php';
|
||||||
require 'inc/template.php';
|
|
||||||
if (file_exists('inc/instance-config.php')) {
|
if (file_exists('inc/instance-config.php')) {
|
||||||
require 'inc/instance-config.php';
|
require 'inc/instance-config.php';
|
||||||
}
|
}
|
||||||
|
require 'inc/template.php';
|
||||||
require 'inc/config.php';
|
require 'inc/config.php';
|
||||||
require 'inc/user.php';
|
require 'inc/user.php';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user