📄 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,skey,author,source,csize,otime,path,filenum,categoryid from news where id="&id
rs.open sql,conn,1,1
if not rs.eof then
title =rs(0)
content =rs(1)
skey =rs(2)
author =rs(3)
source =rs(4)
csize =rs(5)
otime =rs(6)
filepath =rs(7)
filenum =rs(8)
categoryid =split(rs(9),".")
else
rs.close
call msgbox("该修改新闻不存在!",1)
end if
rs.close
Session("photoup")=0
if isarray(categoryid) then
if ubound(categoryid)>3 then
subjectid=categoryid(3)
sql="select top 1 categoryname from category where categoryid="&subjectid
rs.open sql,conn,1,1
if not rs.eof then
subjectname=rs(0)
end if
rs.close
end if
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> "
else
rs.close
call msgbox("该分类上级不存在!",1)
end if
rs.close
next
end if
Session("filenum") =""
Session("filepath") =filepath
Session("editfilenum") =filenum
Session("photodata") ="news"
sql="select id from "&Session("photodata")&"photo 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="../news/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="../news/up.asp" name="form" autocomplete="off" onsubmit="return(come());">
<tr><td width="170" rowspan="2" nowrap>
<input type=hidden name=id value="<%=id%>">
主题:<input class=text type=text name=title size="20" maxlength="100" value="<%=title%>"><br>
关键:<input class=text type=text name=skey size="20" maxlength="20" onkeypress="return Text();" value="<%=skey%>"><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>
<%if isarray(cindex) then
if ubound(cindex)<2 then%>所属栏目:<%else%>所属专题:<%end if
end if%><a href="../news/default.asp?categoryid=<%=categoryid(1)%>" style="color:orange"><%=cname%></a><br>
<a href="../news_html.asp?id=<%=id%>" target=_blank style="color:orange">HTML预览</a> <a href="../news_id.asp?id=<%=id%>" target=_blank style="color:orange">ID预览</a> <a href="javascript:openwin('../news/mov.asp?id=<%=id%>','move',400,150);" style="color:orange">移除</a><br>
文件路径:<br>
<%=filepath%><br>
文件名:<%=Session("editfilenum")%>.htm<br>
<input type=checkbox name=good<%if good=true then%> checked<%end if%>>特别报道<br><br>
<input id=mW onclick=setMode(true) type=checkbox CHECKED name=bW><label for=mw>编辑状态</label>
<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:50"></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 + -