* added debug protocol flag
[citadel.git] / ctdlphp / ctdlheader.php
1 <?PHP
2
3 // $Id$
4 //
5 // Header and footer code to be included on every page.  Not only does it
6 // contain some common markup, but it also calls some code glue that holds
7 // the session together.
8 //
9 // Copyright (c) 2003 by Art Cancro <ajc@uncensored.citadel.org>
10 // This program is released under the terms of the GNU General Public License.
11
12
13 // All of the back-end magic gets included from here.  The rest of the
14 // pages in the system then only have to include ctdlheader.php (since it
15 // is required) and they get the others automatically.
16 //
17 include "config.php";
18 include "ctdlsession.php";
19 include "ctdlprotocol.php";
20 include "ctdlelements.php";
21
22 function bbs_page_header() {
23
24         // Make sure we're connected to Citadel.  Do not remove this!!
25         establish_citadel_session();
26
27         echo <<<LITERAL
28 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
29 <html>
30 <head>
31         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
32         <link rel="stylesheet" href="sitestyle.css" type="text/css" />
33         <meta name="Description" content="Citadel BBS">
34         <meta name="Keywords" content="citadel,bbs">
35         <meta name="MSSmartTagsPreventParsing" content="TRUE">
36         <title>
37 LITERAL;
38
39         if ($_SESSION["serv_humannode"]) {
40                 echo $_SESSION["serv_humannode"] ;
41         }
42         else {
43                 echo "BBS powered by Citadel" ;
44         }
45
46         echo <<<LITERAL
47 </title>
48 </head>
49
50 <body
51         text="#000000"
52         bgcolor="#FFFFFF"
53         link="#0000FF"
54         vlink="#990066"
55         alink="#DD0000"
56 >
57
58
59 LITERAL;
60
61         echo '<div id="Header">';
62         echo '<TABLE BORDER=0 WIDTH=100%>';
63         echo '<TR>';
64         echo '<TD>' . $_SESSION["serv_humannode"] . '</TD>' ;
65         echo '<TD>' . (isset($_SESSION["username"]))?'':$_SESSION["username"] . '</TD>' ;
66         echo '<TD>' . (isset($_SESSION["room"]))?'':$_SESSION["room"] . '</TD>' ;
67         echo '<TD ALIGN=RIGHT><A HREF="logout.php">Log out</A></TD>' ;
68         echo '</TR></TABLE>';
69         echo '</div>';
70
71         // Temporary menu
72         if (isset($_SESSION["logged_in"])) {
73                 echo    '<div id="Menu">' .
74                         '<a href="listrooms.php">' .
75                         'room list</A><BR>' .
76                         '<a href="readmsgs.php?mode=all&count=0">' .
77                         'Read all</a><BR>' .
78                         '<a href="readmsgs.php?mode=new&count=0">' .
79                         'Read new</a><BR>' .
80                         '<a href="display_enter.php">' .
81                         'Enter msg</a><BR>' .
82                         '<a href="who.php">' .
83                         'Who is online?</a><BR>' .
84                         '<A HREF="logout.php">' .
85                         'Log out</A>' .
86                         '</div>' ;
87         }
88
89         echo '<div id="Content">' ;
90
91 }
92
93
94 function bbs_page_footer() {
95         //echo "<HR>";
96         //echo "Powered by Citadel.  And a few cups of coffee.<BR>\n";
97
98         echo '</div>' ;
99         echo '</BODY></HTML>';
100 }
101
102
103 ?>