EditInfoSimple.php
11.4 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<?php
define('EmpireCMSAdmin','1');
require("../../class/connect.php");
require("../../class/db_sql.php");
require("../../class/functions.php");
require("../../data/dbcache/class.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();
//審核
$ecmscheck=(int)$_GET['ecmscheck'];
$addecmscheck='';
$indexchecked=1;
if($ecmscheck)
{
$addecmscheck='&ecmscheck='.$ecmscheck;
$indexchecked=0;
}
//是否關閉
$isclose=(int)$_GET['isclose'];
if($isclose)
{
$reload=(int)$_GET['reload'];
$reloadjs='';
if($reload)
{
$reloadjs='opener.parent.main.location.reload();';
}
echo"<script>".$reloadjs."window.close();</script>";
exit();
}
$classid=(int)$_GET['classid'];
if(empty($class_r[$classid][classid]))
{
printerror("ErrorUrl","history.go(-1)");
}
//驗證權限
$doselfinfo=CheckLevel($logininid,$loginin,$classid,"news");
if(!$class_r[$classid][tbname]||!$class_r[$classid][classid])
{
printerror("ErrorUrl","history.go(-1)");
}
//非終極欄目
if(!$class_r[$classid]['islast'])
{
printerror("AddInfoErrorClassid","history.go(-1)");
}
$bclassid=$class_r[$classid][bclassid];
$id=(int)$_GET['id'];
//附件驗證碼
if(!$doselfinfo['doeditinfo'])//編輯權限
{
printerror("NotEditInfoLevel","EditInfoSimple.php?isclose=1".$ecms_hashur['ehref']);
}
$filepass=$id;
$ecmsfirstpost=0;
//模型
$modid=$class_r[$classid][modid];
$enter=$emod_r[$modid]['enter'];
//會員組
$sql1=$empire->query("select groupid,groupname from {$dbtbpre}enewsmembergroup order by level");
while($l_r=$empire->fetch($sql1))
{
$ygroup.="<option value=".$l_r[groupid].">".$l_r[groupname]."</option>";
}
//初始化數據
$r=array();
$todaytime=date("Y-m-d H:i:s");
//-----------------------------------------修改信息
//索引表
$index_r=$empire->fetch1("select classid,id,checked from {$dbtbpre}ecms_".$class_r[$classid][tbname]."_index where id='$id' limit 1");
if(!$index_r['id']||$index_r['classid']!=$classid)
{
printerror("ErrorUrl","history.go(-1)");
}
//返回表
$infotb=ReturnInfoMainTbname($class_r[$classid][tbname],$index_r['checked']);
//主表
$r=$empire->fetch1("select * from ".$infotb." where id='$id' limit 1");
//返回表信息
$infodatatb=ReturnInfoDataTbname($class_r[$classid][tbname],$index_r['checked'],$r['stb']);
//副表
$finfor=$empire->fetch1("select closepl from ".$infodatatb." where id='$id'");
$r=array_merge($r,$finfor);
//簽發表
if($r[isqf])
{
$wfinfor=$empire->fetch1("select tstatus,checktno from {$dbtbpre}enewswfinfo where id='$id' and classid='$classid' limit 1");
}
//只能編輯自己的信息
if($doselfinfo['doselfinfo']&&($r[userid]<>$logininid||$r[ismember]))
{
printerror("NotDoSelfinfo","EditInfoSimple.php?isclose=1".$ecms_hashur['ehref']);
}
//已審核信息不可修改
if($doselfinfo['docheckedit']&&$index_r['checked'])
{
printerror("NotEditCheckInfoLevel","EditInfoSimple.php?isclose=1".$ecms_hashur['ehref']);
}
//時間
$newstime=$r['newstime'];
$r['newstime']=date("Y-m-d H:i:s",$r['newstime']);
//鏈接地址
$titleurl=$r['titleurl'];
if(!$r['isurl'])
{
$r['titleurl']='';
}
//會員組
$group=str_replace(" value=".$r[groupid].">"," value=".$r[groupid]." selected>",$ygroup);
//標題屬性
if(strstr($r[titlefont],','))
{
$tfontr=explode(',',$r[titlefont]);
$r[titlecolor]=$tfontr[0];
$r[titlefont]=$tfontr[1];
}
if(strstr($r[titlefont],"b|"))
{
$titlefontb=" checked";
}
if(strstr($r[titlefont],"i|"))
{
$titlefonti=" checked";
}
if(strstr($r[titlefont],"s|"))
{
$titlefonts=" checked";
}
//標題分類
$cttidswhere='';
$tts='';
$caddr=$empire->fetch1("select ttids from {$dbtbpre}enewsclassadd where classid='$classid'");
if($caddr['ttids']!='-')
{
if($caddr['ttids']&&$caddr['ttids']!=',')
{
$cttidswhere=' and typeid in ('.substr($caddr['ttids'],1,-1).')';
}
$ttsql=$empire->query("select typeid,tname from {$dbtbpre}enewsinfotype where mid='$modid'".$cttidswhere." order by myorder");
while($ttr=$empire->fetch($ttsql))
{
$select='';
if($ttr[typeid]==$r[ttid])
{
$select=' selected';
}
$tts.="<option value='$ttr[typeid]'".$select.">$ttr[tname]</option>";
}
}
//欄目鏈接
$getcurlr['classid']=$classid;
$classurl=sys_ReturnBqClassname($getcurlr,9);
//當前使用的模板組
$thegid=GetDoTempGid();
$phpmyself=urlencode(eReturnSelfPage(1));
//返回頭條和推薦級別名稱
$ftnr=ReturnFirsttitleNameList($r['firsttitle'],$r['isgood']);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?=stripSlashes($r[title])?></title>
<link rel="stylesheet" href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" type="text/css">
<script>
function foreColor(){
if(!Error()) return;
var arr = showModalDialog("../../data/html/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
if (arr != null) document.add.titlecolor.value=arr;
else document.add.titlecolor.focus();
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<form name="add" method="post" action="../ecmsinfo.php">
<?=$ecms_hashur['form']?>
<tr class="header">
<td height="25" colspan="2"> 快速修改信息基本屬性
<input type=hidden value=EditInfoSimple name=enews> <input type=hidden value=<?=$classid?> name=classid>
<input type=hidden value=<?=$bclassid?> name=bclassid> <input name=id type=hidden value=<?=$id?>>
<input type=hidden value="<?=$r[newspath]?>" name=newspath> <input type=hidden value="<?=$r[ztid]?>" name=oldztid>
<input type=hidden value="<?=$filepass?>" name=filepass> <input type=hidden value="<?=$r[username]?>" name=username>
<input name="oldfilename" type="hidden" value="<?=$r[filename]?>"> <input name="oldgroupid" type="hidden" value="<?=$r[groupid]?>">
<input name="oldchecked" type="hidden" value="<?=$index_r[checked]?>">
<input name="ecmsfrom" type="hidden" value="<?=RepPostStrUrl($_SERVER['HTTP_REFERER'])?>">
<input name="ecmsnfrom" type="hidden" value="<?=RepPostStrUrl($_GET['ecmsnfrom'])?>">
<input name="ecmscheck" type="hidden" id="ecmscheck" value="<?=$ecmscheck?>">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" height="25">標題</td>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEAF5">
<tr>
<td height="25" bgcolor="#FFFFFF">
<?=$tts?"<select name='ttid'><option value='0'>標題分類</option>$tts</select>":""?>
<input type=text name=title value="<?=ehtmlspecialchars(stripSlashes($r[title]))?>" size="60">
</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">屬性:
<input name="titlefont[b]" type="checkbox" value="b"<?=$titlefontb?>>
粗體
<input name="titlefont[i]" type="checkbox" value="i"<?=$titlefonti?>>
斜體
<input name="titlefont[s]" type="checkbox" value="s"<?=$titlefonts?>>
刪除線 顏色:
<input name="titlecolor" type="text" value="<?=stripSlashes($r[titlecolor])?>" size="10">
<a onclick="foreColor();"><img src="../../data/images/color.gif" width="21" height="21" align="absbottom"></a>
</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">特殊屬性</td>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEAF5">
<tr>
<td height="25" bgcolor="#FFFFFF">信息屬性:
<input name="checked" type="checkbox" value="1"<?=$index_r[checked]?' checked':''?>>
審核 推薦
<select name="isgood" id="isgood">
<option value="0"<?=$r[isgood]==0?' selected':''?>>不推薦</option>
<?=$ftnr['igname']?>
</select>
頭條
<select name="firsttitle" id="firsttitle">
<option value="0"<?=$r[firsttitle]==0?' selected':''?>>非頭條</option>
<?=$ftnr['ftname']?>
</select> </td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF">外部鏈接:
<input name="titleurl" type="text" value="<?=stripSlashes($r[titleurl])?>" size="49">
</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">發佈時間</td>
<td><input name="newstime" type="text" value="<?=$r[newstime]?>"> <input type=button name=button2 value="設為當前時間" onclick="document.add.newstime.value='<?=$todaytime?>'"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">標題圖片</td>
<td><input name="titlepic" type="text" id="titlepic" value="<?=$ecmsfirstpost==1?"":ehtmlspecialchars(stripSlashes($r[titlepic]))?>" size="45">
<a onclick="window.open('../ecmseditor/FileMain.php?type=1&classid=<?=$classid?>&infoid=<?=$id?>&filepass=<?=$filepass?>&doing=1&field=titlepic&sinfo=1<?=$ecms_hashur['ehref']?>','','width=700,height=550,scrollbars=yes');" title="選擇已上傳的圖片"><img src="../../data/images/changeimg.gif" border="0" align="absbottom"></a>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td rowspan="2">其它選項</td>
<td height="25">置頂級別:
<select name="istop">
<option value="0"<?=$r[istop]==0?' selected':''?>>不置頂</option>
<option value="1"<?=$r[istop]==1?' selected':''?>>一級置頂</option>
<option value="2"<?=$r[istop]==2?' selected':''?>>二級置頂</option>
<option value="3"<?=$r[istop]==3?' selected':''?>>三級置頂</option>
<option value="4"<?=$r[istop]==4?' selected':''?>>四級置頂</option>
<option value="5"<?=$r[istop]==5?' selected':''?>>五級置頂</option>
<option value="6"<?=$r[istop]==6?' selected':''?>>六級置頂</option>
<option value="7"<?=$r[istop]==7?' selected':''?>>七級置頂</option>
<option value="8"<?=$r[istop]==8?' selected':''?>>八級置頂</option>
<option value="9"<?=$r[istop]==9?' selected':''?>>九級置頂</option>
</select>
,
<input type=checkbox name=closepl value=1<?=$r[closepl]==1?" checked":""?>>
關閉評論</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">點擊數 :
<input name="onclick" type="text" id="onclick2" value="<?=$r[onclick]?>" size="8">
下載數 :
<input name="totaldown" type="text" id="totaldown2" value="<?=$r[totaldown]?>" size="8"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25"> </td>
<td><input type="submit" name="addnews" value=" 提 交 ">
<input type="reset" name="Submit2" value="重置">
<input type="button" name="Submit22" value="取消" onclick="window.close();"></td>
</tr>
</form>
</table>
</body>
</html>
<?php
db_close();
$empire=null;
?>