Small bug fix. :P
[iDB.git] / inc / xhtml10.php
blobce3961c207023741cddf6d9377a81b9d8b354a18
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2011 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: xhtml10.php - Last Update: 07/30/2011 SVN 729 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="xhtml10.php"||$File3Name=="/xhtml10.php") {
18 require('index.php');
19 exit(); }
20 ob_start("idb_suboutput_handler");
21 // Check to see if we serv the file as html or xhtml
22 // if we do xhtml we also check to see if user's browser
23 // can dispay if or else fallback to html
24 if($Settings['output_type']=="html") {
25 $ccstart = "//<!--"; $ccend = "//-->";
26 header("Content-Type: text/html; charset=".$Settings['charset']); }
27 if($Settings['output_type']=="xhtml") {
28 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
29 $ccstart = "//<![CDATA["; $ccend = "//]]>";
30 header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
31 xml_doc_start("1.0",$Settings['charset']); }
32 else { if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
33 $ccstart = "//<![CDATA["; $ccend = "//]]>";
34 header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
35 xml_doc_start("1.0",$Settings['charset']);
36 } else { $ccstart = "//<!--"; $ccend = "//-->";
37 header("Content-Type: text/html; charset=".$Settings['charset']); } } }
38 if($Settings['output_type']!="xhtml") {
39 if($Settings['output_type']!="html") {
40 $ccstart = "//<!--"; $ccend = "//-->";
41 header("Content-Type: text/html; charset=".$Settings['charset']); } }
42 if($checklowview===true&&$_GET['act']=="lowview") {
43 $ThemeSet['CSSType'] = "lowview";
44 $ThemeSet['ThemeName'] = $OrgName." Low Theme";
45 $ThemeSet['ThemeMaker'] =$iDB_Author;
46 $ThemeSet['ThemeVersion'] = $VER1[0].".".$VER1[1].".".$VER1[2];
47 $ThemeSet['ThemeVersionType'] = $VER2[0];
48 $ThemeSet['ThemeSubVersion'] = $VER2[2]." ".$SubVerN;
49 $ThemeSet['MakerURL'] = $iDBHome."support/?act=lowview";
50 $ThemeSet['CopyRight'] = $ThemeSet['ThemeName']." was made by <a href=\"".$ThemeSet['MakerURL']."\" title=\"".$ThemeSet['ThemeMaker']."\">".$ThemeSet['ThemeMaker']."</a>";
51 $ThemeInfo['ThemeName'] = $ThemeSet['ThemeName'];
52 $ThemeInfo['ThemeMaker'] = $ThemeSet['ThemeMaker'];
53 $ThemeInfo['ThemeVersion'] = $ThemeSet['ThemeVersion'];
54 $ThemeInfo['ThemeVersionType'] = $ThemeSet['ThemeVersionType'];
55 $ThemeInfo['ThemeSubVersion'] = $ThemeSet['ThemeSubVersion'];
56 $ThemeInfo['MakerURL'] = $ThemeSet['MakerURL'];
57 $ThemeInfo['CopyRight'] = $ThemeSet['CopyRight']; }
58 if($ThemeSet['CSSType']!="import"&&
59 $ThemeSet['CSSType']!="link"&&
60 $ThemeSet['CSSType']!="lowview"&&
61 $ThemeSet['CSSType']!="xml"&&
62 $ThemeSet['CSSType']!="sql") {
63 $ThemeSet['CSSType'] = "import"; }
64 if($ThemeSet['CSSType']=="xhtml") {
65 xml_tag_make("xml-stylesheet","type=text/css&href=".$ThemeSet['CSS']); }
66 header("Content-Style-Type: text/css");
67 header("Content-Script-Type: text/javascript");
68 if($Settings['showverinfo']!="on") {
69 $iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$iDB."\" onclick=\"window.open(this.href);return false;\">"; }
70 if($Settings['showverinfo']=="on") {
71 $iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$VerInfo['iDB_Ver_Show']."\" onclick=\"window.open(this.href);return false;\">"; }
72 $GM2kURL = "<a href=\"".$GM2kHome."\" title=\"".$GM2k."\" onclick=\"window.open(this.href);return false;\">".$GM2k."</a>";
73 $csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
74 $BSDL = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"".$RName." is dual-licensed under the Revised BSD License\">BSDL</a>";
75 $GPL = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\" title=\"".$RName." is dual-licensed under the Gnu General Public License\">GPL</a>";
76 $DualLicense = $BSDL." &amp; ".$GPL;
77 $extext = null;
78 if($checklowview!==true) { $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">Low-Version</a>"; }
79 if($checklowview===true&&$_GET['act']!="lowview") { $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=lowview",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">Low-Version</a>"; }
80 if($checklowview===true&&$_GET['act']=="lowview") { $extext = "<a href=\"".url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'])."\">High-Version</a>"; }
81 $endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1.$RName."</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$cryear." <br />\n".$ThemeSet['CopyRight']." | ".$extext;
82 header("Content-Language: en");
83 header("Vary: Accept-Encoding");
84 // Check if we are on a secure HTTP connection
85 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
86 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
87 // Get the board's url
88 if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
89 $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$basedir; }
90 if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
91 $BoardURL = $Settings['idburl'];
92 if($Settings['qstr']!="/") {
93 $AltBoardURL = $BoardURL; }
94 if($Settings['qstr']=="/") {
95 $AltBoardURL = preg_replace("/\/$/","",$BoardURL); } }
96 // Get the html level
97 if($Settings['html_level']!="Strict") {
98 if($Settings['html_level']!="Transitional") {
99 $Settings['html_level'] = "Transitional"; } }
100 // HTML Document Starts
101 if($Settings['html_level']=="Strict") { ?>
102 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
103 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
104 <?php } if($Settings['html_level']=="Transitional") { ?>
105 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
106 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
107 <?php } if($Settings['html_level']=="Frameset") { ?>
108 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
109 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
110 <?php } // HTML meta tags and other html, head tags ?>
111 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
112 <head>
113 <?php $iWrappers['HTMLSTART'] = ob_get_clean();
114 ob_start("idb_suboutput_handler"); ?>
115 <meta http-equiv="Content-Language" content="en" />
116 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>" />
117 <meta http-equiv="Content-Style-Type" content="text/css" />
118 <meta http-equiv="Content-Script-Type" content="text/javascript" />
119 <meta http-equiv="Cache-Control" content="private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0" />
120 <meta http-equiv="Pragma" content="private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0" />
121 <meta http-equiv="Expires" content="<?php echo gmdate("D, d M Y H:i:s")." GMT"; ?>" />
122 <meta http-equiv="P3P" content='CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"' />
123 <meta http-equiv="P3P" name="CP" content="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" />
124 <meta http-equiv="Expires" content="<?php echo gmdate("D, d M Y H:i:s")." GMT"; ?>" />
125 <?php
126 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
127 $_SERVER['HTTP_USER_AGENT'] = ""; }
128 if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") &&
129 !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
130 <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
131 <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
132 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
133 <?php } $iWrappers['HTTPEQUIV'] = ob_get_clean();
134 ob_start("idb_suboutput_handler"); ?>
135 <base href="<?php echo $BoardURL; ?>" />
136 <?php if($Settings['showverinfo']=="on") { ?>
137 <meta name="Generator" content="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
138 <?php } if($Settings['showverinfo']!="on") { ?>
139 <meta name="Generator" content="<?php echo $iDB; ?>" />
140 <?php } echo "\n"; ?>
141 <meta name="Author" content="<?php echo $SettInfo['Author']; ?>" />
142 <meta name="Keywords" content="<?php echo $SettInfo['Keywords']; ?>" />
143 <meta name="Description" content="<?php echo $SettInfo['Description']; ?>" />
144 <meta name="ROBOTS" content="Index, FOLLOW" />
145 <meta name="revisit-after" content="1 days" />
146 <meta name="GOOGLEBOT" content="Index, FOLLOW" />
147 <meta name="resource-type" content="document" />
148 <meta name="distribution" content="global" />
149 <?php if($Settings['showverinfo']=="on") { ?>
150 <!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
151 <?php } if($Settings['showverinfo']!="on") { ?>
152 <!-- generator="<?php echo $iDB; ?>" -->
153 <?php } echo "\n"; $iWrappers['METATAGS'] = ob_get_clean();
154 ob_start("idb_suboutput_handler"); ?>
156 <script type="text/javascript" src="<?php echo url_maker($exfilejs['javascript'],$Settings['js_ext'],null,$Settings['qstr'],$Settings['qsep'],$prexqstrjs['javascript'],$exqstrjs['javascript']); ?>"></script>
157 <?php echo "\n"; $iWrappers['JAVASCRIPT'] = ob_get_clean();
158 ob_start("idb_suboutput_handler"); ?>
159 <link rel="Start" href="<?php echo $AltBoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" title="<?php echo $Settings['board_name'].$idbpowertitle; ?>" />
160 <link rel="Copyright" href="<?php echo $AltBoardURL.url_maker($exfile['index'],$Settings['file_ext'],"act=bsd",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" title="Copyright Notice" />
161 <?php if($Settings['showverinfo']=="on") { ?>
162 <link rel="Generator" href="<?php echo $iDBHome; ?>" title="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
163 <?php } if($Settings['showverinfo']!="on") { ?>
164 <link rel="Generator" href="<?php echo $iDBHome; ?>" title="<?php echo $iDB; ?>" />
165 <!-- ^_^ Stephanie Braun -->
166 <?php } echo "\n"; $iWrappers['LINKTAGS'] = ob_get_clean();
167 ob_start("idb_suboutput_handler"); ?>
168 <?php if($ThemeSet['CSSType']=="import") { ?>
169 <style type="text/css">
170 /* Import the theme css file */
171 <?php echo "\n@import url(\"".$ThemeSet['CSS']."\");\n"; ?>
172 </style>
173 <?php } if($ThemeSet['CSSType']=="sql") { ?>
174 <style type="text/css">
175 <?php echo $ThemeSet['CSS']; ?>
176 </style>
177 <?php } if($ThemeSet['CSSType']=="link") { ?>
178 <link rel="prefetch alternate stylesheet" href="<?php echo $ThemeSet['CSS']; ?>" />
179 <link rel="stylesheet" type="text/css" href="<?php echo $ThemeSet['CSS']; ?>" />
180 <?php } if($ThemeSet['CSSType']=="lowview") { ?>
181 <style type="text/css">
182 /* (Low View / Lo-Fi ) version start */
183 body {
184 background-color: #FFFFFF;
185 color: #000000;
186 font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
187 font-size: 16px;
188 margin: 20px;
189 padding: 0px;
191 .copyright {
192 text-align: center;
193 font-family: Sans-Serif;
194 font-size: 12px;
195 line-height: 11px;
196 color: #000000;
198 .EditReply {
199 color: #000000;
200 font-size: 9px;
202 </style>
203 <?php } $iWrappers['CSSTHEME'] = ob_get_clean();
204 ob_start("idb_suboutput_handler");
205 if($ThemeSet['FavIcon']!=null) { ?>
206 <link rel="icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
207 <link rel="shortcut icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
208 <?php } ?>
209 <!-- Renee Sabonis ^_^ -->
210 <?php $iWrappers['FAVICON'] = ob_get_clean(); ?>