📄 chg.asp
字号:
<%response.expires=0%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/code.asp"-->
<%
userid=Session("userid")
userlevel=Session("userlevel")
if userid="" or userlevel="" then
call msgbox("请重新登陆!",0)
end if
if not isnumeric(userid) or not isnumeric(userlevel) then
call msgbox("请重新登陆!",0)
end if
userid=CCur(userid)
userlevel=CCur(userlevel)
id=strFilter(request("id"),10)
if id="" then
call msgbox("请正确指定修改文章!",1)
end if
if not isnumeric(id) then
call msgbox("请正确指定修改文章!",1)
end if
id=CCur(id)
sql="select top 1 title,content,author,source,csize,otime,filenum,categoryid from article where id="&id
rs.open sql,conn,1,1
if not rs.eof then
title =rs(0)
content =rs(1)
author =rs(2)
source =rs(3)
csize =rs(4)
otime =rs(5)
filenum =rs(6)
categoryid =split(rs(7),".")
else
rs.close
call msgbox("该修改文章不存在!",1)
end if
rs.close
if ubound(categoryid)<2 then
call msgbox("该修改文章数据出错!\n\n请删除后重新录入!",1)
end if
Session("categoryid")=categoryid(1)
sql="select top 1 categoryname,categoryindex from category where categoryid="&categoryid(1)
rs.open sql,conn,1,1
if not rs.eof then
cname=rs(0)
cindex=split(rs(1),".")
else
rs.close
call msgbox("该分类不存在!",1)
end if
rs.close
if isarray(cindex) then
for i=0 to ubound(cindex,1)
if nindex="" then
nindex=cindex(0)
else
nindex=nindex&"."&cindex(i)
end if
sql="select top 1 categoryid,categoryname,categorypath,categorysort,categoryindex from category where categoryindex like '"&nindex&"'"
rs.open sql,conn,1,1
if not rs.eof then
if i=0 then
tophtml=tophtml&rs(1)
else
tophtml=tophtml&"<a href=""../"&rs(3)&"/default.asp?categoryid="&rs(0)&""" style=""color:FFFFFF"">"&rs(1)&"</a>"
end if
tophtml=tophtml&" <a href=""../category/class.asp?category="&cindex(0)&"&categoryindex="&rs(4)&""" style=""color:FFFFFF"">>></a> "
filepath=filepath&rs(2)&"/"
else
rs.close
call msgbox("该分类上级不存在!",1)
end if
rs.close
next
end if
Session("filenum") =""
Session("filepath") =filepath
Session("editfilenum") =filenum
Session("photodata") ="article"
Session("photoup") =0
sql="select id from articlephoto where filenum='"&Session("editfilenum")&"'"
rs.open sql,conn,1,1
if not rs.eof then
Session("photoup") =1
photodata=rs.getrows
end if
rs.close
if content><"" then
content=replace(UBBCode(content),"'","\'")
end if
Set rs=nothing
Set conn=nothing
%>
<!--#include file="../inc/head.asp"-->
<script src="../js/edit.js"></script>
<script>var datahtml='<%=content%>';</script>
<body onload="EditLoad(datahtml)"><br>
<table border="0" align="center" width="620" cellpadding="1" cellspacing="1">
<tr><td colspan="8"><font style="color:FFFFFF"><a href="../category/class.asp" style="color:FFFFFF">分类列表</a> >> <%=tophtml%>文章管理</font> <a href="../article/add.asp?categoryid=<%=Session("categoryid")%>" style="color:FFFFFF">文章添加</a></td></tr>
</table>
<table border=0 cellPadding=0 cellSpacing=0 width=620 align=center style="border:1 ridge #eaeaea;color:ffffff"><tbody>
<form method="POST" action="../article/up.asp" name="form" autocomplete="off" onsubmit="return(come());">
<tr><td width="170" rowspan="2" nowrap>
<input type=hidden name=id value="<%=id%>">
所属:<select name=categoryid><%if isarray(categoryid) then%><%for j=1 to ubound(categoryid,1)-1 step 2%><option value="<%=categoryid(j)%>"><%=categoryid(j+1)%><%next%><%end if%></select><br>
主题:<input class=text type=text name=title size="20" maxlength="100" value="<%=title%>"><br>
作者:<input class=text type=text name=author size="20" maxlength="20" onkeypress="return Text();" value="<%=author%>"><br>
来源:<input class=text type=text name=source size="4" maxlength="20" onkeypress="return Text();" value="<%=source%>"><%=SourceSelect%><br>
时间:<input class=text type=text name=otime size="20" maxlength="20" onkeypress="return Text();" value="<%=otime%>"><br>
图片:<select class=text name=upphoto onChange="inphoto(this[this.selectedIndex].value);this.selectedIndex=0"><option>选择插入图片...
<%if isarray(photodata) then
for i=0 to ubound(photodata,2)
response.write "<option value="""&photodata(0,i)&""">"&photodata(0,i)
next
Set photodata=nothing
end if%>
</select><br><br>
<input id=mW onclick=setMode(true) type=checkbox CHECKED name=bW><label for=mw>编辑状态</label><br>
<input id=mH onclick=setMode(false) type=checkbox name=bH><label for=mH>显示源代码</label><br>
<input id=mE onclick=setSave(true) type=checkbox name=bE value="1"><label for=mE>使用UBB标签保存</label><br>
<input id=mF onclick=setSave(false) type=checkbox name=bF value="1"><label for=mF>使用普通文本保存</label><br>
<div align=right><input class=button type=submit value=" 保 存 "></div><br>
<iframe name=Photo frameborder=0 src="../photo.asp" style="width:100%;height:120"></iframe>
<script src="../js/html.js"></script>
<tr><td height=300 width=450 style="border:2 double #e0e0e0;" valign=middle><iframe name=EditContent frameborder=0 style="width:450;height:330;"></iframe><textarea name=SaveContent style="border:0;width:450;height:330;overflow:auto;display:none"></textarea></td></tr>
</form>
</table>
<script>
function come(){
var content="";
if (document.all.title.value.length<2) content+="主题必须在2~50个字符内!\n"
if (document.all.bE.checked==false && document.all.bF.checked==false) content+="请选择保存方式!\n\nUBB标签 或 普通文本\n"
if (content!=""){
alert(content+'\n Copyright by 2001-2002 ZWCITY.COM');
return false;
}
}
</script>
<!--#include file="../inc/foot.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -