OSDN Git Service

Update SVN to iDB 0.1.5 SVN 1
[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-2007 Cool Dude 2k - http://intdb.sourceforge.net/
12     Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
13
14     $FileInfo: preindex.php - Last Update: 05/09/2007 SVN 1 - Author: cooldude2k $
15 */
16 $File1Name = dirname($_SERVER['SCRIPT_NAME'])."/";
17 $File2Name = $_SERVER['SCRIPT_NAME'];
18 $File3Name=str_replace($File1Name, null, $File2Name);
19 if ($File3Name=="preindex.php"||$File3Name=="/preindex.php") {
20         @header('Location: index.php');
21         exit(); }
22 require('mysql.php');
23 if($Settings['enable_rss']==true) {
24 if($_GET['feed']=="rss"||$_GET['act']=="Feed"||$_GET['feed']=="atom") {
25         require($SettDir['inc'].'rssfeed.php'); } }
26 if($Settings['output_type']=="htm") {
27         $Settings['output_type'] = "html"; }
28 if($Settings['output_type']=="xhtm") {
29         $Settings['output_type'] = "xhtml"; }
30 if($Settings['output_type']=="xml+htm") {
31         $Settings['output_type'] = "xhtml"; }
32 if($Settings['html_type']=="xhtml10") {
33 require($SettDir['inc'].'xhtml10.php'); }
34 if($Settings['html_type']=="xhtml11") {
35 if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
36 $ccstart = "//<![CDATA["; $ccend = "//]]>";
37 require($SettDir['inc'].'xhtml11.php'); } else {
38 if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) {
39         $ccstart = "//<![CDATA["; $ccend = "//]]>";
40    require($SettDir['inc'].'xhtml11.php'); } else { 
41            $ccstart = "//<!--"; $ccend = "//-->";
42            $Settings['html_type']="xhtml10";
43            $Settings['html_level']="Strict";
44            require($SettDir['inc'].'xhtml10.php'); } } }
45 if($Settings['html_type']!="xhtml10") {
46         if($Settings['html_type']!="xhtml11") {
47         $ccstart = "//<!--"; $ccend = "//-->";
48         require($SettDir['inc'].'xhtml10.php'); } }
49 ?>