|
From: Bart v. B. <ba...@us...> - 2002-02-18 08:57:32
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv11291
Modified Files:
common.php
Log Message:
Now the code is fixed for real :D Not smart to use config info before it's read
Index: common.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/common.php,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -r1.70 -r1.71
*** common.php 18 Feb 2002 07:35:18 -0000 1.70
--- common.php 18 Feb 2002 08:57:28 -0000 1.71
***************
*** 154,157 ****
--- 154,176 ----
//
+ // Setup forum wide options, if this fails
+ // then we output a CRITICAL_ERROR since
+ // basic forum information is not available
+ //
+ $sql = "SELECT *
+ FROM " . CONFIG_TABLE;
+ if(!$result = $db->sql_query($sql))
+ {
+ message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
+ }
+ else
+ {
+ while($row = $db->sql_fetchrow($result))
+ {
+ $board_config[$row['config_name']] = $row['config_value'];
+ }
+ }
+
+ //
// Set some server variables related to the current URL, mostly used for Email
//
***************
*** 190,194 ****
}
! $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . $board_config['server_port'] . '/' : '/';
if ( !empty($HTTP_SERVER_VARS['PHP_SELF']) || !empty($HTTP_ENV_VARS['PHP_SELF']) )
--- 209,213 ----
}
! $server_port = ( !empty($board_config['server_port']) && $board_config['server_port'] <> 80 ) ? ':' . $board_config['server_port'] : '';
if ( !empty($HTTP_SERVER_VARS['PHP_SELF']) || !empty($HTTP_ENV_VARS['PHP_SELF']) )
***************
*** 207,230 ****
$script_url = $server_protocol . $server_name . $server_port . $script_name;
-
//
! // Setup forum wide options, if this fails
! // then we output a CRITICAL_ERROR since
! // basic forum information is not available
//
- $sql = "SELECT *
- FROM " . CONFIG_TABLE;
- if(!$result = $db->sql_query($sql))
- {
- message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
- }
- else
- {
- while($row = $db->sql_fetchrow($result))
- {
- $board_config[$row['config_name']] = $row['config_value'];
- }
- }
-
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
--- 226,232 ----
$script_url = $server_protocol . $server_name . $server_port . $script_name;
//
! // Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
|