SetRewrite.php
5.67 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
define('EmpireCMSAdmin','1');
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
//驗證用戶
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
//ehash
$ecms_hashur=hReturnEcmsHashStrAll();
//驗證權限
CheckLevel($logininid,$loginin,$classid,"public");
//設置偽靜態參數
function SetRewrite($add,$userid,$username){
global $empire,$dbtbpre;
CheckLevel($userid,$username,$classid,"public");//驗證權限
$sql=$empire->query("update {$dbtbpre}enewspublic set rewriteinfo='".eaddslashes($add[rewriteinfo])."',rewriteclass='".eaddslashes($add[rewriteclass])."',rewriteinfotype='".eaddslashes($add[rewriteinfotype])."',rewritetags='".eaddslashes($add[rewritetags])."',rewritepl='".eaddslashes($add[rewritepl])."' limit 1");
if($sql)
{
GetConfig();
//操作日誌
insert_dolog("");
printerror("SetRewriteSuccess","SetRewrite.php".hReturnEcmsHashStrHref2(1));
}
else
{printerror("DbError","history.go(-1)");}
}
$enews=$_POST['enews'];
if(empty($enews))
{$enews=$_GET['enews'];}
if($enews)
{
hCheckEcmsRHash();
}
if($enews=="SetRewrite")//設置偽靜態參數
{
SetRewrite($_POST,$logininid,$loginin);
}
$r=$empire->fetch1("select rewriteinfo,rewriteclass,rewriteinfotype,rewritetags,rewritepl from {$dbtbpre}enewspublic limit 1");
db_close();
$empire=null;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>設置偽靜態</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td><p>位置:<a href="SetRewrite.php<?=$ecms_hashur['whehref']?>">偽靜態設置</a></p>
</td>
</tr>
</table>
<form name="setpublic" method="post" action="SetRewrite.php">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<?=$ecms_hashur['form']?>
<tr class="header">
<td height="25" colspan="4">偽靜態參數設置
<input name="enews" type="hidden" value="SetRewrite"></td>
</tr>
<tr>
<td width="135" height="25">頁面</td>
<td width="302" height="25">標記</td>
<td width="554">格式</td>
<td width="323">對應頁面</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">信息內容頁</td>
<td height="25">[!--classid--],[!--id--],[!--page--]</td>
<td>/
<input name="rewriteinfo" type="text" id="rewriteinfo" value="<?=$r[rewriteinfo]?>" size="55">
[<a href="#empirecms" onclick="document.setpublic.rewriteinfo.value='showinfo-[!--classid--]-[!--id--]-[!--page--].html';">默認</a>]</td>
<td>/e/action/ShowInfo.php?classid=欄目ID&id=信息ID&page=分頁號</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">信息列表頁</td>
<td height="25">[!--classid--],[!--page--]</td>
<td>/
<input name="rewriteclass" type="text" id="rewriteclass" value="<?=$r[rewriteclass]?>" size="55">
[<a href="#empirecms" onclick="document.setpublic.rewriteclass.value='listinfo-[!--classid--]-[!--page--].html';">默認</a>]</td>
<td>/e/action/ListInfo/index.php?classid=欄目ID&page=分頁號</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">標題分類列表頁</td>
<td height="25">[!--ttid--],[!--page--]</td>
<td>/
<input name="rewriteinfotype" type="text" id="rewriteinfotype" value="<?=$r[rewriteinfotype]?>" size="55">
[<a href="#empirecms" onclick="document.setpublic.rewriteinfotype.value='infotype-[!--ttid--]-[!--page--].html';">默認</a>]</td>
<td>/e/action/InfoType/index.php?ttid=標題分類ID&page=分頁號</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">TAGS信息列表頁</td>
<td height="25">[!--tagname--],[!--page--]</td>
<td>/
<input name="rewritetags" type="text" id="rewritetags" value="<?=$r[rewritetags]?>" size="55">
[<a href="#empirecms" onclick="document.setpublic.rewritetags.value='tags-[!--tagname--]-[!--page--].html';">默認</a>]</td>
<td>/e/tags/index.php?tagname=TAGS名稱&page=分頁號</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">評論列表頁</td>
<td height="25">[!--doaction--],[!--classid--],[!--id--],<br>
[!--page--],[!--myorder--],[!--tempid--]</td>
<td>/
<input name="rewritepl" type="text" id="rewritepl" value="<?=$r[rewritepl]?>" size="55">
[<a href="#empirecms" onclick="document.setpublic.rewritepl.value='comment-[!--doaction--]-[!--classid--]-[!--id--]-[!--page--]-[!--myorder--]-[!--tempid--].html';">默認</a>]</td>
<td>/e/pl/index.php?doaction=事件&classid=欄目ID&id=信息ID&page=分頁號&myorder=排序&tempid=評論模板ID</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td height="25" colspan="3"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="4">說明:採用靜態頁面時不需要設置,只有當採用動態頁面時可通過設置偽靜態來提高SEO優化,如果不啟用請留空。注意:偽靜態會增加服務器負擔,修改偽靜態格式後你需要修改服務器的 Rewrite 規則設置。</td>
</tr>
</table>
</form>
</body>
</html>