SetWap.php
5.18 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
133
134
135
136
137
<?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,"wap");
//設置
function SetWap($add,$userid,$username){
global $empire,$dbtbpre;
$wapopen=(int)$add['wapopen'];
$wapdefstyle=(int)$add['wapdefstyle'];
$wapshowmid=RepPostVar($add['wapshowmid']);
$waplistnum=(int)$add['waplistnum'];
$wapsubtitle=(int)$add['wapsubtitle'];
$wapchar=(int)$add['wapchar'];
$sql=$empire->query("update {$dbtbpre}enewspublic set wapopen=$wapopen,wapdefstyle=$wapdefstyle,wapshowmid='$wapshowmid',waplistnum=$waplistnum,wapsubtitle=$wapsubtitle,wapshowdate='$add[wapshowdate]',wapchar=$wapchar limit 1");
//操作日誌
insert_dolog("");
printerror("SetWapSuccess","SetWap.php".hReturnEcmsHashStrHref2(1));
}
$enews=$_POST['enews'];
if($enews)
{
hCheckEcmsRHash();
}
if($enews=='SetWap')
{
SetWap($_POST,$logininid,$loginin);
}
$r=$empire->fetch1("select wapopen,wapdefstyle,wapshowmid,waplistnum,wapsubtitle,wapshowdate,wapchar from {$dbtbpre}enewspublic limit 1");
//wap模板
$wapdefstyles='';
$stylesql=$empire->query("select styleid,stylename from {$dbtbpre}enewswapstyle order by styleid");
while($styler=$empire->fetch($stylesql))
{
$select='';
if($styler['styleid']==$r['wapdefstyle'])
{
$select=' selected';
}
$wapdefstyles.="<option value='".$styler[styleid]."'".$select.">".$styler[stylename]."</option>";
}
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>WAP設置</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 width="50%">位置:<a href="SetWap.php<?=$ecms_hashur['whehref']?>">WAP設置</a></td>
<td><div align="right" class="emenubutton">
<input type="button" name="Submit522" value="管理WAP模板" onclick="self.location.href='WapStyle.php<?=$ecms_hashur['whehref']?>';">
</div></td>
</tr>
</table>
<form name="setwapform" method="post" action="SetWap.php">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<?=$ecms_hashur['form']?>
<tr class="header">
<td height="25" colspan="2">WAP設置
<input name=enews type=hidden value=SetWap></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">開啟WAP</td>
<td height="25"><input type="radio" name="wapopen" value="1"<?=$r[wapopen]==1?' checked':''?>>
是
<input type="radio" name="wapopen" value="0"<?=$r[wapopen]==0?' checked':''?>>
否 </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">WAP字符集</td>
<td height="25"><input type="radio" name="wapchar" value="1"<?=$r[wapchar]==1?' checked':''?>>
UTF-8
<input type="radio" name="wapchar" value="0"<?=$r[wapchar]==0?' checked':''?>>
UNICODE <font color="#666666">(默認為 UNICODE 編碼)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">只顯示系統模型列表</td>
<td height="25"><input name="wapshowmid" type="text" id="wapshowmid" value="<?=$r[wapshowmid]?>">
<font color="#666666">(多個模型ID用","隔開,空為顯示所有)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%" height="25">默認使用WAP模板</td>
<td width="80%" height="25"><select name="wapdefstyle" id="wapdefstyle">
<?=$wapdefstyles?>
</select> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">列表每頁顯示</td>
<td height="25"> <input name="waplistnum" type="text" id="waplistnum" value="<?=$r[waplistnum]?>">
條信息</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">標題截取</td>
<td height="25"> <input name="wapsubtitle" type="text" id="wapsubtitle" value="<?=$r[wapsubtitle]?>">
個字節 <font color="#666666">(0為不截取)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">時間顯示格式</td>
<td height="25"><input name="wapshowdate" type="text" id="wapshowdate" value="<?=$r[wapshowdate]?>">
<font color="#666666">(格式:Y表示年,m表示月,d表示天)</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td height="25">WAP地址:<a href="<?=$public_r[newsurl]?>e/wap/" target="_blank"><?=$public_r[newsurl]?>e/wap/</a></td>
</tr>
</table>
</form>
</body>
</html>