OSDN Git Service

aeee8491d401e12ba0e234ff9b47e108fec815fc
[idb/iDB-Extras.git.git] / NeoSrc / image.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-2008 Cool Dude 2k - http://idb.berlios.de/
12     Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
13
14     $FileInfo: image.php - Last Update: 12/15/2011 RC 5 Ver. 3.0.0 - Author: cooldude2k $
15 */
16 //@ob_clean();
17 @ob_start();
18 $urltype = 1;
19 $url = "http://hostname.domain/url/to/path/";
20 $urlfname = "index.php";
21 $appname = "Neo Source Viewer";
22 $appver = array(3,0,0,"RC 3");
23 function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
24         $return_var = $proname." ".$reltype." ".$subver.".".$ver.".".$supver;
25         if($showsvn==false) { $showsvn = null; }
26         if($showsvn==true) { $return_var .= " SVN ".$svnver; }
27         if($showsvn!=true&&$showsvn!=null) { $return_var .= " ".$showsvn." ".$svnver; }
28         return $return_var; }
29 $appversion = version_info($appname,$appver[0],$appver[1],$appver[2],$appver[3]." Ver.",null,false);
30 function redirect($type,$file,$time=0,$url=null,$dbsr=true) {
31 if($type!="location"&&$type!="refresh") { $type=="location"; }
32 if($url!=null) { $file = $url.$file; }
33 if($dbsr==true) { $file = str_replace("//", "/", $file); }
34 if($type=="refresh") { header("Refresh: ".$time."; URL=".$file); }
35 if($type=="location") { @session_write_close(); 
36 header("Location: ".$file); } return true; }
37 if(dirname($_SERVER['SCRIPT_NAME'])!=".") {
38 $basedir = dirname($_SERVER['SCRIPT_NAME'])."/"; }
39 if(dirname($_SERVER['SCRIPT_NAME'])==".") {
40 $basedir = dirname($_SERVER['PHP_SELF'])."/"; }
41 if($basedir=="\/") { $basedir="/"; }
42 if($_SERVER['PATH_INFO']==null) {
43         if(@getenv('PATH_INFO')!=null&&@getenv('PATH_INFO')!="1") {
44 $_SERVER['PATH_INFO'] = @getenv('PATH_INFO'); } }
45 if($_SERVER['PATH_INFO']!=null) {
46 $_GET['dir'] = $_SERVER['PATH_INFO']; }
47 if($_GET['dir']=="1") { $_GET['dir']="/"; }
48 if(!isset($_GET['dir'])) { 
49         $_GET['dir'] = "/"; }
50 $_GET['dir']=preg_replace("/(.*?)\.\/(.*?)/", "iDB", $_GET['dir']);
51 if($urltype==1) {
52 redirect("location",$urlfname."?dir=".$_GET['dir']."&act=lowview",0,$url,false); }
53 if($urltype==2) {
54 redirect("location",$urlfname.$_GET['dir']."?act=lowview",0,$url,false); }
55 ?>