📄 add.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("请重新登陆!",3)
end if
if not isnumeric(userid) or not isnumeric(userlevel) then
call msgbox("请重新登陆!",3)
end if
userid=CCur(userid)
userlevel=CCur(userlevel)
categoryid=strFilter(request("categoryid"),10)
if categoryid="" then
call msgbox("请正确指定分类!",1)
end if
if not isnumeric(categoryid) then
call msgbox("请正确指定分类!",1)
end if
categoryid=CCur(categoryid)
Session("categoryid")=categoryid
sql="select top 1 categoryname,categoryindex from category where categoryid="&categoryid
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
sql="select categoryid,categoryname from category where categoryindex like '"&cindex(0)&"%' order by categoryid ASC"
rs.open sql,conn,1,1
if not rs.eof then
category=rs.getrows
end if
rs.close
if isarray(category) then
for i=0 to ubound(category,2)
if category(0,i)><categoryid then
categoryselect=categoryselect&"<option value="""&category(0,i)&""">"&category(1,i)
end if
next
end if
end if
if Session("filenum") ="" then
Session("filenum") =DateDiff("s","2001-1-1 00:00:00",now())
end if
Session("filepath") =filepath
Session("editfilenum") =""
Session("photodata") ="article"
Session("photoup") =0
sql="select id from articlephoto where filenum='"&Session("filenum")&"'"
rs.open sql,conn,1,1
if not rs.eof then
photodata=rs.getrows
end if
rs.close
if Session("content")><"" then
content=replace(replace(UBBCode(Session("content")),"'","\'"),"""","\'")
end if
Set rs=nothing
Set conn=nothing
%>
<!--#include file="../inc/head.asp"-->
<script src="../js/edit.js"></script>
<body onload="EditLoad('<%=content%>')"><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=<%=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/save.asp" name="form" autocomplete="off" onsubmit="return(come());">
<tr><td width="170" rowspan="2" nowrap>
分类:<select name=categoryid><option value="<%=categoryid%>"><%=cname&categoryselect%></select><br>
主题:<input class=text type=text name=title size="20" maxlength="100" value="<%=Session("title")%>"><br>
作者:<input class=text type=text name=author size="20" maxlength="20" onkeypress="return Text();" value="<%=Session("auther")%>"><br>
来源:<input class=text type=text name=source size="4" maxlength="20" onkeypress="return Text();" value="<%=Session("source")%>"><%=SourceSelect%><br>
时间:<input class=text type=text name=otime size="20" maxlength="20" onkeypress="return Text();" value="<%=now()%>"><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
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 + -