mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-03 13:05:44 +02:00
Updates, removed included header/footer (merged into functions within pagestart)
git-svn-id: file:///svn/phpbb/trunk@2817 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ca71651767
commit
09b7d6b2b9
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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' )
|
||||
|
||||
<?php
|
||||
|
||||
$ignore_copyright = true;
|
||||
|
||||
include('page_footer_admin.'.$phpEx);
|
||||
page_footer(false);
|
||||
|
||||
}
|
||||
else if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
|
||||
@ -70,8 +68,7 @@ else if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
|
||||
//
|
||||
// Cheat and use the meta tag to change some stylesheet info
|
||||
//
|
||||
$meta = '<style type="text/css">body {background-color: #98AAB1}</style>';
|
||||
include('page_header_admin.'.$phpEx);
|
||||
page_header('', '<style type="text/css">body {background-color: #98AAB1}</style>', 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' )
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@ksort($module);
|
||||
|
||||
foreach ( $module as $cat => $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);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
@ -119,19 +117,20 @@ else if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@ksort($action_ary);
|
||||
@ksort($action_ary);
|
||||
|
||||
foreach ( $action_ary as $action => $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';
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $cell_bg; ?>"><a class="genmed" href="<?php echo $file; ?>" target="main"><?php echo $action; ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,8 +145,7 @@ else if ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'left' )
|
||||
//
|
||||
// Output footer but don't include copyright info
|
||||
//
|
||||
$ignore_copyright = true;
|
||||
include('page_footer_admin.'.$phpEx);
|
||||
page_footer(false);
|
||||
|
||||
}
|
||||
elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
|
||||
@ -184,7 +182,7 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
|
||||
{
|
||||
|
||||
}
|
||||
else if ( isset($HTTP_POST_VARS['resonline']) )
|
||||
else if ( isset($HTTP_POST_VARS['resetonline']) )
|
||||
{
|
||||
|
||||
}
|
||||
@ -331,9 +329,7 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
|
||||
?>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
//
|
||||
// Should really check the browser to stop this whining ...
|
||||
//
|
||||
<!--
|
||||
function marklist(status)
|
||||
{
|
||||
for (i = 0; i < document.inactive.length; i++)
|
||||
@ -341,6 +337,7 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
|
||||
document.inactive.elements[i].checked = status;
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<h1><?php echo $lang['Welcome_phpBB']; ?></h1>
|
||||
@ -448,6 +445,7 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
|
||||
do
|
||||
{
|
||||
$row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><a href="<?php echo 'admin_users.' . $phpEx . $SID . '&u=' . $row['user_id']; ?>"><?php echo $row['username']; ?></a></td>
|
||||
@ -455,6 +453,7 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
|
||||
<td class="<?php echo $row_class; ?>"> <input type="checkbox" name="mark[]" value="<?php echo $row['user_id']; ?>" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
while ( $row = $db->sql_fetchrow($result) );
|
||||
|
||||
@ -476,7 +475,6 @@ elseif ( isset($HTTP_GET_VARS['pane']) && $HTTP_GET_VARS['pane'] == 'right' )
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
@ -1,73 +0,0 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* page_footer_admin.php
|
||||
* -------------------
|
||||
* begin : Saturday, Jul 14, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if ( !defined('IN_PHPBB') )
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
|
||||
if ( !$ignore_copyright )
|
||||
{
|
||||
|
||||
?>
|
||||
|
||||
<div align="center"><span class="copyright">Powered by phpBB <?php echo $board_config['version']; ?> © 2002 <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a></span></div>
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Close our DB connection.
|
||||
//
|
||||
$db->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;
|
||||
|
||||
?>
|
@ -1,89 +0,0 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* page_header_admin.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if ( !defined('IN_PHPBB') )
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
|
||||
define('HEADER_INC', true);
|
||||
|
||||
//
|
||||
// gzip_compression
|
||||
//
|
||||
$do_gzip_compress = FALSE;
|
||||
if ( $board_config['gzip_compress'] )
|
||||
{
|
||||
$phpver = phpversion();
|
||||
|
||||
if ( $phpver >= '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']);
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['ENCODING']; ?>">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="stylesheet" href="subSilver.css" type="text/css">
|
||||
<?php
|
||||
|
||||
echo $meta;
|
||||
|
||||
?>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
th { background-image: url('images/cellpic3.gif') }
|
||||
td.cat { background-image: url('images/cellpic1.gif') }
|
||||
//-->
|
||||
</style>
|
||||
<title><?php echo $board_config['sitename'] . ' - ' . $page_title; ?></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a name="top"></a>
|
||||
|
||||
<?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']);
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['ENCODING']; ?>">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="stylesheet" href="subSilver.css" type="text/css">
|
||||
<?php
|
||||
|
||||
echo $meta;
|
||||
|
||||
?>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
th { background-image: url('images/cellpic3.gif') }
|
||||
td.cat { background-image: url('images/cellpic1.gif') }
|
||||
//-->
|
||||
</style>
|
||||
<title><?php echo $board_config['sitename'] . ' - ' . $page_title; ?></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
if ( $table_html )
|
||||
{
|
||||
|
||||
?>
|
||||
<a name="top"></a>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
@ -64,21 +126,66 @@ function page_header($sub_title)
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function page_footer($ignore_copyright = false)
|
||||
function page_footer($copyright_html = true)
|
||||
{
|
||||
global $board_config, $db, $lang, $phpEx;
|
||||
global $board_config, $db, $lang, $phpEx, $gzip_compress;
|
||||
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
include('page_footer_admin.'.$phpEx);
|
||||
if ( $copyright_html )
|
||||
{
|
||||
|
||||
?>
|
||||
|
||||
<div align="center"><span class="copyright">Powered by phpBB <?php echo $board_config['version']; ?> © 2002 <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a></span></div>
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Close our DB connection.
|
||||
//
|
||||
$db->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 )
|
||||
{
|
||||
|
||||
?>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
|
Loading…
x
Reference in New Issue
Block a user