diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index 9230f63828..0fe47bd0c4 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -65,7 +65,14 @@ else $forum_sql = ''; } -$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; +if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) +{ + $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; +} +else +{ + $mode = ''; +} // // Start program proper diff --git a/phpBB/admin/admin_ranks.php b/phpBB/admin/admin_ranks.php index 1144e73100..fd87887456 100644 --- a/phpBB/admin/admin_ranks.php +++ b/phpBB/admin/admin_ranks.php @@ -53,7 +53,7 @@ if ( !$acl->get_acl_admin('user') ) // if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { - $mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; + $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } else { diff --git a/phpBB/admin/index.php b/phpBB/admin/index.php index 5779949f33..6a6651df6f 100644 --- a/phpBB/admin/index.php +++ b/phpBB/admin/index.php @@ -47,7 +47,7 @@ if ( !$acl->get_acl_admin() ) // if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'top' ) { - include('page_header_admin.'.$phpEx); + page_header('', '', false); ?> @@ -60,9 +60,7 @@ if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'top' ) body {background-color: #98AAB1}'; - include('page_header_admin.'.$phpEx); + page_header('', '', false); // // Grab module information using Bart's "neat-o-module" system (tm) @@ -107,11 +104,12 @@ else if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' ) $action_ary ) + if ( is_array($module) ) { - $cat = ( !empty($lang[$cat . '_cat']) ) ? $lang[$cat . '_cat'] : preg_replace('/_/', ' ', $cat); + @ksort($module); + foreach ( $module as $cat => $action_ary ) + { + $cat = ( !empty($lang[$cat . '_cat']) ) ? $lang[$cat . '_cat'] : preg_replace('/_/', ' ', $cat); ?> @@ -119,19 +117,20 @@ else if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' ) $file ) - { - $action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace('/_/', ' ', $action); + foreach ( $action_ary as $action => $file ) + { + $action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace('/_/', ' ', $action); - $cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1'; + $cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1'; ?>

@@ -448,6 +445,7 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' ) do { $row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1'; + ?> @@ -455,6 +453,7 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )    sql_fetchrow($result) ); @@ -476,7 +475,6 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' ) } - ?> diff --git a/phpBB/admin/page_footer_admin.php b/phpBB/admin/page_footer_admin.php deleted file mode 100644 index 96ba8a40e6..0000000000 --- a/phpBB/admin/page_footer_admin.php +++ /dev/null @@ -1,73 +0,0 @@ - - -
Powered by phpBB © 2002 phpBB Group
- -
- - - -sql_close(); - -// -// Compress buffered output if required -// and send to browser -// -if ( $do_gzip_compress ) -{ - // - // Borrowed from php.net! - // - $gzip_contents = ob_get_contents(); - ob_end_clean(); - - $gzip_size = strlen($gzip_contents); - $gzip_crc = crc32($gzip_contents); - - $gzip_contents = gzcompress($gzip_contents, 9); - $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4); - - echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; - echo $gzip_contents; - echo pack("V", $gzip_crc); - echo pack("V", $gzip_size); -} - -exit; - -?> \ No newline at end of file diff --git a/phpBB/admin/page_header_admin.php b/phpBB/admin/page_header_admin.php deleted file mode 100644 index a7e8abd282..0000000000 --- a/phpBB/admin/page_header_admin.php +++ /dev/null @@ -1,89 +0,0 @@ -= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible') ) - { - if ( extension_loaded('zlib') ) - { - ob_start('ob_gzhandler'); - } - } - else if ( $phpver > '4.0' ) - { - if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') ) - { - if ( extension_loaded('zlib') ) - { - $do_gzip_compress = TRUE; - ob_start(); - ob_implicit_flush(0); - - header("Content-Encoding: gzip"); - } - } - } -} - -header("Content-type: text/html; charset=" . $lang['ENCODING']); - -?> - - - - - - - - -<?php echo $board_config['sitename'] . ' - ' . $page_title; ?> - - - - - - \ No newline at end of file diff --git a/phpBB/admin/pagestart.php b/phpBB/admin/pagestart.php index 55098ed41b..29027171b6 100644 --- a/phpBB/admin/pagestart.php +++ b/phpBB/admin/pagestart.php @@ -44,13 +44,75 @@ $session->configure($userdata); // ----------------------------- // Functions // -function page_header($sub_title) +function page_header($sub_title, $meta = '', $table_html = true) { - global $board_config, $db, $lang, $phpEx; + global $board_config, $db, $lang, $phpEx, $gzip_compress; + global $HTTP_SERVER_VARS; - include('page_header_admin.'.$phpEx); + define('HEADER_INC', true); + + // + // gzip_compression + // + $gzip_compress = false; + if ( $board_config['gzip_compress'] ) + { + $phpver = phpversion(); + + if ( $phpver >= '4.0.4pl1' && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'compatible') ) + { + if ( extension_loaded('zlib') ) + { + ob_start('ob_gzhandler'); + } + } + else if ( $phpver > '4.0' ) + { + if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') ) + { + if ( extension_loaded('zlib') ) + { + $gzip_compress = true; + ob_start(); + ob_implicit_flush(0); + + header("Content-Encoding: gzip"); + } + } + } + } + + header("Content-type: text/html; charset=" . $lang['ENCODING']); ?> + + + + + + + + +<?php echo $board_config['sitename'] . ' - ' . $page_title; ?> + + + + + @@ -64,21 +126,66 @@ function page_header($sub_title)
- + +
Powered by phpBB © 2002 phpBB Group
+ +
+ + + +sql_close(); + + // + // Compress buffered output if required + // and send to browser + // + if ( $gzip_compress ) + { + // + // Borrowed from php.net! + // + $gzip_contents = ob_get_contents(); + ob_end_clean(); + + $gzip_size = strlen($gzip_contents); + $gzip_crc = crc32($gzip_contents); + + $gzip_contents = gzcompress($gzip_contents, 9); + $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4); + + echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; + echo $gzip_contents; + echo pack("V", $gzip_crc); + echo pack("V", $gzip_size); + } + + exit; } @@ -88,6 +195,7 @@ function page_message($title, $message, $show_header) if ( $show_header ) { + ?>