-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
82 lines (72 loc) · 2.13 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
if(file_exists('install') && !file_exists('install/install.lock')){
header("location:install");
exit();
}
require_once('./inc/init.php');
if($_GET['langid']){
$refer=$_SERVER['HTTP_REFERER'];
if(!empty($_GET['preview']) || !stristr($refer, $_SERVER['HTTP_HOST']) || !stristr($refer, 'admin/')){
$refer="index.php";
}
$refer=empty($refer)?"index.php":$refer;
_header_("location:{$refer}");
exit();
}
if($_GET['alangid']){
_header_("location:admin/index.php");
exit();
}
//程序实现伪静态
if($cache_settings['urlrewrite']=='1'){
$uri_=$_SERVER["REQUEST_URI"];
$uri_parm=array();
$p = '/\?(.*).html/isU';
preg_match($p, $uri_, $r);
$uri_ = $r[1];
$parms_vars = explode("-",$uri_);
switch($parms_vars[0]){
case 'articlelist':
if(!empty($parms_vars[1])){$_GET['cid']=intval($parms_vars[1]);}
if(!empty($parms_vars[2])){$_GET['page']=intval($parms_vars[2]);}
require_once('./articlelist.php');
exit();
break;
case 'view':
if(!empty($parms_vars[1])){$_GET['id']=intval($parms_vars[1]);}
if(!empty($parms_vars[2])){$_GET['page']=intval($parms_vars[2]);}
require_once('./view.php');
exit();
break;
case 'product':
if(!empty($parms_vars[1])){$_GET['id']=intval($parms_vars[1]);}
if(!empty($parms_vars[2])){$_GET['page']=intval($parms_vars[2]);}
require_once('./product.php');
exit();
break;
case 'productlist':
if(!empty($parms_vars[1])){$_GET['cid']=intval($parms_vars[1]);}
if(!empty($parms_vars[2])){$_GET['page']=intval($parms_vars[2]);}
require_once('./productlist.php');
exit();
break;
case 'msg':
if(!empty($parms_vars[1])){$_GET['cid']=intval($parms_vars[1]);}
if(!empty($parms_vars[2])){$_GET['page']=intval($parms_vars[2]);}
require_once('./msg.php');
exit();
break;
case 'contact':
require_once('./contact.php');
exit();
break;
case 'page':
if(!empty($parms_vars[1])){$_GET['cid']=intval($parms_vars[1]);}
if(!empty($parms_vars[2])){$_GET['page']=intval($parms_vars[2]);}
require_once('./page.php');
exit();
break;
}
}
require_once('./main.php');
?>