OSDN Git Service

658cce9102e1854995b47ac6d26865f9c010b5e4
[idb/iDB.git.git] / preindex.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-2009 Cool Dude 2k - http://idb.berlios.de/
12     Copyright 2004-2009 Game Maker 2k - http://intdb.sourceforge.net/
13
14     $FileInfo: preindex.php - Last Update: 5/01/2009 SVN 247 - Author: cooldude2k $
15 */
16 $pretime = explode(" ", microtime());
17 $utime = $pretime[0];
18 $time = $pretime[1];
19 $starttime = $utime + $time;
20 $File3Name = basename($_SERVER['SCRIPT_NAME']);
21 if ($File3Name=="preindex.php"||$File3Name=="/preindex.php") {
22         @header('Location: index.php');
23         exit(); }
24 require('mysql.php');
25 if(!isset($checklowview)) {
26         $checklowview = false; }
27 if($checklowview!==false&&$checklowview!==true) {
28         $checklowview = false; }
29 if($_GET['act']!="lowview") { 
30         $checklowview = false; }
31 if($Settings['enable_rss']=="on") {
32 if(!isset($_GET['feed'])) { $_GET['feed'] = null; }
33 if($_GET['feed']=="rss"||$_GET['act']=="Feed"||$_GET['feed']=="atom") {
34         require($SettDir['inc'].'rssfeed.php'); } }
35 if($Settings['output_type']=="htm") {
36         $Settings['output_type'] = "html"; }
37 if($Settings['output_type']=="xhtm") {
38         $Settings['output_type'] = "xhtml"; }
39 if($Settings['output_type']=="xml+htm") {
40         $Settings['output_type'] = "xhtml"; }
41 if($Settings['html_type']=="xhtml10") {
42 require($SettDir['inc'].'xhtml10.php'); }
43 if($Settings['html_type']=="xhtml11") {
44 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
45 $ccstart = "//<![CDATA["; $ccend = "//]]>";
46 require($SettDir['inc'].'xhtml11.php'); } else {
47 if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
48         $ccstart = "//<![CDATA["; $ccend = "//]]>";
49    require($SettDir['inc'].'xhtml11.php'); } else { 
50            $ccstart = "//<!--"; $ccend = "//-->";
51            $Settings['html_type']="xhtml10";
52            $Settings['html_level']="Strict";
53            require($SettDir['inc'].'xhtml10.php'); } } }
54 if($Settings['html_type']!="xhtml10") {
55         if($Settings['html_type']!="xhtml11") {
56         $ccstart = "//<!--"; $ccend = "//-->";
57         require($SettDir['inc'].'xhtml10.php'); } }
58 ?>