AddClasstemp.php
8.59 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?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,"template");
$gid=(int)$_GET['gid'];
$gname=CheckTempGroup($gid);
$urlgname=$gname." > ";
$cid=ehtmlspecialchars($_GET['cid']);
$enews=ehtmlspecialchars($_GET['enews']);
$url=$urlgname."<a href=ListClasstemp.php?gid=$gid&classid=$cid".$ecms_hashur['ehref'].">管理封面模板</a> > 增加封面模板";
$postword='增加封面模板';
//複製
if($enews=="AddClasstemp"&&$_GET['docopy'])
{
$tempid=(int)$_GET['tempid'];
$r=$empire->fetch1("select tempid,tempname,temptext,classid from ".GetDoTemptb("enewsclasstemp",$gid)." where tempid=$tempid");
$url=$urlgname."<a href=ListClasstemp.php?gid=$gid&classid=$cid".$ecms_hashur['ehref'].">管理封面模板</a> > 複製封面模板: ".$r[tempname];
$postword='修改封面模板';
}
//修改
if($enews=="EditClasstemp")
{
$tempid=(int)$_GET['tempid'];
$r=$empire->fetch1("select tempid,tempname,temptext,classid from ".GetDoTemptb("enewsclasstemp",$gid)." where tempid=$tempid");
$url=$urlgname."<a href=ListClasstemp.php?gid=$gid&classid=$cid".$ecms_hashur['ehref'].">管理封面模板</a> > 修改封面模板: ".$r[tempname];
$postword='修改封面模板';
}
//分類
$cstr="";
$csql=$empire->query("select classid,classname from {$dbtbpre}enewsclasstempclass order by classid");
while($cr=$empire->fetch($csql))
{
$select="";
if($cr[classid]==$r[classid])
{
$select=" selected";
}
$cstr.="<option value='".$cr[classid]."'".$select.">".$cr[classname]."</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><?=$postword?></title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
<script>
function ReturnHtml(html)
{
document.form1.temptext.value=html;
}
</script>
<SCRIPT lanuage="JScript">
<!--
function tempturnit(ss)
{
if (ss.style.display=="")
ss.style.display="none";
else
ss.style.display="";
}
-->
</SCRIPT>
<script>
function ReTempBak(){
self.location.reload();
}
</script>
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td height="25">位置:<?=$url?></td>
</tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<form name="form1" method="post" action="ListClasstemp.php">
<?=$ecms_hashur['form']?>
<tr class="header">
<td height="25" colspan="2">
<?=$postword?>
<input name="enews" type="hidden" id="enews" value="<?=$enews?>"> <input name="tempid" type="hidden" id="tempid" value="<?=$tempid?>">
<input name="cid" type="hidden" id="cid" value="<?=$cid?>"> <input name="gid" type="hidden" id="gid" value="<?=$gid?>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="19%" height="25">模板名稱(*)</td>
<td width="81%" height="25"> <input name="tempname" type="text" id="tempname" value="<?=$r[tempname]?>" size="30">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">所屬分類</td>
<td height="25"><select name="classid" id="classid">
<option value="0">不隸屬於任何類別</option>
<?=$cstr?>
</select> <input type="button" name="Submit6222322" value="管理分類" onclick="window.open('ClassTempClass.php<?=$ecms_hashur['whehref']?>');"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><strong>模板內容</strong>(*)</td>
<td height="25">請將模板內容<a href="#ecms" onclick="window.clipboardData.setData('Text',document.form1.temptext.value);document.form1.temptext.select()" title="點擊複製模板內容"><strong>複製到Dreamweaver(推薦)</strong></a>或者使用<a href="#ecms" onclick="window.open('editor.php?getvar=opener.document.form1.temptext.value&returnvar=opener.document.form1.temptext.value&fun=ReturnHtml<?=$ecms_hashur['ehref']?>','edittemp','width=880,height=600,scrollbars=auto,resizable=yes');"><strong>模板在線編輯</strong></a>進行可視化編輯</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="2"><div align="center">
<textarea name="temptext" cols="90" rows="27" id="temptext" wrap="OFF" style="WIDTH: 100%"><?=ehtmlspecialchars(stripSlashes($r[temptext]))?></textarea>
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td height="25"><input type="submit" name="Submit" value="保存模板"> <input type="reset" name="Submit2" value="重置">
<?php
if($enews=='EditClasstemp')
{
?>
[<a href="#empirecms" onclick="window.open('TempBak.php?temptype=classtemp&tempid=<?=$tempid?>&gid=<?=$gid?><?=$ecms_hashur['ehref']?>','ViewTempBak','width=450,height=500,scrollbars=yes,left=300,top=150,resizable=yes');">修改記錄</a>]
<?php
}
?>
</td>
</tr>
</form>
<tr bgcolor="#FFFFFF">
<td height="25" colspan="2"> [<a href="#ecms" onclick="tempturnit(showtempvar);">顯示模板變量說明</a>]
[<a href="#ecms" onclick="window.open('EnewsBq.php<?=$ecms_hashur['whehref']?>','','width=600,height=500,scrollbars=yes,resizable=yes');">查看模板標籤語法</a>]
[<a href="#ecms" onclick="window.open('../ListClass.php<?=$ecms_hashur['whehref']?>','','width=800,height=600,scrollbars=yes,resizable=yes');">查看JS調用地址</a>]
[<a href="#ecms" onclick="window.open('ListTempvar.php<?=$ecms_hashur['whehref']?>','','width=800,height=600,scrollbars=yes,resizable=yes');">查看公共模板變量</a>]
[<a href="#ecms" onclick="window.open('ListBqtemp.php<?=$ecms_hashur['whehref']?>','','width=800,height=600,scrollbars=yes,resizable=yes');">查看標籤模板</a>]
</td>
</tr>
<tr bgcolor="#FFFFFF" id="showtempvar" style="display:none">
<td height="25" colspan="2"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DBEAF5">
<tr bgcolor="#FFFFFF">
<td width="33%" height="25"> <input name="textfield7" type="text" value="[!--pagetitle--]">
:頁面標題</td>
<td width="34%"><input name="textfield72" type="text" value="[!--pagekey--]">
:頁面關鍵字</td>
<td width="33%"><input name="textfield73" type="text" value="[!--pagedes--]">
:頁面描述</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><input name="textfield8" type="text" value="[!--news.url--]">
:網站地址</td>
<td><input name="textfield9" type="text" value="[!--newsnav--]">
:所在位置導航條</td>
<td><input name="textfield92" type="text" value="[!--class.menu--]">
:一級欄目導航</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><input name="textfield10" type="text" value="[!--self.classid--]">
:本欄目/專題ID</td>
<td><input name="textfield11" type="text" value="[!--class.keywords--]">
:欄目/專題關鍵字</td>
<td><input name="textfield12" type="text" value="[!--class.classimg--]">
:欄目/專題縮略圖</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><input name="textfield132" type="text" value="[!--class.name--]">
:欄目名</td>
<td><input name="textfield13" type="text" value="[!--class.intro--]">
:欄目/專題簡介</td>
<td><input name="textfield14" type="text" value="[!--bclass.id--]">
: 父欄目ID</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"><input name="textfield15" type="text" value="[!--bclass.name--]">
:父欄目名稱</td>
<td><strong>支持公共模板變量</strong></td>
<td><strong>支持所有模板標籤</strong></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>