From c677640b64e5c3fe8406e47f7eeef2f18c5edf71 Mon Sep 17 00:00:00 2001 From: Ludovic Arnaud Date: Thu, 10 Oct 2002 00:35:35 +0000 Subject: Bugfix (disappearing forum names) + enabled jumpbox and modified it to allow category jumping. git-svn-id: file:///svn/phpbb/trunk@2950 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/forums_display.php | 6 ++-- phpBB/includes/functions.php | 73 +++++++++++++++++++++++++++++---------- phpBB/includes/page_tail.php | 13 ++++--- 3 files changed, 67 insertions(+), 25 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/forums_display.php b/phpBB/includes/forums_display.php index e71746bcb7..4cb1755600 100644 --- a/phpBB/includes/forums_display.php +++ b/phpBB/includes/forums_display.php @@ -111,16 +111,16 @@ foreach ($forum_rows as $row) if (isset($subforums[$forum_id])) { - foreach ($subforums as $row) + foreach ($subforums[$forum_id] as $row) { $alist[$row['forum_id']] = $row['forum_name']; } asort($alist); $links = array(); - foreach ($alist as $forum_id => $forum_name) + foreach ($alist as $subforum_id => $subforum_name) { - $links[] = '' . htmlspecialchars($forum_name) . ''; + $links[] = '' . htmlspecialchars($subforum_name) . ''; } $subforums_list = implode(', ', $links); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index dda7a3c393..c4e10c1bef 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -187,40 +187,72 @@ function make_jumpbox($action, $forum_id = false) global $auth, $template, $lang, $db, $nav_links, $phpEx; $boxstring = ''; + $template->assign_vars(array( 'L_GO' => $lang['Go'], 'L_JUMP_TO' => $lang['Jump_to'], @@ -555,7 +587,10 @@ function obtain_word_list(&$orig_word, &$replacement_word) function redirect($location) { global $db; - $db->sql_close(); + if (isset($db)) + { + $db->sql_close(); + } $header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . $location); @@ -633,9 +668,10 @@ function message_die($msg_code, $msg_text = '', $msg_title = '') break; case ERROR: + $db->sql_close(); + echo 'phpBB 2 :: General Error' . "\n"; echo '

phpBB2 :: General Error


' . $msg_text . '


Contact the site administrator to report this failure

'; - $db->sql_close(); break; } @@ -658,9 +694,10 @@ function msg_handler($errno, $msg_text, $errfile, $errline) case E_ERROR: case E_USER_ERROR: + $db->sql_close(); + echo 'phpBB 2 :: General Error' . "\n"; echo '

phpBB2 :: General Error


' . $msg_text . '


Contact the site administrator to report this failure

'; - $db->sql_close(); break; case E_USER_NOTICE: diff --git a/phpBB/includes/page_tail.php b/phpBB/includes/page_tail.php index 58706a2cc6..5296f41a9c 100644 --- a/phpBB/includes/page_tail.php +++ b/phpBB/includes/page_tail.php @@ -32,7 +32,7 @@ if (defined('DEBUG')) $mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; - if (!empty($_REQUEST['explain'])) + if (!empty($_REQUEST['explain']) && $auth->acl_get('a_')) { echo $db->sql_report; echo "
Page generated in $totaltime seconds with " . $db->num_queries . " queries,\nspending " . $db->sql_time . ' doing MySQL queries and ' . ($totaltime - $db->sql_time) . ' doing PHP things.
'; @@ -40,14 +40,19 @@ if (defined('DEBUG')) exit; } - $debug_output = sprintf('

[ Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . ( ( $board_config['gzip_compress'] ) ? 'On' : 'Off' ) . ' | Load : ' . ( ( $session->load ) ? $session->load : 'N/A') . ' | Explain ]', $totaltime); + $debug_output = sprintf('

[ Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . ( ( $board_config['gzip_compress'] ) ? 'On' : 'Off' ) . ' | Load : ' . (($session->load) ? $session->load : 'N/A'), $totaltime); + + if ($auth->acl_get('a_')) + { + $debug_output .= ' | Explain ]'; + } } $template->assign_vars(array( 'PHPBB_VERSION' => $board_config['version'], 'ADMIN_LINK' => ( $auth->acl_get('a_') ) ? '' . $lang['Admin_panel'] . '

' : '', - 'DEBUG_OUTPUT' => ( defined('DEBUG') ) ? $debug_output : '') -); + 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '' +)); $template->display('body'); -- cgit v1.2.1