OSDN Git Service

Yet another small update.
[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-2011 iDB Support - http://idb.berlios.de/
12     Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
13
14     $FileInfo: preindex.php - Last Update: 07/09/2011 SVN 702 - 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('sql.php');
25 if($_GET['act']=="sqldumper"&&$Settings['sqltype']=="cubrid") { $_GET['act'] = "view"; }
26 if($_GET['act']=="sqldumper"&&$_SESSION['UserGroup']!=$Settings['GuestGroup']&&
27         $GroupInfo['HasAdminCP']=="yes") { 
28         if($Settings['sqltype']=="mysql"||$Settings['sqltype']=="mysqli") {
29         require($SettDir['sqldumper'].'mysql.php'); }
30         if($Settings['sqltype']=="pgsql") {
31         require($SettDir['sqldumper'].'pgsql.php'); } 
32         if($Settings['sqltype']=="sqlite") {
33         require($SettDir['sqldumper'].'sqlite.php'); } 
34         if($Settings['sqltype']=="cubrid") {
35         require($SettDir['sqldumper'].'cubrid.php'); } 
36         session_write_close(); die(); }
37 if(!isset($checklowview)) {
38         $checklowview = false; }
39 if($checklowview!==false&&$checklowview!==true) {
40         $checklowview = false; }
41 if($_GET['act']=="lofi"||$_GET['act']=="lo-fi"||
42         $_GET['act']=="LoFi"||$_GET['act']=="Lo-Fi"||
43         $_GET['act']=="lores"||$_GET['act']=="lo-res"||
44         $_GET['act']=="LoRes"||$_GET['act']=="Lo-Res"||
45         $_GET['act']=="LowView"||$_GET['act']=="low-view"||
46         $_GET['act']=="Low-View") { $_GET['act'] = "lowview"; }
47 if($_GET['act']!="lowview") { 
48         $checklowview = false; }
49 if($Settings['enable_rss']=="on") {
50 if(!isset($_GET['feed'])) { $_GET['feed'] = null; }
51 if($_GET['feed']=="rss"||$_GET['act']=="feed"||
52         $_GET['feed']=="oldrss"||$_GET['feed']=="atom"||
53         $_GET['feed']=="opml"||$_GET['feed']=="opensearch") {
54         $_GET['feedtype'] = $_GET['feed']; }
55 if($_GET['feed']=="rss"||$_GET['act']=="Feed"||
56         $_GET['feed']=="oldrss"||$_GET['feed']=="atom"||
57         $_GET['feed']=="opml"||$_GET['feed']=="opensearch"||
58         $_GET['act']=="feed") {
59         require($SettDir['inc'].'rssfeed.php'); } }
60 if($Settings['output_type']=="htm") {
61         $Settings['output_type'] = "html"; }
62 if($Settings['output_type']=="xhtm") {
63         $Settings['output_type'] = "xhtml"; }
64 if($Settings['output_type']=="xml+htm") {
65         $Settings['output_type'] = "xhtml"; }
66 if($Settings['html_type']=="html5"||
67         $Settings['html_type']=="xhtml5") {
68 require($SettDir['inc'].'html5.php'); }
69 if($Settings['html_type']=="xhtml10") {
70 require($SettDir['inc'].'xhtml10.php'); }
71 if($Settings['html_type']=="xhtml11") {
72 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
73 $ccstart = "//<![CDATA["; $ccend = "//]]>";
74 require($SettDir['inc'].'xhtml11.php'); } else {
75 if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")||
76         stristr($_SERVER["HTTP_USER_AGENT"],"WDG_Validator")||
77         stristr($_SERVER["HTTP_USER_AGENT"],"WDG_SiteValidator")) {
78         $ccstart = "//<![CDATA["; $ccend = "//]]>";
79    require($SettDir['inc'].'xhtml11.php'); } else { 
80            $ccstart = "//<!--"; $ccend = "//-->";
81            $Settings['html_type']="xhtml10";
82            $Settings['html_level']="Strict";
83            require($SettDir['inc'].'xhtml10.php'); } } }
84 if($Settings['html_type']!="xhtml10"&&
85         $Settings['html_type']!="xhtml11"&&
86         $Settings['html_type']!="html5"&&
87         $Settings['html_type']!="xhtml5") {
88         $ccstart = "//<!--"; $ccend = "//-->";
89         require($SettDir['inc'].'xhtml10.php'); }
90 ?>