1<?php
2/***************************************************************************
3 *                           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 5509 2006-01-29 21:19:02Z grahamje $
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
23if ( !defined('IN_PHPBB') )
24{
25	die("Hacking attempt");
26}
27
28define('HEADER_INC', true);
29
30//
31// gzip_compression
32//
33$do_gzip_compress = FALSE;
34if ( $board_config['gzip_compress'] )
35{
36	$phpver = phpversion();
37
38	$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['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($HTTP_SERVER_VARS['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(
64	'header' => 'admin/page_header.tpl')
65);
66
67// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
68$l_timezone = explode('.', $board_config['board_timezone']);
69$l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])];
70
71//
72// The following assigns all _common_ variables that may be used at any point
73// in a template. Note that all URL's should be wrapped in append_sid, as
74// should all S_x_ACTIONS for forms.
75//
76$template->assign_vars(array(
77	'SITENAME' => $board_config['sitename'],
78	'PAGE_TITLE' => $page_title,
79
80	'L_ADMIN' => $lang['Admin'],
81	'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),
82	'L_FAQ' => $lang['FAQ'],
83
84	'U_INDEX' => append_sid('../index.'.$phpEx),
85
86	'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone),
87	'S_LOGIN_ACTION' => append_sid('../login.'.$phpEx),
88	'S_JUMPBOX_ACTION' => append_sid('../viewforum.'.$phpEx),
89	'S_CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])),
90	'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
91	'S_CONTENT_ENCODING' => $lang['ENCODING'],
92	'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
93	'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
94
95	'T_HEAD_STYLESHEET' => $theme['head_stylesheet'],
96	'T_BODY_BACKGROUND' => $theme['body_background'],
97	'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'],
98	'T_BODY_TEXT' => '#'.$theme['body_text'],
99	'T_BODY_LINK' => '#'.$theme['body_link'],
100	'T_BODY_VLINK' => '#'.$theme['body_vlink'],
101	'T_BODY_ALINK' => '#'.$theme['body_alink'],
102	'T_BODY_HLINK' => '#'.$theme['body_hlink'],
103	'T_TR_COLOR1' => '#'.$theme['tr_color1'],
104	'T_TR_COLOR2' => '#'.$theme['tr_color2'],
105	'T_TR_COLOR3' => '#'.$theme['tr_color3'],
106	'T_TR_CLASS1' => $theme['tr_class1'],
107	'T_TR_CLASS2' => $theme['tr_class2'],
108	'T_TR_CLASS3' => $theme['tr_class3'],
109	'T_TH_COLOR1' => '#'.$theme['th_color1'],
110	'T_TH_COLOR2' => '#'.$theme['th_color2'],
111	'T_TH_COLOR3' => '#'.$theme['th_color3'],
112	'T_TH_CLASS1' => $theme['th_class1'],
113	'T_TH_CLASS2' => $theme['th_class2'],
114	'T_TH_CLASS3' => $theme['th_class3'],
115	'T_TD_COLOR1' => '#'.$theme['td_color1'],
116	'T_TD_COLOR2' => '#'.$theme['td_color2'],
117	'T_TD_COLOR3' => '#'.$theme['td_color3'],
118	'T_TD_CLASS1' => $theme['td_class1'],
119	'T_TD_CLASS2' => $theme['td_class2'],
120	'T_TD_CLASS3' => $theme['td_class3'],
121	'T_FONTFACE1' => $theme['fontface1'],
122	'T_FONTFACE2' => $theme['fontface2'],
123	'T_FONTFACE3' => $theme['fontface3'],
124	'T_FONTSIZE1' => $theme['fontsize1'],
125	'T_FONTSIZE2' => $theme['fontsize2'],
126	'T_FONTSIZE3' => $theme['fontsize3'],
127	'T_FONTCOLOR1' => '#'.$theme['fontcolor1'],
128	'T_FONTCOLOR2' => '#'.$theme['fontcolor2'],
129	'T_FONTCOLOR3' => '#'.$theme['fontcolor3'],
130	'T_SPAN_CLASS1' => $theme['span_class1'],
131	'T_SPAN_CLASS2' => $theme['span_class2'],
132	'T_SPAN_CLASS3' => $theme['span_class3'])
133);
134
135// Work around for "current" Apache 2 + PHP module which seems to not
136// cope with private cache control setting
137if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
138{
139	header ('Cache-Control: no-cache, pre-check=0, post-check=0');
140}
141else
142{
143	header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
144}
145header ('Expires: 0');
146header ('Pragma: no-cache');
147
148$template->pparse('header');
149
150?>
151