Update of /cvsroot/meshdb/www/deal/includes
In directory usw-pr-cvs1:/tmp/cvs-serv25377/includes
Modified Files:
db.php functions.php page_header.php
Log Message:
Changes made to various files.
There was an error in functions.php which would cause a object error when an error message was needing to be displayed.
Index: db.php
===================================================================
RCS file: /cvsroot/meshdb/www/deal/includes/db.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- db.php 14 Aug 2002 03:55:15 -0000 1.2
+++ db.php 14 Aug 2002 04:15:12 -0000 1.3
@@ -63,4 +63,4 @@
message_die(CRITICAL_ERROR, "Could not connect to the database");
}
-?>
+?>
\ No newline at end of file
Index: functions.php
===================================================================
RCS file: /cvsroot/meshdb/www/deal/includes/functions.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- functions.php 14 Aug 2002 03:49:18 -0000 1.1
+++ functions.php 14 Aug 2002 04:15:12 -0000 1.2
@@ -35,7 +35,7 @@
// common.php include and session code, ie. most errors in
// pages/functions
//
-// CRITICAL_MESSAGE : Used when basic config data is available but
+// CRITICAL_MESSAGE : Used when basic config data is available but
// a session may not exist, eg. banned users
//
// CRITICAL_ERROR : Used when config data cannot be obtained, eg
@@ -43,7 +43,8 @@
//
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
{
-
+ global $db, $template, $phpEx;
+
$sql_store = $sql;
//
@@ -78,38 +79,8 @@
//
if ( !defined('HEADER_INC') && $msg_code != CRITICAL_ERROR )
{
- if ( empty($lang) )
- {
- if ( !empty($board_config['default_lang']) )
- {
- include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx);
- }
- else
- {
- include($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);
- }
- }
-
- if ( empty($template) )
- {
- $template = new Template($phpbb_root_path . 'templates/' . $board_config['board_template']);
- }
- if ( empty($theme) )
- {
- $theme = setup_style($board_config['default_style']);
- }
+ include('./includes/page_header.'.$phpEx);
- //
- // Load the Page Header
- //
- if ( !defined('IN_ADMIN') )
- {
- include($phpbb_root_path . 'includes/page_header.'.$phpEx);
- }
- else
- {
- include($phpbb_root_path . 'admin/page_header_admin.'.$phpEx);
- }
}
switch($msg_code)
@@ -131,12 +102,12 @@
case GENERAL_ERROR:
if ( $msg_text == '' )
{
- $msg_text = 'General Error!';
+ $msg_text = 'General Error.';
}
if ( $msg_title == '' )
{
- $msg_title = $lang['General_Error'];
+ $msg_title = 'General Error.';
}
case CRITICAL_ERROR:
@@ -144,16 +115,15 @@
// 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($phpbb_root_path . 'language/lang_english/lang_main.'.$phpEx);
if ( $msg_text == '' )
{
- $msg_text = $lang['A_critical_error'];
+ $msg_text = 'A critical error has occured!';
}
if ( $msg_title == '' )
{
- $msg_title = 'phpBB : <b>' . $lang['Critical_Error'] . '</b>';
+ $msg_title = 'meshDB :';
}
break;
}
@@ -173,38 +143,24 @@
if ( $msg_code != CRITICAL_ERROR )
{
- if ( !empty($lang[$msg_text]) )
- {
- $msg_text = $lang[$msg_text];
- }
+
+ $template->set_filenames(array(
+ 'message_body' => 'message_body.tpl')
+ );
- if ( !defined('IN_ADMIN') )
- {
- $template->set_filenames(array(
- 'message_body' => 'message_body.tpl')
- );
- }
- else
- {
- $template->set_filenames(array(
- 'message_body' => 'admin/admin_message_body.tpl')
- );
- }
$template->assign_vars(array(
'MESSAGE_TITLE' => $msg_title,
'MESSAGE_TEXT' => $msg_text)
);
+
+
$template->pparse('message_body');
+
+
+ // Footer
+ include('./includes/page_tail.'.$phpEx);
- if ( !defined('IN_ADMIN') )
- {
- include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
- }
- else
- {
- include($phpbb_root_path . 'admin/page_footer_admin.'.$phpEx);
- }
}
else
{
Index: page_header.php
===================================================================
RCS file: /cvsroot/meshdb/www/deal/includes/page_header.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- page_header.php 14 Aug 2002 03:49:18 -0000 1.1
+++ page_header.php 14 Aug 2002 04:15:12 -0000 1.2
@@ -38,7 +38,7 @@
//
// The following assigns all _common_ variables that may be used at any point
-// in a template.
+// in a template. Example
//
$template->assign_vars(array(
|