Initial commit.
[atbbs.git] / includes / template.php
blob4f7ed87e9b6cebed819d43e2817fc5952d23cf15
1 <!DOCTYPE html
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <head>
7 <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
8 <title><?php echo strip_tags($page_title) . ' — ' . SITE_TITLE ?></title>
9 <script type="text/javascript" src="/javascript/main.js"></script>
10 <link rel="stylesheet" type="text/css" media="screen" href="/style/global.css" />
11 <link rel="icon" type="image/png" href="/favicon.png" />
12 <?php echo $additional_head ?>
14 </head>
15 <?php
16 echo '<body';
17 if( ! empty($onload_javascript))
19 echo ' onload="' . $onload_javascript . '"';
21 echo '>';
23 if( ! empty($_SESSION['notice']))
25 echo '<div id="notice" onclick="this.parentNode.removeChild(this);"><strong>Notice</strong>: ' . $_SESSION['notice'] . '</div>';
26 unset($_SESSION['notice']);
31 <h1 id="logo">
32 <a rel="index" href="/"><?php echo SITE_TITLE ?></a>
33 </h1>
35 <ul id="main_menu" class="menu"><?php
36 $main_menu = array
38 'Topics' => '/',
39 'Bumps' => '/bumps',
40 'Replies' => '/replies',
41 'New topic' => '/new_topic',
42 'History' => '/history',
43 'Watchlist' => '/watchlist',
44 'Search' => '/search',
45 'FAQ' => '/FAQ',
46 'Stuff' => '/stuff'
49 // Items in last_action_check need to be checked for updates.
50 $last_action_check = array();
51 if($_COOKIE['topics_mode'] == 1)
53 $last_action_check['Topics'] = 'last_topic';
54 $last_action_check['Bumps'] = 'last_bump';
56 else
58 $last_action_check['Topics'] = 'last_bump';
60 // Remove the "Bumps" link if bumps mode is default.
61 array_splice($main_menu, 1, 1);
64 foreach($main_menu as $linked_text => $path)
66 // Output the link if we're not already on that page.
67 if($path != $_SERVER['REQUEST_URI'])
69 echo indent() . '<li><a href="' . $path . '">' . $linked_text;
71 // If we need to check for new stuff...
72 if( isset($last_action_check[ $linked_text ]) )
74 $last_action_name = $last_action_check[ $linked_text ];
75 //If there's new stuff, print an exclamation mark.
76 if(isset($_COOKIE[$last_action_name]) && $_COOKIE[ $last_action_name ] < $last_actions[ $last_action_name ])
78 echo '!';
82 echo '</a></li>';
87 </ul>
89 <h2><?php echo $page_title ?></h2>
91 <?php
92 echo $buffered_content;
93 ?>
95 </body>
96 </html>