| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
<span class="code-comment"> * page_header_admin.php |
|---|
| 4 |
* ------------------- |
|---|
| 5 |
* begin : Saturday, Feb 13, 2001 |
|---|
| 6 |
* copyright : (C) 2001 The phpBB Group |
|---|
| 7 |
* email : support@phpbb.com |
|---|
| 8 |
* |
|---|
| 9 |
* $Id: page_header_admin.php,v 1.12.2.6 2005/03/26 14:15:59 acydburn Exp $ |
|---|
| 10 |
* |
|---|
| 11 |
* |
|---|
| 12 |
***************************************************************************/ |
|---|
| 13 |
|
|---|
| 14 |
/*************************************************************************** |
|---|
| 15 |
* |
|---|
| 16 |
* This program is free software; you can redistribute it and/or modify |
|---|
| 17 |
* it under the terms of the GNU General Public License as published by |
|---|
| 18 |
* the Free Software Foundation; either version 2 of the License, or |
|---|
| 19 |
* (at your option) any later version. |
|---|
| 20 |
* |
|---|
| 21 |
***************************************************************************/ |
|---|
| 22 |
|
|---|
| 23 |
if ( !defined('IN_PHPBB') )</span> |
|---|
| 24 |
<span class="code-keyword">{ |
|---|
| 25 |
die("Hacking attempt"); |
|---|
| 26 |
} |
|---|
| 27 |
|
|---|
| 28 |
define('HEADER_INC', true); |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
<span class="code-comment">// gzip_compression |
|---|
| 32 |
// |
|---|
| 33 |
$do_gzip_compress = FALSE;</span> |
|---|
| 34 |
<span class="code-lang">if ( $config['gzip_compress'] ) |
|---|
| 35 |
{ |
|---|
| 36 |
$phpver = phpversion(); |
|---|
| 37 |
|
|---|
| 38 |
$useragent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); |
|---|
| 39 |
|
|---|
| 40 |
if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) |
|---|
| 41 |
{ |
|---|
| 42 |
if ( extension_loaded('zlib') ) |
|---|
| 43 |
{ |
|---|
| 44 |
ob_start('ob_gzhandler'); |
|---|
| 45 |
} |
|---|
| 46 |
} |
|---|
| 47 |
else if ( $phpver > '4.0' ) |
|---|
| 48 |
{ |
|---|
| 49 |
if ( strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') ) |
|---|
| 50 |
{ |
|---|
| 51 |
if ( extension_loaded('zlib') ) |
|---|
| 52 |
{ |
|---|
| 53 |
$do_gzip_compress = TRUE; |
|---|
| 54 |
ob_start(); |
|---|
| 55 |
ob_implicit_flush(0); |
|---|
| 56 |
|
|---|
| 57 |
header('Content-Encoding: gzip'); |
|---|
| 58 |
} |
|---|
| 59 |
} |
|---|
| 60 |
} |
|---|
| 61 |
} |
|---|
| 62 |
|
|---|
| 63 |
$template->set_filenames(array(</span> |
|---|
| 64 |
<span class="code-lang"> 'header' => '../admin/page_header.tpl') |
|---|
| 65 |
); |
|---|
| 66 |
|
|---|
| 67 |
<span class="code-comment">// The following assigns all _common_ variables that may be used at any point |
|---|
| 68 |
// in a template. Note that all URL's should be wrapped in append_sid, as |
|---|
| 69 |
// should all S_x_ACTIONS for forms. |
|---|
| 70 |
// |
|---|
| 71 |
|
|---|
| 72 |
$template->assign_vars(array(</span> |
|---|
| 73 |
<span class="code-lang"> 'SITENAME' => $config['sitename'], |
|---|
| 74 |
'TRACKER_URL' => $root_path, |
|---|
| 75 |
'SID' => $userdata['session_id'], |
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
'U_INDEX' => append_sid($root_path . 'phpbb2.php?page=index'), |
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
'S_LOGIN_ACTION' => append_sid($root_path . 'login.php'), |
|---|
| 82 |
|
|---|
| 83 |
'S_JUMPBOX_ACTION' => append_sid($root_path . 'phpbb2.php?page=viewforum'), |
|---|
| 84 |
'S_CURRENT_TIME' => sprintf($lang['current_time'], create_date(time())), |
|---|
| 85 |
'L_LANGUAGE_CHARSET' => 'utf-8', |
|---|
| 86 |
|
|---|
| 87 |
'T_HEAD_STYLESHEET' => $theme['head_stylesheet'], |
|---|
| 88 |
'T_BODY_BACKGROUND' => $theme['body_background'], |
|---|
| 89 |
'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'], |
|---|
| 90 |
'T_BODY_TEXT' => '#'.$theme['body_text'], |
|---|
| 91 |
'T_BODY_LINK' => '#'.$theme['body_link'], |
|---|
| 92 |
'T_BODY_VLINK' => '#'.$theme['body_vlink'], |
|---|
| 93 |
'T_BODY_ALINK' => '#'.$theme['body_alink'], |
|---|
| 94 |
'T_BODY_HLINK' => '#'.$theme['body_hlink'], |
|---|
| 95 |
'T_TR_COLOR1' => '#'.$theme['tr_color1'], |
|---|
| 96 |
'T_TR_COLOR2' => '#'.$theme['tr_color2'], |
|---|
| 97 |
'T_TR_COLOR3' => '#'.$theme['tr_color3'], |
|---|
| 98 |
'T_TR_CLASS1' => $theme['tr_class1'], |
|---|
| 99 |
'T_TR_CLASS2' => $theme['tr_class2'], |
|---|
| 100 |
'T_TR_CLASS3' => $theme['tr_class3'], |
|---|
| 101 |
'T_TH_COLOR1' => '#'.$theme['th_color1'], |
|---|
| 102 |
'T_TH_COLOR2' => '#'.$theme['th_color2'], |
|---|
| 103 |
'T_TH_COLOR3' => '#'.$theme['th_color3'], |
|---|
| 104 |
'T_TH_CLASS1' => $theme['th_class1'], |
|---|
| 105 |
'T_TH_CLASS2' => $theme['th_class2'], |
|---|
| 106 |
'T_TH_CLASS3' => $theme['th_class3'], |
|---|
| 107 |
'T_TD_COLOR1' => '#'.$theme['td_color1'], |
|---|
| 108 |
'T_TD_COLOR2' => '#'.$theme['td_color2'], |
|---|
| 109 |
'T_TD_COLOR3' => '#'.$theme['td_color3'], |
|---|
| 110 |
'T_TD_CLASS1' => $theme['td_class1'], |
|---|
| 111 |
'T_TD_CLASS2' => $theme['td_class2'], |
|---|
| 112 |
'T_TD_CLASS3' => $theme['td_class3'], |
|---|
| 113 |
'T_FONTFACE1' => $theme['fontface1'], |
|---|
| 114 |
'T_FONTFACE2' => $theme['fontface2'], |
|---|
| 115 |
'T_FONTFACE3' => $theme['fontface3'], |
|---|
| 116 |
'T_FONTSIZE1' => $theme['fontsize1'], |
|---|
| 117 |
'T_FONTSIZE2' => $theme['fontsize2'], |
|---|
| 118 |
'T_FONTSIZE3' => $theme['fontsize3'], |
|---|
| 119 |
'T_FONTCOLOR1' => '#'.$theme['fontcolor1'], |
|---|
| 120 |
'T_FONTCOLOR2' => '#'.$theme['fontcolor2'], |
|---|
| 121 |
'T_FONTCOLOR3' => '#'.$theme['fontcolor3'], |
|---|
| 122 |
'T_SPAN_CLASS1' => $theme['span_class1'], |
|---|
| 123 |
'T_SPAN_CLASS2' => $theme['span_class2'], |
|---|
| 124 |
'T_SPAN_CLASS3' => $theme['span_class3']) |
|---|
| 125 |
); |
|---|
| 126 |
|
|---|
| 127 |
<span class="code-comment">// cope with private cache control setting |
|---|
| 128 |
if (!empty($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache/2'))</span> |
|---|
| 129 |
<span class="code-keyword">{ |
|---|
| 130 |
header ('Cache-Control: no-cache, pre-check=0, post-check=0'); |
|---|
| 131 |
} |
|---|
| 132 |
else |
|---|
| 133 |
{ |
|---|
| 134 |
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); |
|---|
| 135 |
} |
|---|
| 136 |
header('Expires: 0'); |
|---|
| 137 |
header('Pragma: no-cache'); |
|---|
| 138 |
header('Content-type: text/html; charset=UTF-8'); |
|---|
| 139 |
|
|---|
| 140 |
$template->display('header'); |
|---|
| 141 |
|
|---|
| 142 |
?> |
|---|