Small update to http headers and http-equiv headers.
[iDB.git] / inc / xhtml11.php
blob563722d5a4b504f76e96db01d62394acd397bf66
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: xhtml11.php - Last Update: 06/16/2011 SVN 675 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="xhtml11.php"||$File3Name=="/xhtml11.php") {
18 require('index.php');
19 exit(); }
20 // Check to see if we serv the file as html or xhtml
21 // if we do xhtml we also check to see if user's browser
22 // can dispay if or else fallback to html
23 if($Settings['output_type']!="xhtml") {
24 $Settings['output_type'] = "xhtml"; }
25 if($Settings['output_type']=="html") {
26 $ccstart = "//<!--"; $ccend = "//-->";
27 header("Content-Type: text/html; charset=".$Settings['charset']); }
28 if($Settings['output_type']=="xhtml") {
29 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
30 $ccstart = "//<![CDATA["; $ccend = "//]]>";
31 header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
32 xml_doc_start("1.0",$Settings['charset']); }
33 else { if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
34 $ccstart = "//<![CDATA["; $ccend = "//]]>";
35 header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
36 xml_doc_start("1.0",$Settings['charset']);
37 } else { $ccstart = "//<!--"; $ccend = "//-->";
38 header("Content-Type: text/html; charset=".$Settings['charset']); } } }
39 if($Settings['output_type']!="xhtml") {
40 if($Settings['output_type']!="html") {
41 $ccstart = "//<!--"; $ccend = "//-->";
42 header("Content-Type: text/html; charset=".$Settings['charset']); } }
43 if($checklowview===true) { $ThemeSet['CSSType'] = "lowview"; }
44 if($checklowview===true&&$_GET['act']=="lowview") {
45 $ThemeSet['CSSType'] = "lowview";
46 $ThemeSet['ThemeName'] = $OrgName." Low Theme";
47 $ThemeSet['ThemeMaker'] =$iDB_Author;
48 $ThemeSet['ThemeVersion'] = $VER1[0].".".$VER1[1].".".$VER1[2];
49 $ThemeSet['ThemeVersionType'] = $VER2[0];
50 $ThemeSet['ThemeSubVersion'] = $VER2[2]." ".$SubVerN;
51 $ThemeSet['MakerURL'] = $iDBHome."support/?act=lowview";
52 $ThemeSet['CopyRight'] = $ThemeSet['ThemeName']." was made by <a href=\"".$ThemeSet['MakerURL']."\" title=\"".$ThemeSet['ThemeMaker']."\">".$ThemeSet['ThemeMaker']."</a>";
53 $ThemeInfo['ThemeName'] = $ThemeSet['ThemeName'];
54 $ThemeInfo['ThemeMaker'] = $ThemeSet['ThemeMaker'];
55 $ThemeInfo['ThemeVersion'] = $ThemeSet['ThemeVersion'];
56 $ThemeInfo['ThemeVersionType'] = $ThemeSet['ThemeVersionType'];
57 $ThemeInfo['ThemeSubVersion'] = $ThemeSet['ThemeSubVersion'];
58 $ThemeInfo['MakerURL'] = $ThemeSet['MakerURL'];
59 $ThemeInfo['CopyRight'] = $ThemeSet['CopyRight']; }
60 if($ThemeSet['CSSType']!="import"&&
61 $ThemeSet['CSSType']!="link"&&
62 $ThemeSet['CSSType']!="lowview"&&
63 $ThemeSet['CSSType']!="xml"&&
64 $ThemeSet['CSSType']!="sql") {
65 $ThemeSet['CSSType'] = "import"; }
66 if($ThemeSet['CSSType']=="xhtml") {
67 xml_tag_make("xml-stylesheet","type=text/css&href=".$ThemeSet['CSS']); }
68 header("Content-Style-Type: text/css");
69 header("Content-Script-Type: text/javascript");
70 if($Settings['showverinfo']!="on") {
71 $iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$iDB."\" onclick=\"window.open(this.href);return false;\">"; }
72 if($Settings['showverinfo']=="on") {
73 $iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$VerInfo['iDB_Ver_Show']."\" onclick=\"window.open(this.href);return false;\">"; }
74 $GM2kURL = "<a href=\"".$iDBHome."support/category.php?act=view&amp;id=2\" title=\"".$GM2k."\" onclick=\"window.open(this.href);return false;\">".$GM2k."</a>";
75 $csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
76 $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>";
77 $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>";
78 $DualLicense = $BSDL." &amp; ".$GPL;
79 $endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1.$RName."</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$extext = null;
80 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>"; }
81 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>"; }
82 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>"; }
83 $endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1.$RName."</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$cryear." <br />\n".$ThemeSet['CopyRight']." | ".$extext;
84 header("Content-Language: en");
85 header("Vary: Accept-Encoding");
86 // Check if we are on a secure HTTP connection
87 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
88 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
89 // Get the board's url
90 if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
91 $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$basedir; }
92 if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
93 $BoardURL = $Settings['idburl'];
94 if($Settings['qstr']!="/") {
95 $AltBoardURL = $BoardURL; }
96 if($Settings['qstr']=="/") {
97 $AltBoardURL = preg_replace("/\/$/","",$BoardURL); } }
98 // HTML Document Starts, HTML meta tags and other html, head tags ?>
99 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
100 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
101 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
102 <head>
103 <meta http-equiv="Content-Language" content="en" />
104 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>" />
105 <meta http-equiv="Content-Style-Type" content="text/css" />
106 <meta http-equiv="Content-Script-Type" content="text/javascript" />
107 <meta http-equiv="Cache-Control" content="private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0" />
108 <meta http-equiv="Pragma" content="private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0" />
109 <meta http-equiv="Expires" content="<?php echo gmdate("D, d M Y H:i:s")." GMT"; ?>" />
110 <meta http-equiv="P3P" content='CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"' />
111 <meta http-equiv="P3P" name="CP" content="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT" />
112 <meta http-equiv="Expires" content="<?php echo gmdate("D, d M Y H:i:s")." GMT"; ?>" />
113 <?php
114 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
115 $_SERVER['HTTP_USER_AGENT'] = ""; }
116 if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") &&
117 !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
118 <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
119 <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
120 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
121 <?php } ?>
122 <base href="<?php echo $BoardURL; ?>" />
123 <?php if($Settings['showverinfo']=="on") { ?>
124 <meta name="Generator" content="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
125 <?php } if($Settings['showverinfo']!="on") { ?>
126 <meta name="Generator" content="<?php echo $iDB; ?>" />
127 <?php } echo "\n"; ?>
128 <meta name="Author" content="<?php echo $SettInfo['Author']; ?>" />
129 <meta name="Keywords" content="<?php echo $SettInfo['Keywords']; ?>" />
130 <meta name="Description" content="<?php echo $SettInfo['Description']; ?>" />
131 <meta name="ROBOTS" content="Index, FOLLOW" />
132 <meta name="revisit-after" content="1 days" />
133 <meta name="GOOGLEBOT" content="Index, FOLLOW" />
134 <meta name="resource-type" content="document" />
135 <meta name="distribution" content="global" />
136 <?php if($Settings['showverinfo']=="on") { ?>
137 <!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
138 <?php } if($Settings['showverinfo']!="on") { ?>
139 <!-- generator="<?php echo $iDB; ?>" -->
140 <?php } echo "\n"; ?>
142 <script type="text/javascript" src="<?php echo url_maker($exfilejs['javascript'],$Settings['js_ext'],null,$Settings['qstr'],$Settings['qsep'],$prexqstrjs['javascript'],$exqstrjs['javascript']); ?>"></script>
143 <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; ?>" />
144 <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" />
145 <?php if($Settings['showverinfo']=="on") { ?>
146 <link rel="Generator" href="<?php echo $iDBHome; ?>" title="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
147 <?php } if($Settings['showverinfo']!="on") { ?>
148 <link rel="Generator" href="<?php echo $iDBHome; ?>" title="<?php echo $iDB; ?>" />
149 <?php } echo "\n"; ?>
150 <!-- ^_^ Stephanie Braun -->
151 <?php if($ThemeSet['CSSType']=="import") { ?>
152 <style type="text/css">
153 /* Import the theme css file */
154 <?php echo "\n@import url(\"".$ThemeSet['CSS']."\");\n"; ?>
155 </style>
156 <?php } if($ThemeSet['CSSType']=="sql") { ?>
157 <style type="text/css">
158 <?php echo $ThemeSet['CSS']; ?>
159 </style>
160 <?php } if($ThemeSet['CSSType']=="link") { ?>
161 <link rel="prefetch alternate stylesheet" href="<?php echo $ThemeSet['CSS']; ?>" />
162 <link rel="stylesheet" type="text/css" href="<?php echo $ThemeSet['CSS']; ?>" />
163 <?php } if($ThemeSet['CSSType']=="lowview") { ?>
164 <style type="text/css">
165 /* (Low View / Lo-Fi ) version start */
166 body {
167 background-color: #FFFFFF;
168 color: #000000;
169 font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
170 font-size: 16px;
171 margin: 20px;
172 padding: 0px;
174 .copyright {
175 text-align: center;
176 font-family: Sans-Serif;
177 font-size: 12px;
178 line-height: 11px;
179 color: #000000;
181 .EditReply {
182 color: #000000;
183 font-size: 9px;
185 </style>
186 <?php } if($ThemeSet['FavIcon']!=null) { ?>
187 <link rel="icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
188 <link rel="shortcut icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
189 <?php } ?>
190 <!-- Renee Sabonis ^_^ -->