Update killglobals.php
[iDB.git] / inc / html5.php
blob541af33a163c76e908e88341ece9ca8734f1ec09
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-2023 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2023 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
14 $FileInfo: html5.php - Last Update: 6/22/2023 SVN 984 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="html5.php"||$File3Name=="/html5.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> &#169; ".$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($Settings['enable_https']=="on") {
98 header("Strict-Transport-Security \"max-age=16070400\""); }
99 ob_start("idb_suboutput_handler");
100 if($XHTML5===false) { ?>
101 <!DOCTYPE html>
102 <?php // HTML meta tags and other html, head tags ?>
103 <html lang="en">
104 <?php } if($XHTML5===true) { ?>
105 <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
106 <?php } ?>
107 <head>
108 <?php $iWrappers['HTMLSTART'] = ob_get_clean();
109 ob_start("idb_suboutput_handler");
110 if($XHTML5===false) { ?>
111 <meta charset="<?php echo $Settings['charset']; ?>">
112 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>">
113 <meta name="language" content="english">
114 <meta name="viewport" content="width=device-width initial-scale=1.0">
115 <?php
116 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
117 $_SERVER['HTTP_USER_AGENT'] = ""; }
118 if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") &&
119 !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
120 <meta http-equiv="X-UA-Compatible" content="IE=Edge">
121 <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
122 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
123 <?php } } if($XHTML5===true) { ?>
124 <meta charset="<?php echo $Settings['charset']; ?>" />
125 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Settings['charset']; ?>" />
126 <meta name="language" content="english" />
127 <?php
128 if(!isset($_SERVER['HTTP_USER_AGENT'])) {
129 $_SERVER['HTTP_USER_AGENT'] = ""; }
130 if(strpos($_SERVER['HTTP_USER_AGENT'], "msie") &&
131 !strpos($_SERVER['HTTP_USER_AGENT'], "opera")){ ?>
132 <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
133 <?php } if(strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) { ?>
134 <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
135 <?php } } $iWrappers['HTTPEQUIV'] = ob_get_clean();
136 ob_start("idb_suboutput_handler"); ?>
137 <meta itemprop="url" property="og:url" content="<?php echo $BoardURL; ?>" />
138 <base href="<?php echo $BoardURL; ?>" />
139 <?php if($Settings['showverinfo']=="on") { ?>
140 <meta name="Generator" content="<?php echo $VerInfo['iDB_Ver_Show']; ?>" />
141 <?php } if($Settings['showverinfo']!="on") { ?>
142 <meta name="Generator" content="<?php echo $iDB; ?>" />
143 <?php } ?>
144 <meta name="Author" content="<?php echo $SettInfo['Author']; ?>" />
145 <meta name="web_author" content="<?php echo $SettInfo['Author']; ?>" />
146 <meta name="rating" content="general" />
147 <meta name="Designer" content="<?php echo $ThemeSet['ThemeMaker']; ?>" />
148 <meta name="Publisher" content="<?php echo $GM2k; ?>" />
149 <meta name="Keywords" content="<?php echo $SettInfo['Keywords']; ?>" />
150 <meta name="Description" content="<?php echo $SettInfo['Description']; ?>" />
151 <meta itemprop="description" property="og:description" content="<?php echo $SettInfo['Description']; ?>" />
152 <meta itemprop="description" property="twitter:description" content="<?php echo $SettInfo['Description']; ?>" />
153 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
154 <meta name="HandheldFriendly" content="true" />
155 <meta name="ROBOTS" content="Index, FOLLOW" />
156 <meta name="GOOGLEBOT" content="Index, FOLLOW" />
157 <meta name="revisit-after" content="7 days" />
158 <meta name="distribution" content="web" />
159 <meta itemprop="type" property="og:type" content="forum" />
160 <meta itemprop="card" property="twitter:card" content="summary_large_image" />
161 <?php if($Settings['showverinfo']=="on") { ?>
162 <!-- generator="<?php echo $VerInfo['iDB_Ver_Show']; ?>" -->
163 <?php } if($Settings['showverinfo']!="on") { ?>
164 <!-- generator="<?php echo $iDB; ?>" -->
165 <?php } $iWrappers['METATAGS'] = ob_get_clean();
166 ob_start("idb_suboutput_handler"); ?>
167 <link rel="preload" as="script" href="<?php echo url_maker($exfilejs['javascript'],$Settings['js_ext'],null,$Settings['qstr'],$Settings['qsep'],$prexqstrjs['javascript'],$exqstrjs['javascript']); ?>" />
168 <script type="text/javascript" src="<?php echo url_maker($exfilejs['javascript'],$Settings['js_ext'],null,$Settings['qstr'],$Settings['qsep'],$prexqstrjs['javascript'],$exqstrjs['javascript']); ?>"></script>
169 <script type="text/javascript">
170 var tzname=Intl.DateTimeFormat().resolvedOptions().timeZone;
171 document.cookie = "getusertz="+tzname;
172 </script>
173 <?php echo "\n"; $iWrappers['JAVASCRIPT'] = ob_get_clean();
174 ob_start("idb_suboutput_handler"); ?>
175 <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; ?>" />
176 <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" />
177 <?php echo "\n"; $iWrappers['LINKTAGS'] = ob_get_clean();
178 ob_start("idb_suboutput_handler");
179 if($ThemeSet['CSSType']=="import") { ?>
180 <style type="text/css">
181 /* Import the theme css file */
182 <?php echo "\n@import url(\"".$ThemeSet['CSS']."\");\n"; ?>
183 </style>
184 <?php } if($ThemeSet['CSSType']=="sql") { ?>
185 <style type="text/css">
186 <?php echo $ThemeSet['CSS']; ?>
187 </style>
188 <?php } if($ThemeSet['CSSType']=="link") { ?>
189 <link rel="preload" as="style" href="<?php echo $ThemeSet['CSS']; ?>" />
190 <link rel="prefetch alternate stylesheet" href="<?php echo $ThemeSet['CSS']; ?>" />
191 <link rel="stylesheet" type="text/css" href="<?php echo $ThemeSet['CSS']; ?>" />
192 <?php } if($ThemeSet['CSSType']=="lowview") { ?>
193 <style type="text/css">
194 /* (Low View / Lo-Fi ) version start */
195 body {
196 background-color: #FFFFFF;
197 color: #000000;
198 font-family: Verdana, Tahoma, Arial, Trebuchet MS, Sans-Serif, Georgia, Courier, Times New Roman, Serif;
199 font-size: 16px;
200 margin: 20px;
201 padding: 0px;
203 .copyright {
204 text-align: center;
205 font-family: Sans-Serif;
206 font-size: 12px;
207 line-height: 11px;
208 color: #000000;
210 .EditReply {
211 color: #000000;
212 font-size: 9px;
214 </style>
215 <?php } $iWrappers['CSSTHEME'] = ob_get_clean();
216 ob_start("idb_suboutput_handler");
217 if($ThemeSet['FavIcon']!=null) { ?>
218 <link rel="preload" as="image" href="<?php echo $ThemeSet['FavIcon']; ?>" />
219 <link rel="icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
220 <link rel="shortcut icon" href="<?php echo $ThemeSet['FavIcon']; ?>" />
221 <!--<link rel="preload" as="image" href="<?php echo $BoardURL.$ThemeSet['OpenGraph']; ?>" />
222 <link rel="preload" as="image" href="<?php echo $BoardURL.$ThemeSet['OpenGraph']; ?>" />-->
223 <meta itemprop="image" property="og:image" content="<?php echo $BoardURL.$ThemeSet['OpenGraph']; ?>" />
224 <meta itemprop="image" property="twitter:image" content="<?php echo $BoardURL.$ThemeSet['OpenGraph']; ?>" />
225 <?php } $iWrappers['FAVICON'] = ob_get_clean(); ?>