aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-07-13 16:14:37 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-07-13 16:14:37 +0000
commitea983410993371bcc63e1a120fe17bed964f5f08 (patch)
tree5bb1cc1bd365b04ba40aba256c9a4b82982a691e /phpBB/includes
parent79d57c449fc190ce693d2ecfdbb0dc36e8e82be7 (diff)
downloadforums-ea983410993371bcc63e1a120fe17bed964f5f08.tar
forums-ea983410993371bcc63e1a120fe17bed964f5f08.tar.gz
forums-ea983410993371bcc63e1a120fe17bed964f5f08.tar.bz2
forums-ea983410993371bcc63e1a120fe17bed964f5f08.tar.xz
forums-ea983410993371bcc63e1a120fe17bed964f5f08.zip
Changes to include location + some other misc stuff
git-svn-id: file:///svn/phpbb/trunk@646 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/db.php14
-rw-r--r--phpBB/includes/error.php37
-rw-r--r--phpBB/includes/functions.php8
-rw-r--r--phpBB/includes/message.php14
4 files changed, 44 insertions, 29 deletions
diff --git a/phpBB/includes/db.php b/phpBB/includes/db.php
index 916aa7e0d3..ff1088ea50 100644
--- a/phpBB/includes/db.php
+++ b/phpBB/includes/db.php
@@ -24,19 +24,23 @@
switch($dbms)
{
case 'mysql':
- include('db/mysql.'.$phpEx);
+ include($phpbb_root_path . 'db/mysql.'.$phpEx);
break;
+
case 'postgres':
- include('db/postgres7.'.$phpEx);
+ include($phpbb_root_path . 'db/postgres7.'.$phpEx);
break;
+
case 'mssql':
- include('db/mssql.'.$phpEx);
+ include($phpbb_root_path . 'db/mssql.'.$phpEx);
break;
+
case 'odbc':
- include('db/odbc.'.$phpEx);
+ include($phpbb_root_path . 'db/odbc.'.$phpEx);
break;
+
case 'oracle':
- include('db/oracle.'.$phpEx);
+ include($phpbb_root_path . 'db/oracle.'.$phpEx);
break;
}
diff --git a/phpBB/includes/error.php b/phpBB/includes/error.php
index b6d73fe275..fc01406f89 100644
--- a/phpBB/includes/error.php
+++ b/phpBB/includes/error.php
@@ -24,27 +24,27 @@
function error_die($error_code, $error_msg = "", $line = "", $file = "")
{
- global $db, $template, $phpEx, $default_lang, $theme;
+ global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path;
if(!defined("HEADER_INC"))
{
- if(!empty($default_lang))
+ if(!empty($board_config['default_lang']))
{
- include('language/lang_'.$default_lang.'.'.$phpEx);
+ include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
}
else
{
- include('language/lang_english.'.$phpEx);
+ include($phpbb_root_path . 'language/lang_english.'.$phpEx);
}
if(!$template)
{
- $template = new Template("templates/Default");
+ $template = new Template($phpbb_root_path . "templates/Default");
}
if(!$theme)
{
$theme = setuptheme(1);
}
- include('includes/page_header.'.$phpEx);
+ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
}
if(!$error_msg)
{
@@ -55,13 +55,19 @@ function error_die($error_code, $error_msg = "", $line = "", $file = "")
{
$error_msg = "An Error Occured";
}
+ if(!$message_title)
+ {
+ $message_title = "General Error";
+ }
break;
case SQL_CONNECT:
+ $message_title = "General Error";
$error_msg = "Couldn't connect to database!";
break;
case BANNED:
+ $message_title = $lang['Information'];
$error_msg = "You have been banned from this forum.";
break;
@@ -69,15 +75,18 @@ function error_die($error_code, $error_msg = "", $line = "", $file = "")
break;
case SESSION_CREATE:
- $error_msg = "Error creating session. Could not log you in. Please go back and try again.";
+ $message_title = "General Error";
+ $error_msg = "Error creating session<br>Could not log you in, please go back and try again.";
break;
case NO_POSTS:
- $error_msg = "There are no posts in this forum. Click on the <b>Post New Topic</b> link on this page to post one.";
+ $message_title = $lang['Information'];
+ $error_msg = "There are no posts in this forum<br>Click on the <b>Post New Topic</b> link on this page to post one.";
break;
case LOGIN_FAILED:
- $error_msg = "Login Failed. You have specified an incorrect/inactive username or invalid password, please go back and try again.";
+ $message_title = $lang['Information'];
+ $error_msg = "Login Failed<br>You have specified an incorrect/inactive username or invalid password, please go back and try again.";
break;
}
}
@@ -88,12 +97,14 @@ function error_die($error_code, $error_msg = "", $line = "", $file = "")
}
$template->set_filenames(array(
- "error_body" => "error_body.tpl"));
+ "message_body" => "error_body.tpl")
+ );
$template->assign_vars(array(
- "ERROR_MESSAGE" => $error_msg));
- $template->pparse("error_body");
+ "ERROR_MESSAGE" => $error_msg)
+ );
+ $template->pparse("message_body");
- include('includes/page_tail.'.$phpEx);
+ include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
exit();
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 2402f5efca..50cd5af865 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -225,7 +225,7 @@ function make_forum_box($box_name, $default_forum = -1)
// Initialise user settings on page load
function init_userprefs($userdata)
{
- global $board_config, $theme, $template, $lang, $phpEx;
+ global $board_config, $theme, $template, $lang, $phpEx, $phpbb_root_path;
if(!$board_config['override_user_themes'])
{
@@ -270,15 +270,15 @@ function init_userprefs($userdata)
}
}
- $template = new Template("templates/" . $board_config['default_template']);
+ $template = new Template($phpbb_root_path . "templates/" . $board_config['default_template']);
if(file_exists("language/lang_".$board_config['default_lang'].".".$phpEx) )
{
- include('language/lang_'.$board_config['default_lang'].'.'.$phpEx);
+ include($phpbb_root_path . 'language/lang_'.$board_config['default_lang'].'.'.$phpEx);
}
else
{
- include('language/lang_english.'.$phpEx);
+ include($phpbb_root_path . 'language/lang_english.'.$phpEx);
}
return;
diff --git a/phpBB/includes/message.php b/phpBB/includes/message.php
index 1a0e1126d7..e097b34bf7 100644
--- a/phpBB/includes/message.php
+++ b/phpBB/includes/message.php
@@ -47,7 +47,7 @@
//
function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "", $err_file = "", $sql = "")
{
- global $db, $template, $board_config, $theme, $lang, $phpEx;
+ global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path;
global $userdata, $user_ip, $session_length;
global $starttime;
@@ -64,16 +64,16 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
{
if( !empty($board_config['default_lang']) )
{
- include('language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
+ include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
}
else
{
- include('language/lang_english.'.$phpEx);
+ include($phpbb_root_path . 'language/lang_english.'.$phpEx);
}
if( empty($template) )
{
- $template = new Template("templates/Default");
+ $template = new Template($phpbb_root_path . "templates/Default");
}
if( empty($theme) )
@@ -84,7 +84,7 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
//
// Load the Page Header
//
- include('includes/page_header.'.$phpEx);
+ include($phpbb_root_path . 'includes/page_header.'.$phpEx);
}
switch($msg_code)
@@ -119,7 +119,7 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
// Critical errors mean we cannot rely on _ANY_ DB information being
// available so we're going to dump out a simple echo'd statement
//
- include('language/lang_english.'.$phpEx);
+ include($phpbb_root_path . 'language/lang_english.'.$phpEx);
if($msg_text == "")
{
@@ -176,7 +176,7 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
);
$template->pparse("message_body");
- include('includes/page_tail.'.$phpEx);
+ include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else
{