📄 admin_art.asp
字号:
rs.close
set rs=nothing
conn.execute ("UPDATE [user] SET points = points + "&fbpoints&" where username='"&tjuser&"'")
response.redirect Request.ServerVariables("http_referer")
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
'================hx66.com.cn===============
if request.QueryString("action")="cat" then
Response.Write("<table align=""center"" width=""98%"" border=""1"" cellspacing=""0"" cellpadding=""4"" class=Hxcmsbk style=""border-collapse: collapse"">")
%>
<tr><form name="form3" method="post" action="">
<td colspan="6" class=Hxcmsss>文章管理</td>
<td colspan="2" class=Hxcmsss 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>
<option value="admin_art.asp?action=cat&wz=1">显示收费文章</option>
<option value="admin_art.asp?action=cat&wz=2">显示会员文章</option>
<option value="admin_art.asp?action=cat&wz=3">显示VIP文章</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
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing%>
</select>
</td></tr></form>
<%
Dim CurPage,Url_Add
Url_Add="?action=cat&"
If Request.QueryString("Page")<>"" Then
Curpage=Request.QueryString("Page")
If IsInteger(Curpage)=False OR Curpage<0 Then Curpage=1
Else
Curpage=1
End If
if request.querystring("cat_id")<>"" then
cat_id=cint(request.querystring("cat_id"))
sql="select * from art where cat_id="&cat_id&" order by art_id desc"
Url_Add=Url_Add&"cat_id="&cat_id&"&"
elseif request("keyword")<>"" then
keyword=trim(replace(request("keyword"),"'",""))
sea_type=trim(replace(request("sea_type"),"'",""))
sql_tmp=1
sql="select * from art where "&sea_type&" like '%"&keyword&"%' order by art_id DESC"
Url_Add=Url_Add&"sea_type="&sea_type&"&keyword="&keyword&"&"
elseif request.querystring("wz")<>"" then
if request.querystring("wz")=1 then
sql="select * from art where points<>0 order by art_id desc"
Url_Add=Url_Add&"wz=1&"
elseif request.querystring("wz")=2 then
sql="select * from art where grade=1 order by art_id desc"
Url_Add=Url_Add&"wz=2&"
elseif request.querystring("wz")=3 then
sql="select * from art where grade=2 order by art_id desc"
Url_Add=Url_Add&"wz=3&"
end if
elseif request.querystring("t")="pass" then
sql="select * from art where passed=1 order by art_id DESC"
Url_Add=Url_Add&"t=pass&"
else
sql="select * from art where passed=0 order by istop desc,art_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write("<tr align=""center""><td class=Hxcmsds colspan=8>当前没有文章!</td></tr>")
Else
Dim art_Nums,MultiPages,j
rs.PageSize=adflperpage
rs.AbsolutePage=CurPage
art_Nums=rs.RecordCount
MultiPages="<tr><td class=Hxcmsqs colspan=""8"" align=""center"">共有文章:"&art_Nums&"篇。 "&MultiPage(art_Nums,adflperpage,CurPage,Url_Add)&"</td></tr>"
%>
<form name="form4" method="post" action="admin_art.asp?action=cat">
<tr align="center" class=Hxcmsqs>
<td colspan="8">搜索(文章列表)关键字:
<input type=text name=keyword size=15 maxlength=20>
<select name=sea_type size=1>
<option value='art_title'>按标题</option>
<option value='tjuser'>按发布人</option>
</select>
<input type=submit value='搜 索'></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=Hxcmsqs width="5%">选中</td>
<td class=Hxcmsqs width="5%">审核</td>
<td class=Hxcmsqs width="41%">文章标题<%if sql_tmp="1" then response.write "(搜索结果:"&keyword&")"%></td>
<td class=Hxcmsqs width="10%">分类</td>
<td class=Hxcmsqs width="10%">提交人</td>
<td class=Hxcmsqs width="12%">发表时间</td>
<td class=Hxcmsqs width="5%">评论</td>
<td class=Hxcmsqs width="12%">操作</td>
</tr>
<%
Do Until Rs.EOF OR j=adflperpage
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=Hxcmsds>
<td align="center"><input type=checkbox Name="art_id" Value="<%=rs("art_id")%>"<%if Check_Admin(rs("tjuser")) then Response.Write(" disabled")%>></td>
<td align="center"><%If Rs("passed")=1 Then%><a href="?id=<%=rs("art_id")%>&action=checkpass"><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 align="center"><%=rscat("cat_name")%></td>
<td align="center"><%=rs("tjuser")%></td>
<td align="center"><%=formatdatetime(rs("art_date"),2)%></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></td>
</tr>
<%
j=j+1
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<tr><td class=Hxcmsqs colspan="8">
<input type=hidden value=DEL name=operation>
<input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="ON">选中本页所有 <input type=submit value=批量删除 onClick="return confirm('确定删除选中的文章吗?');" class="button"> </td>
</tr></form>
<%
Response.Write(MultiPages)
Response.Write("</table>")
end if
'================hx66.com.cn===============
if request.Form("action")="newart" then
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,artauthor,artahome,PaginationType,MaxCharPerPage,sImgYes
catid=request.form("cat_id")
title=trim(replace(request.form("art_title"),"'",""))
keyword=trim(replace(request.form("art_keyword"),"'",""))
For i = 1 To Request.Form("art_content").Count
sContent = sContent & Request.Form("art_content")(i)
Next
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")
artauthor=trim(replace(request.form("art_author"),"'",""))
artahome=trim(replace(request.form("art_ahome"),"'",""))
PaginationType=request.form("PaginationType")
MaxCharPerPage=request.form("MaxCharPerPage")
sImgYes=request.form("hx6666")
if not isInteger(catid) then
Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
response.end
end if
if title="" then
Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
response.end
end if
if artauthor="" or artahome="" then
Response.Write("<script language=javascript>alert('文章作者和文章来源不能为空!');history.back(1);</script>")
response.end
end if
if keyword="" then
Response.Write("<script language=javascript>alert('你必须填写文章的关键字!');history.back(1);</script>")
response.end
end if
if sContent="" then
Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
response.end
end if
rs("cat_id")=catid
rs("art_title")=title
rs("art_author")=artauthor
rs("art_ahome")=artahome
rs("art_keyword")=keyword
rs("art_content")=sContent
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)
rs("images")=newpic
rs("imgyes")=cint(sImgYes)
end if
if cint(uGrade)=0 then
rs("points")=0
else
rs("points")=cint(points)
end if
rs("Grade")=cint(uGrade)
rs("tjuser")=tjuser
rs("PaginationType")=PaginationType
rs("MaxCharPerPage")=MaxCharPerPage
rs.update
rs.close
set rs=nothing
conn.execute "update allcount set articlecount = articlecount + 1"
response.redirect "admin_art.asp?action=cat"
end if
'================hx66.com.cn===============
if request.Form("action")="editart" then
if request.Form("id")="" then
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
response.End
else
if not isInteger(request.form("id")) then
Response.Write("<script language=javascript>alert('非法的文章id参数。');history.back(1);</script>")
response.End
end if
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=request.form("cat_id")
title=trim(replace(request.form("art_title"),"'",""))
keyword=trim(replace(request.form("art_keyword"),"'",""))
For i = 1 To Request.Form("art_content").Count
sContent = sContent & Request.Form("art_content")(i)
Next
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")
artauthor=trim(replace(request.form("art_author"),"'",""))
artahome=trim(replace(request.form("art_ahome"),"'",""))
PaginationType=request.form("PaginationType")
MaxCharPerPage=request.form("MaxCharPerPage")
sImgYes=request.form("hx6666")
if not isInteger(catid) then
Response.Write("<script language=javascript>alert('你必须选择文章的分类!');history.back(1);</script>")
response.End
end if
if title="" then
Response.Write("<script language=javascript>alert('你必须填写文章的标题!');history.back(1);</script>")
response.End
end if
if artauthor="" or artahome="" then
Response.Write("<script language=javascript>alert('文章作者和文章来源不能为空!');history.back(1);</script>")
response.End
end if
if keyword="" then
Response.Write("<script language=javascript>alert('你必须填写文章的关键字!');history.back(1);</script>")
response.End
end if
if sContent="" then
Response.Write("<script language=javascript>alert('你必须填写文章的内容!');history.back(1);</script>")
response.End
end if
rs("cat_id")=catid
rs("art_title")=title
rs("art_author")=artauthor
rs("art_ahome")=artahome
rs("art_keyword")=keyword
rs("art_content")=sContent
if cint(isimg)=1 then
rs("isimg")=cint(isimg)
rs("images")=newpic
rs("imgyes")=cint(sImgYes)
else
rs("isimg")=0
rs("images")=newpic
rs("imgyes")=0
end if
rs("isbest")=cint(artisbest)
rs("istop")=cint(artistop)
rs("Grade")=cint(uGrade)
if cint(uGrade)=0 then
rs("points")=0
else
rs("points")=cint(points)
end if
rs("tjuser")=tjuser
rs("PaginationType")=PaginationType
rs("MaxCharPerPage")=MaxCharPerPage
rs.update
if cint(artisbest)=1 then
conn.execute "UPDATE [user] SET points = points + "&bestpoints&" where username='"&tjuser&"'"
end if
if cint(artistop)=1 then
conn.execute "UPDATE [user] SET points = points + "&toppoints&" where username='"&tjuser&"'"
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -