📄 admin_art.asp
字号:
Response.Write("<script language=javascript>alert('非法的id参数');history.back(1);</script>")
response.end
end if
end if
sql="select * from a_cat where cat_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<form name="form1" method="post" action="admin_art.asp">
<tr>
<td class=lanyuss>删除文章分类</font></td>
</tr>
<tr>
<td class=lanyuds>分类名称- <%=rs("cat_name")%>
</td>
</tr>
<tr>
<td class=lanyuqs align="center" height="30"> <input name="Submit" type="submit" class="button" id="Submit" value="确定删除">
[<a href="admin_article.asp">返回</a>] </td>
</tr>
<input type="hidden" name="id" value="<%=rs("cat_id")%>">
<input type="hidden" name="action" value="delartcat">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
end if
if request.form("operation")="DEL" then
num=request.form("art_id").Count
for i=1 to num
conn.execute("delete from art where art_id="&request.form("art_id")(i))
next
end if%>
<%if request.QueryString("action")="cat" then
dim totalart,Currentpage,totalpages,i,colname
sql="select * from art order by istop desc,art_id DESC"
if request.querystring("cat_id")<>"" then
sql="select * from art where cat_id="&cint(request.querystring("cat_id"))&" order by art_id desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<tr><form name="form3" method="post" action="">
<td colspan="7" class=lanyuss>文章管理</td>
<td align="right" style="padding-top:2px;">
<select style="margin:-3px" name="go" onChange='window.location=form.go.options[form.go.selectedIndex].value'>
<option value="">选择显示方式</option>
<option value="admin_art.asp?action=cat">显示所有文章</option>
<%sql="select * from a_cat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
response.write "<optgroup label='"&rs1("cat_name")&"'>"
sql="select * from a_cat where sid="&rs1("cat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
<option value="admin_art.asp?action=cat&cat_id=<%=rs2("cat_id")%>">├ <%=rs2("cat_name")%></option>
<%
rs2.movenext
loop
rs1.movenext
loop
rs1.close
set rs1=nothing%>
</select></td>
</tr></form>
<form name=form method=post action="admin_art.asp?action=cat">
<script language="javascript">
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}
</script>
<tr align="center">
<td class=lanyuqs width="5%">选中</td>
<td class=lanyuqs width="5%">审核</td>
<td class=lanyuqs width="35%">文章标题</td>
<td class=lanyuqs width="10%">分类</td>
<td class=lanyuqs width="10%">提交人</td>
<td class=lanyuqs width="10%">发表时间</td>
<td class=lanyuqs width="10%">评论</td>
<td class=lanyuqs width="15%">操作</td>
</tr>
<%if not rs.eof then
rs.movefirst
rs.pagesize=articleperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totalart=rs.recordcount
if currentpage<>1 then
if(currentpage-1)*articleperpage<totalart then
rs.move(currentpage-1)*articleperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totalart mod articleperpage)=0 then
totalpages=totalart\articleperpage
else
totalpages=totalart\articleperpage+1
end if
i=0
do while not rs.eof and i<articleperpage%>
<%
sql="select cat_id,cat_name from a_cat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
if rs("istop")="1" then
folder="「置顶」"
else
folder=""
end if
if rs("istop")="0" then
if rs("isbest")=1 then
folder="「推荐」"
else
folder=""
end if
end if
%>
<tr class=lanyuds>
<td align="center"><input type=checkbox Name=art_id Value=<%=rs("art_id")%>></td>
<td align="center"><%If Rs("passed")=1 Then%><a href="checktj.asp?id=<%=rs("art_id")%>&action=pass&hx66=checkart"><font color=red>pass</font></a><%else%>√<%End If%> </td>
<td><a href="showart.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>" target="_blank"><%=rs("art_title")%></a> <font color="red"><%=folder%></font> <%if rs("isimg")=1 then
Response.Write "<img src='img/img.gif' alt='图片文章'>" & vbCrLf
end if%></td>
<td><%=rscat("cat_name")%></td>
<td><%=rs("tjuser")%></td>
<td><%=rs("art_date")%></td>
<td align="center"><font color=red><%=rs("reviewcount")%></font></td>
<td align="center"> <a href="admin_view.asp?action=art&art_id=<%=rs("art_id")%>">评论</a> <a href="admin_art.asp?art_id=<%=rs("art_id")%>&cat_id=<%=rs("cat_id")%>&action=editart">编辑</a> <a href="checktj.asp?id=<%=rs("art_id")%>&action=del&hx66=checkart">删除</a>
</td>
</tr>
<%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
<tr align="center">
<td class=lanyuds colspan="8">当前没有文章!</td>
</tr>
<%
end if
end if%>
<tr> <td class=lanyuqs colspan="8"><table width="100%" align="center">
<td align="seft">
<input type=hidden value=DEL name=operation>
<input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="ON">选中本页所有 <input type=submit value=批量删除 onclick="return Del()"> </td>
<td align="right"><%=currentpage%> /<%=totalpages%>页,<%=totalart%>条记录/<%=articleperpage%>篇每页.
<%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="admin_art.asp?page=<%=i%>&action=cat"><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="admin_art.asp?page=<%=page%>&action=cat" title="下一页">>></a>
<%end if%>
<input type="text" name="page" class="textarea" size="4">
<input type="submit" name="Submit" value="Go" class="button">
</table></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<%
end if
if request.Form("action")="newart" then
openarticle
sql="select * from art"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim poster,artfrom,title,keyword,content,catid,artisbest,artistop,uGrade,newpic,isimg,points,tjuser
catid=cint(request.form("cat_id"))
title=trim(replace(request.form("art_title"),"'",""))
keyword=trim(replace(request.form("art_keyword"),"'",""))
content=rtrim(replace(request.form("art_content"),"",""))
content=trim(replace(request.form("art_content"),"∈",""))
artisbest=request.form("isbest")
artistop=request.form("istop")
uGrade=request.form("Grade")
newpic=request.form("images")
isimg=request.form("hx66")
points=request.form("points")
tjuser=request.form("tjuser")
if catid<1 then
founderr=true
Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
else
rs("cat_id")=catid
end if
if title="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
else
rs("art_title")=title
end if
if keyword="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的关键字!');history.back(1);</script>")
else
rs("art_keyword")=keyword
end if
if content="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
else
rs("art_content")=content
end if
if cint(artisbest)=1 then
rs("isbest")=cint(artisbest)
end if
if cint(artistop)=1 then
rs("istop")=cint(artistop)
end if
if cint(isimg)=1 then
rs("isimg")=cint(isimg)
end if
if cint(points)<>"" then
rs("points")=cint(points)
end if
rs("Grade")=cint(uGrade)
rs("images")=newpic
rs("tjuser")=tjuser
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
sql="update allcount set articlecount = articlecount + 1"
conn.execute(sql)
response.redirect "admin_art.asp?action=cat"
end if
end if
if request.Form("action")="editart" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from art where art_id="&cint(request.Form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
catid=cint(request.form("cat_id"))
title=trim(replace(request.form("art_title"),"'",""))
keyword=trim(replace(request.form("art_keyword"),"'",""))
content=rtrim(replace(request.form("art_content"),"",""))
content=trim(replace(request.form("art_content"),"∈",""))
artisbest=request.form("isbest")
artistop=request.form("istop")
uGrade=request.form("Grade")
newpic=request.form("images")
isimg=request.form("hx66")
points=request.form("points")
tjuser=request.form("tjuser")
if catid<1 then
founderr=true
Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -