7 $pagetitle = $page_name.' - '.$strings['name']
8 : $pagetitle = $strings['name'])
10 ($pagetitle = $title_name.' - '.$strings['name']);
12 define('FILENAME', basename($_SERVER['PHP_SELF']));
14 //header('Content-Type: application/xhtml+xml; charset=UTF-8');
15 header('Content-Type: text/html; charset=UTF-8');
16 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
17 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">'."\n";
21 <title>',strip_tags($pagetitle),'</title>
22 <link href="csslib/default.css" rel="stylesheet"/>',"\n";
24 //extra css thing [FIXME: make this an array]
25 if ( defined('CSS_INC') )
26 echo '<link href="csslib/'.CSS_INC
.'" rel="stylesheet"/>'."\n";
28 //theme page javascript thing
29 if ( strpos(FILENAME
, 'theme') === 0 )
30 echo '<script src="include/themepage.js" type="text/javascript"></script>'."\n";
32 if ( empty($userinfo['user']) )
33 echo '<link href="csslib/system/default" type="text/css" rel="stylesheet"/>';
35 if ( $userinfo['theme'] > 0 ) {
36 $cssinfo = mysql_fetch_row(mysql_unbuffered_query('SELECT `file`, `title` FROM `styles`
37 WHERE `style` = \''.$userinfo['theme'].'\' LIMIT 1'));
38 echo '<link href="csslib/system/',$cssinfo[0],'" type="text/css" title="',$cssinfo[1],'" rel="stylesheet"/>'."\n";
40 elseif ( $userinfo['theme'] === '0' )
41 echo '<link href="csslib/user/',$userinfo['user'],'" type="text/css" title="User Stylesheet" rel="stylesheet"/>',"\n";
47 <h1>',$cfg['headers2'][$userinfo['header']],"</h1>\n";
49 // Page title & subtitle
51 echo '<h2>',$page_name,"</h2>\n";
53 if ( strpos(FILENAME
, 'topic') === 0 )
54 echo '<h3>',$topicinfo[0],"</h3>\n";
57 echo '<ul id="menubar">'."\n";
58 if ( isset($userinfo['user']) )
59 echo '<li><a href="user',URL_STRING
,'" accesskey="u">',$userinfo['name'],' (',$userinfo['level'],")</a></li>\n";
61 echo '<li><a href="login',URL_STRING
,'" accesskey="l">Log in</a></li>
62 <li><a href="register',URL_STRING
,'" accesskey="r">Register</a></li>',"\n";
64 if ( strpos(FILENAME
, 'index') === false )
65 echo '<li><a href="." accesskey="b" rel="top">Board List</a></li>',"\n";
67 if ( isset($_GET['b']) ) {
68 if ( strpos(FILENAME
, 'board') === false )
69 echo '<li><a href="viewboard?b=',intval($_GET['b']),'" accesskey="t" rel="contents">Topic List</a></li>',"\n";
70 elseif ( isset($userinfo['user']) && strpos(FILENAME
, 'viewboard') === 0 &&
71 $userinfo['level'] >= $topic_level && empty($_GET['t']) )
72 echo '<li><a href="post?b=',intval($_GET['b']),'" accesskey="t">New Topic</a></li>',"\n";
74 if ( isset($_GET['t']) )
75 if ( strpos(FILENAME
, 'viewtopic') !== false && isset($userinfo['name']) &&
76 $closed >= 0 && $userinfo['level'] >= $topic_level )
77 echo '<li><a href="post',URL_STRING
,'" accesskey="m">New Message</a></li>',"\n";
79 echo '<li><a href="viewtopic',URL_STRING
,'" accesskey="m" rel="up">Message List</a></li>',"\n";
82 if ( isset($userinfo['user']) ) {
83 echo '<li><a href="logout',URL_STRING
,'" accesskey="l">Log Out</a></li>'."\n";
85 if ( $userinfo['level'] >= MOD
) {
86 $marks = mysql_result(mysql_query('SELECT COUNT(*) FROM `marks` WHERE `actioned` IS NULL'), 0);
87 echo '<li><a href="markqueue',URL_STRING
,'" accesskey="q">Queue: ',$marks,"</a></li>\n",
88 '<li><a href="modresources',URL_STRING
,'" accesskey="r">Mod Resources</a></li>',"\n";
92 // End of menu, start of page
94 <div id="content">',"\n";
97 if ( isset($require_login) && $require_login === true && empty($userinfo['user']) )
98 $tmp = 'You must be <a href="login'.URL_STRING
.'">Logged In</a> to view this page.';
99 elseif ( isset($require_login) && $require_login === false && isset($userinfo['user']) )
100 $tmp = 'You must be <a href="logout'.URL_STRING
.'">Logged Out</a> to view this page.';
101 elseif ( isset($level_restriction) && $userinfo['level'] < $level_restriction )
102 $tmp = 'You cannot view this page. This page is restricted to users level '.$level_restriction.' and above.';
105 header('HTTP/1.1 403 Forbidden');
106 echo '<div class="alert">',$tmp,'</div>';