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'=>"
" . @@ -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), diff --git a/mod.php b/mod.php index ad3ee85d..37a86c4a 100644 --- a/mod.php +++ b/mod.php @@ -109,7 +109,7 @@ } echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Dashboard', 'body'=>$body //,'mod'=>true /* All 'mod' does, at this point, is put the "Return to dashboard" link in. */ @@ -140,7 +140,7 @@ $body .= ''; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Moderation log', 'body'=>$body, 'mod'=>true @@ -187,7 +187,7 @@ ''; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Private message', 'body'=>$body, 'mod'=>true @@ -225,7 +225,7 @@ $query->execute() or error(db_error($query)); echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'PM sent', 'body'=>'

Message sent successfully to ' . htmlentities($to['username']) . '.

', 'mod'=>true @@ -252,7 +252,7 @@ ''; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'New PM for ' . htmlentities($to['username']), 'body'=>$body ,'mod'=>true @@ -314,7 +314,7 @@ $body .= ''; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Manage users', 'body'=>$body ,'mod'=>true @@ -372,7 +372,7 @@ ''; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'New user', 'body'=>$body ,'mod'=>true @@ -461,7 +461,7 @@ ''; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Edit user', 'body'=>$body ,'mod'=>true @@ -522,7 +522,7 @@ ($reports == $count['count'] ? 'all ' . $reports . ' reports' : $reports . ' of ' . $count['count'] . ' reports') . '.

'; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Report queue', 'body'=>$body, 'mod'=>true @@ -637,7 +637,7 @@ ''; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Manage – ' . sprintf($config['board_abbreviation'], $board['uri']), 'body'=>$body, 'mod'=>true @@ -721,7 +721,7 @@ } echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Ban list', 'body'=>$body, 'mod'=>true @@ -792,7 +792,7 @@ $body = '
Configuration' . $data . '
'; echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'Configuration', 'body'=>$body, 'mod'=>true @@ -873,7 +873,7 @@ // TODO: Statistics, etc, in the dashboard. echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'New board', 'body'=>$body, 'mod'=>true @@ -1186,7 +1186,7 @@ $body = form_newBan($post['ip'], null, isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false, $delete ? $post['id'] : false, $delete ? $boardName : false); echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'New ban', 'body'=>$body, 'mod'=>true @@ -1295,7 +1295,7 @@ $body .= form_newBan($ip, null, isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : false); echo Element('page.html', Array( - 'index'=>$config['root'], + 'config'=>$config, 'title'=>'IP: ' . $ip, 'subtitle' => $host, 'body'=>$body, diff --git a/templates/index.html b/templates/index.html index b14e2e4e..30cb3259 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,20 +1,22 @@  - + {board[url]} - {board[name]} - + + {config[meta_keywords]?} {boardlist[top]} {pm?
{pm}

} + {config[url_banner]?}

{board[url]} - {board[name]}

{board[title]?{board[title]}}

{mod?Return to dashboard}

-
+ {hidden_inputs} {mod?} @@ -41,7 +43,7 @@ - + diff --git a/templates/page.html b/templates/page.html index ad1ef982..f83f0191 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,7 +1,7 @@  - + {title} diff --git a/templates/thread.html b/templates/thread.html index b60e5f7a..e8df7647 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -1,20 +1,21 @@  - + {board[url]} - {board[name]} - + {boardlist[top]} {pm?
{pm}

} + {url_banner?}

{board[url]} - {board[name]}

{board[title]?{board[title]}}

{mod?Return to dashboard}

- {hidden_inputs} + {hidden_inputs} {mod?} @@ -41,7 +42,7 @@ - +