diff options
author | Bart van Bragt <bartvb@users.sourceforge.net> | 2002-02-18 08:57:28 +0000 |
---|---|---|
committer | Bart van Bragt <bartvb@users.sourceforge.net> | 2002-02-18 08:57:28 +0000 |
commit | ae80afa875d0cd847c91c9050866f56e6139d8c0 (patch) | |
tree | 30c545d0860ea371270309a5feefad703e9425c8 /phpBB/common.php | |
parent | dc729b71204093c26bf49807b21775fba6e48004 (diff) | |
download | forums-ae80afa875d0cd847c91c9050866f56e6139d8c0.tar forums-ae80afa875d0cd847c91c9050866f56e6139d8c0.tar.gz forums-ae80afa875d0cd847c91c9050866f56e6139d8c0.tar.bz2 forums-ae80afa875d0cd847c91c9050866f56e6139d8c0.tar.xz forums-ae80afa875d0cd847c91c9050866f56e6139d8c0.zip |
Now the code is fixed for real :D Not smart to use config info before it's read
git-svn-id: file:///svn/phpbb/trunk@2182 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/common.php')
-rw-r--r-- | phpBB/common.php | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index f9d8fc769f..bc5445667c 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -153,6 +153,25 @@ else $user_ip = encode_ip($client_ip); // +// 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 // if ( !empty($HTTP_SERVER_VARS['HTTPS']) ) @@ -189,7 +208,7 @@ else $server_name = ""; } -$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . $board_config['server_port'] . '/' : '/'; +$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']) ) { @@ -206,26 +225,9 @@ else if ( !empty($HTTP_SERVER_VARS['PATH_INFO']) || !empty($HTTP_ENV_VARS['PATH_ $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 +// Show 'Board is disabled' message if needed. // -$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") ) { message_die(GENERAL_MESSAGE, 'Board_disable', 'Information'); |