OSDN Git Service

680dcc5e1a3655e3149ea534312ad209b7565329
[idb/iDB.git.git] / setup / html5.php
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.
5
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.
10
11     Copyright 2004-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12     Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13
14     $FileInfo: html5.php - Last Update: 11/27/2020 SVN 927 - Author: cooldude2k $
15 */
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="xhtml10.php"||$File3Name=="/xhtml10.php") {
18         require('index.php');
19         exit(); }
20 $XHTML5 = false;
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 = "//-->"; $XHTML5 = false;
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 = "//]]>"; $XHTML5 = true;
30         header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']); }
31 else { if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
32         $ccstart = "//<![CDATA["; $ccend = "//]]>"; $XHTML5 = true;
33    header("Content-Type: application/xhtml+xml; charset=".$Settings['charset']);
34 } else { $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
35         header("Content-Type: text/html; charset=".$Settings['charset']); } } }
36 if($Settings['output_type']!="xhtml") {
37         if($Settings['output_type']!="html") {
38                 $ccstart = "//<!--"; $ccend = "//-->"; $XHTML5 = false;
39 header("Content-Type: text/html; charset=".$Settings['charset']); } }
40 if($checklowview===true&&$_GET['act']=="lowview") { 
41    $ThemeSet['CSSType'] = "lowview"; 
42    $ThemeSet['ThemeName'] = $OrgName." Low Theme";
43    $ThemeSet['ThemeMaker'] =$iDB_Author;
44    $ThemeSet['ThemeVersion'] = $VER1[0].".".$VER1[1].".".$VER1[2];
45    $ThemeSet['ThemeVersionType'] = $VER2[0];
46    $ThemeSet['ThemeSubVersion'] = $VER2[2]." ".$SubVerN;
47    $ThemeSet['MakerURL'] = $iDBHome."support/?act=lowview";
48    $ThemeSet['CopyRight'] = $ThemeSet['ThemeName']." was made by <a href=\"".$ThemeSet['MakerURL']."\" title=\"".$ThemeSet['ThemeMaker']."\">".$ThemeSet['ThemeMaker']."</a>";
49    $ThemeInfo['ThemeName'] = $ThemeSet['ThemeName'];
50    $ThemeInfo['ThemeMaker'] = $ThemeSet['ThemeMaker'];
51    $ThemeInfo['ThemeVersion'] = $ThemeSet['ThemeVersion'];
52    $ThemeInfo['ThemeVersionType'] = $ThemeSet['ThemeVersionType'];
53    $ThemeInfo['ThemeSubVersion'] = $ThemeSet['ThemeSubVersion'];
54    $ThemeInfo['MakerURL'] = $ThemeSet['MakerURL'];
55    $ThemeInfo['CopyRight'] = $ThemeSet['CopyRight']; }
56 if($ThemeSet['CSSType']!="import"&&
57    $ThemeSet['CSSType']!="link"&&
58    $ThemeSet['CSSType']!="lowview"&&
59    $ThemeSet['CSSType']!="xml"&&
60    $ThemeSet['CSSType']!="sql") { 
61    $ThemeSet['CSSType'] = "import"; }
62 header("Content-Style-Type: text/css");
63 header("Content-Script-Type: text/javascript");
64 if($Settings['showverinfo']!="on") {
65 $iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$iDB."\" onclick=\"window.open(this.href);return false;\">"; }
66 if($Settings['showverinfo']=="on") {
67 $iDBURL1 = "<a href=\"".$iDBHome."\" title=\"".$VerInfo['iDB_Ver_Show']."\" onclick=\"window.open(this.href);return false;\">"; }
68 $GM2kURL = "<a href=\"".$GM2kHome."\" title=\"".$GM2k."\" onclick=\"window.open(this.href);return false;\">".$GM2k."</a>";
69 $csryear = "2004"; $cryear = date("Y"); if($cryear<=2004) { $cryear = "2005"; }
70 $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>";
71 $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>";
72 $DualLicense = $BSDL." &amp; ".$GPL;
73 $extext = null;
74 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>"; }
75 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>"; }
76 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>"; }
77 $endpagevar = "<div class=\"copyright\">Powered by ".$iDBURL1.$RName."</a> &copy; ".$GM2kURL." @ ".$csryear." - ".$cryear." <br />\n".$ThemeSet['CopyRight']." | ".$extext; 
78 header("Content-Language: en");
79 header("Vary: Accept-Encoding");
80 // Check if we are on a secure HTTP connection
81 if($_SERVER['HTTPS']=="on") { $prehost = "https://"; }
82 if($_SERVER['HTTPS']!="on") { $prehost = "http://"; }
83 // Get the board's url
84 if($Settings['idburl']=="localhost"||$Settings['idburl']==null) {
85         $BoardURL = $prehost.$_SERVER["HTTP_HOST"].$basedir; }
86 if($Settings['idburl']!="localhost"&&$Settings['idburl']!=null) {
87         $BoardURL = $Settings['idburl']; 
88         if($Settings['qstr']!="/") {
89         $AltBoardURL = $BoardURL; } 
90         if($Settings['qstr']=="/") { 
91         $AltBoardURL = preg_replace("/\/$/","",$BoardURL); } }
92 // Get the html level
93 if($Settings['html_level']!="Strict") {
94         if($Settings['html_level']!="Transitional") {
95                 $Settings['html_level'] = "Transitional"; } }
96 // HTML Document Starts
97 if($XHTML5===false) {
98 ?>
99 <!DOCTYPE html>
100 <?php // HTML meta tags and other html, head tags ?>
101 <html lang="en">
102 <?php } if($XHTML5===true) { ?>
103 <!DOCTYPE html [
104 <!ENTITY nbsp "&#160;">
105 <!ENTITY copy "&#169;">
106 <!ENTITY reg "&#174;">
107 <!ENTITY Aacute "&#193;">
108 <!ENTITY aacute "&#225;">
109 <!ENTITY Agrave "&#224;">
110 <!ENTITY agrave "&#192;">
111 <!ENTITY Acirc "&#194;">
112 <!ENTITY acirc "&#226;">
113 <!ENTITY Auml "&#196;">
114 <!ENTITY auml "&#228;">
115 <!ENTITY Atilde "&#195;">
116 <!ENTITY atilde "&#227;">
117 <!ENTITY Aring "&#197;">
118 <!ENTITY aring "&#229;">
119 <!ENTITY Aelig "&#198;">
120 <!ENTITY aelig "&#230;">
121 <!ENTITY Ccedil "&#199;">
122 <!ENTITY ccedil "&#231;">
123 <!ENTITY Eth "&#208;">
124 <!ENTITY eth "&#240;">
125 <!ENTITY Eacute "&#201;">
126 <!ENTITY eacute "&#233;">
127 <!ENTITY Egrave "&#200;">
128 <!ENTITY egrave "&#232;">
129 <!ENTITY Ecirc "&#202;">
130 <!ENTITY ecirc "&#234;">
131 <!ENTITY Euml "&#203;">
132 <!ENTITY euml "&#235;">
133 <!ENTITY Iacute "&#205;">
134 <!ENTITY iacute "&#237;">
135 <!ENTITY Igrave "&#204;">
136 <!ENTITY igrave "&#236;">
137 <!ENTITY Icirc "&#206;">
138 <!ENTITY icirc "&#238;">
139 <!ENTITY Iuml "&#207;">
140 <!ENTITY iuml "&#239;">
141 <!ENTITY Ntilde "&#209;">
142 <!ENTITY ntilde "&#241;">
143 <!ENTITY Oacute "&#211;">
144 <!ENTITY oacute "&#243;">
145 <!ENTITY Ograve "&#210;">
146 <!ENTITY ograve "&#242;">
147 <!ENTITY Ocirc "&#212;">
148 <!ENTITY ocirc "&#244;">
149 <!ENTITY Ouml "&#214;">
150 <!ENTITY ouml "&#246;">
151 <!ENTITY Otilde "&#213;">
152 <!ENTITY otilde "&#245;">
153 <!ENTITY Oslash "&#216;">
154 <!ENTITY oslash "&#248;">
155 <!ENTITY szlig "&#223;">
156 <!ENTITY Thorn "&#222;">
157 <!ENTITY thorn "&#254;">
158 <!ENTITY Uacute "&#218;">
159 <!ENTITY uacute "&#250;">
160 <!ENTITY Ugrave "&#217;">
161 <!ENTITY ugrave "&#249;">
162 <!ENTITY Ucirc "&#219;">
163 <!ENTITY ucirc "&#251;">
164 <!ENTITY Uuml "&#220;">
165 <!ENTITY uuml "&#252;">
166 <!ENTITY Yacute "&#221;">
167 <!ENTITY yacute "&#253;">
168 <!ENTITY yuml "&#255;">
169 ]>
170 <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
171 <?php } ?>
172 <head>
173 <?php if($XHTML5===false) { ?>
174 <meta charset="<?php echo $Settings['charset']; ?>">
175 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>">
176 <meta name="language" content="english">
177 <?php 
178 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
179         $_SERVER['HTTP_USER_AGENT'] = ""; }
180 if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") && 
181         !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
182 <meta http-equiv="X-UA-Compatible" content="IE=Edge">
183 <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
184 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
185 <?php } } if($XHTML5===true) { ?>
186 <meta charset="<?php echo $Settings['charset']; ?>" />
187 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>" />
188 <meta name="language" content="english">
189 <?php 
190 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
191         $_SERVER['HTTP_USER_AGENT'] = ""; }
192 if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") && 
193         !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
194 <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
195 <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
196 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
197 <?php } } ?>
198 <meta itemprop="url" property="og:url" content="<?php echo $BoardURL; ?>" />
199 <base href="<?php echo $BoardURL; ?>" />
200 <?php if($Settings['showverinfo']=="on") { ?>
201 <meta name="Generator" content="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
202 <?php } if($Settings['showverinfo']!="on") { ?>
203 <meta name="Generator" content="<?php echo $iDB; ?>" />
204 <?php } echo "\n"; ?>
205 <meta name="Author" content="<?php echo $SettInfo['Author']; ?>" />
206 <meta name="web_author" content="<?php echo $SettInfo['Author']; ?>" />
207 <meta name="rating" content="general" />
208 <meta name="Designer" content="<?php echo $ThemeSet['ThemeMaker']; ?>" />
209 <meta name="Publisher" content="<?php echo $GM2k; ?>" />
210 <meta name="Keywords" content="<?php echo $SettInfo['Keywords']; ?>" />
211 <meta name="Description" content="<?php echo $SettInfo['Description']; ?>" />
212 <meta itemprop="description" property="og:description" content="<?php echo $SettInfo['Description']; ?>" />
213 <meta itemprop="description" property="twitter:description" content="<?php echo $SettInfo['Description']; ?>" />
214 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
215 <meta name="HandheldFriendly" content="true" />
216 <meta name="ROBOTS" content="Index, FOLLOW" />
217 <meta name="GOOGLEBOT" content="Index, FOLLOW" />
218 <meta name="revisit-after" content="7 days" />
219 <meta name="distribution" content="web" />
220 <meta itemprop="type" property="og:type" content="forum" />
221 <meta itemprop="card" property="twitter:card" content="summary_large_image" />
222 <?php if($Settings['showverinfo']=="on") { ?>
223 <!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
224 <?php } if($Settings['showverinfo']!="on") { ?>
225 <!-- generator="<?php echo $iDB; ?>" -->
226 <?php } echo "\n"; ?>
227
228 <script type="text/javascript" src="<?php echo url_maker($exfilejs['javascript'],$Settings['js_ext'],null,$Settings['qstr'],$Settings['qsep'],$prexqstrjs['javascript'],$exqstrjs['javascript']); ?>"></script>
229 <script type="text/javascript">
230  var tzname=Intl.DateTimeFormat().resolvedOptions().timeZone;
231  document.cookie = "getusertz="+tzname;
232 </script>
233 <?php echo "\n";
234 if($ThemeSet['CSSType']=="import") { ?>
235 <style type="text/css">
236 /* Import the theme css file */
237 <?php echo "\n@import url(\"".$ThemeSet['CSS']."\");\n"; ?>
238 </style>
239 <?php } if($ThemeSet['CSSType']=="sql") { ?>
240 <style type="text/css">
241 <?php echo $ThemeSet['CSS']; ?>
242 </style>
243 <?php } if($ThemeSet['CSSType']=="link") { ?>
244 <link rel="prefetch alternate stylesheet" href="<?php echo $ThemeSet['CSS']; ?>" />
245 <link rel="stylesheet" type="text/css" href="<?php echo $ThemeSet['CSS']; ?>" />
246 <?php } if($ThemeSet['CSSType']=="lowview") { ?>
247 <style type="text/css">
248 /* (Low View / Lo-Fi ) version start */
249 body {
250 background-color: #FFFFFF;
251 color: #000000;
252 font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
253 font-size: 16px;
254 margin: 20px;
255 padding: 0px;
256 }
257 .copyright {
258 text-align: center;
259 font-family: Sans-Serif;
260 font-size: 12px;
261 line-height: 11px;
262 color: #000000;
263 }
264 .EditReply {
265 color: #000000;
266 font-size: 9px;
267 }
268 </style>
269 <?php }
270 if($ThemeSet['FavIcon']!=null) { ?>
271 <link rel="icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
272 <link rel="shortcut icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
273 <meta itemprop="image" property="og:image" content="<?php echo $BoardURL.$ThemeSet['OpenGraph']; ?>" />
274 <meta itemprop="image" property="twitter:image" content="<?php echo $BoardURL.$ThemeSet['OpenGraph']; ?>" />
275 <?php } ?>