summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-03-26 18:23:15 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-03-26 18:23:15 +1100
commit92310f445ca443bb6c83a372ba59761b15361c3b (patch)
tree38c0ef6adc3ecb0811a1c811a060a2ad005ad9b8 /inc
parentab5bece9d54306a12ac9fa8af9d99ffc04584353 (diff)
Allow custom URLs for stylesheet/javascript/banner
Diffstat (limited to 'inc')
-rw-r--r--inc/config.php5
-rw-r--r--inc/display.php4
-rw-r--r--inc/functions.php15
3 files changed, 15 insertions, 9 deletions
diff --git a/inc/config.php b/inc/config.php
index 640999ac..38468f57 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -419,4 +419,9 @@
// 'status' => 'http://status.example.org/'
//);
+ // Set custom locations for stylesheets, scripts and maybe a banner.
+ // This can be good for load balancing across multiple servers or hostnames.
+ // $config['url_stylesheet'] = 'http://static.example.org/style.css';
+ // $config['url_javascript'] = 'http://static.example.org/script.js';
+ // $config['url_banner'] = '/banner.php';
?> \ No newline at end of file
diff --git a/inc/display.php b/inc/display.php
index c6570002..966ddab6 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -61,7 +61,7 @@
if(function_exists('sql_close')) sql_close();
die(Element('page.html', Array(
- 'index'=>$config['root'],
+ 'config'=>$config,
'title'=>'Error',
'subtitle'=>'An error has occured.',
'body'=>"<center>" .
@@ -82,7 +82,7 @@
'index'=>$config['root'],
'title'=>'Login',
'body'=>Element('login.html', Array(
- 'index'=>$config['root'],
+ 'config'=>$config,
'error'=>$error,
'username'=>$username,
'redirect'=>$redirect
diff --git a/inc/functions.php b/inc/functions.php
index daa2d6d8..d930712f 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -12,6 +12,11 @@
require $board['dir'] . '/config.php';
}
+ if(!isset($config['url_stylesheet']))
+ $config['url_stylesheet'] = $config['root'] . 'style.css';
+ if(!isset($config['url_javascript']))
+ $config['url_javascript'] = $config['root'] . 'script.js';
+
if(!isset($config['post_url']))
$config['post_url'] = $config['root'] . $config['file_post'];
@@ -56,7 +61,6 @@
else
$config['uri_img'] = sprintf($config['uri_img'], $board['dir']);
-
if($config['root_file']) {
chdir($config['root_file']);
}
@@ -256,7 +260,7 @@
// Show banned page and exit
die(Element('page.html', Array(
- 'index' => $config['root'],
+ 'config' => $config,
'title' => 'Banned',
'subtitle' => 'You are banned!',
'body' => $body
@@ -503,11 +507,10 @@
}
return Array(
- 'button'=>$config['button_newtopic'],
'board'=>$board,
'body'=>$body,
'post_url' => $config['post_url'],
- 'index' => $config['root'],
+ 'config' => $config,
'boardlist' => createBoardlist($mod)
);
}
@@ -1008,11 +1011,9 @@
if(!isset($thread)) error($config['error']['nonexistant']);
$body = Element('thread.html', Array(
- 'button'=>$config['button_reply'],
'board'=>$board,
'body'=>$thread->build(),
- 'post_url' => $config['post_url'],
- 'index' => $config['root'],
+ 'config' => $config,
'id' => $id,
'mod' => $mod,
'boardlist' => createBoardlist($mod),