📄 admin_news_list.asp
字号:
set rs = Server.CreateObject("ADODB.RecordSet")
sql2="select count(Id) from news where sh=2"
set shs=conn.execute(sql2)
shs=shs(0)
sql2="select count(Id) from news where sh=0"
set hszs=conn.execute(sql2)
hszs=hszs(0)
sql2="select count(Id) from news where newscj=1 and sh=3"
set cjsh=conn.execute(sql2)
cjsh=cjsh(0)
sql2="select count(Id) from news where newscj=1"
set cjall=conn.execute(sql2)
cjall=cjall(0)
sql2="select count(Id) from news where sh=4"
set back=conn.execute(sql2)
back=back(0)
%>
<a href="?sh=1">正常显示的文章</a> <a href="?sh=0">查看草稿箱(<font color=red><%=hszs%></font>)</a> <a href="?sh=4">退回文章(<font color=red><%=back%></font>)</a> <a href="?sh=2">待审核文章(<font color=red><%=shs%></font>)</a> <a href="?cj=1">采集新闻未审(<font color=red><%=cjsh%></font>)(<font color=green>共<%=cjall%>条</font>)</a> </td>
</tr>
<%end if%>
<%
lm=trim(request("lm"))
title=trim(request("title"))
if lm<>"" then
sql = "select * from lm where id="&lm
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
%>
<tr>
<td align=center colspan="3" class=forumRow><font style='font-size:13pt;line-height:160%;color=ff0000'><b>查看“<%=rs("lm")&rs("lm2")&rs("lm3")%>”的新闻文章</b></font></td>
</tr>
<%elseif title<>"" then%>
<tr>
<td align=center colspan="3" class=forumRow><font style='font-size:13pt;line-height:160%;color=ff0000'><b>查看关键字“<%=title%>”的新闻文章</b></font></td>
</tr>
<%end if%>
<tr>
<td align=center colspan=3 class=forumRow>
<%
if sh=0 then
Response.Write "<font style='font-size:13pt;line-height:160%;color=ff0000'><b>回收站的文章</b></font><font color=ff0000>(回收站的文章就是不会显示在前台的文章!)</font>"
elseif sh=2 then
Response.Write "<font style='font-size:13pt;line-height:160%;color=ff0000'><b>待审核文章</b></font>"
elseif sh=4 then
Response.Write "<font style='font-size:13pt;line-height:160%;color=ff0000'><b>退回文章</b></font>"
elseif cj=1 then
Response.Write "<font style='font-size:13pt;line-height:160%;color=ff0000'><b>采集新闻</b></font>"
end if
%>
</td>
</tr>
</form>
</table>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<form method="post" name="holyfish" action="" onSubmit="return ConfirmDel();">
<%
ccc=""
if sh=1 and cj=0 then
ccc="../images/bj5.jpg"
elseif cj=1 then
ccc="../images/bg1.gif"
else
ccc="../images/bg1.gif"
end if
%>
<tr style="background-image: url('<%=ccc%>')">
<td width="38%"align="center" height="25">
<font color="#FFFFFF">(编号)标题(阅读)</font></td>
<td width="9%"align="center" height="25">
<font color="#FFFFFF">栏目</font></td>
<td width="10%" align="center" height="25">
<font color="#FFFFFF">加入时间</font></td>
<td width="7%" align="center" height="25">
<font color="#FFFFFF">加入人员</font></td>
<td width="34%" align="center" height="25" width="32%">
<font color="#FFFFFF">操作</font></td>
</tr>
<%
sql = "select title,adduser,id,lm,lm2,lm3,time,hit,ontop,updat,tj,titlecolor,pic,sh,shusername from news where title<>'' "
if lm<>"" then
sql = sql & " and (lm2='"&lm&"' or lm='"&lm&"' or lm3='"&lm&"') "
end if
if title<>"" and lm="" then
Select Case trim(request("Searchtp"))
Case "1"
sql = sql & " and title like '%"&title&"%' "
Case "2"
sql = sql & " and zz like '%"&title&"%' "
Case "3"
sql = sql & " and adduser like '%"&title&"%' "
End Select
end if
if Request.Cookies(Art2008)("admindj")="1" then
if cj="0" then
sql=sql & " and sh="&sh&" "
else
sql=sql & " and newscj= "&cj&" "
end if
end if
sql= sql& " order by ontop desc , updat desc , id desc"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.recordcount<>0 then
page=request("page")
if page<>"" then page=int(page)
rs.PageSize=20
pagecount=rs.pagesize
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page
gg=rs.recordcount/pagecount
gh=int(gg)
if gh<=1 then gh=1
if gg>gh then gh=gh+1
gg=gh
shusername=rs("shusername")
for i=1 to pagecount
lm2=trim(rs("lm3"))
if lm2="0" or lm2="" then lm2=trim(rs("lm2"))
if lm2="0" or lm2="" then lm2=trim(rs("lm"))
if lm2="" then lm2=0
if (not isNumeric(lm2)) then '08_01_09增加
lm2=0
end if
sql2 = "select * from lm where id="&lm2
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
if rs2.recordcount<>0 then
fontcolor=rs2("fontcolor")
if rs("titlecolor")="默认颜色" then
fontcolor=rs2("fontcolor")
else
fontcolor=rs("titlecolor")
end if
end if
%>
<tr height="25" onMouseOver=overColor(this) onMouseOut=outColor(this) class="tdbg">
<td>(<%=rs("id")%>)<%if rs("ontop")="5" then Response.Write "<b><font color=blue>[顶]</font></b>"%><a href="<%=fun_html_url(rs("id"))%>" target=_blank title='<%=rs("title")%>'><font color=<%=trim(fontcolor)%>><%=titleb(rs("title"),23)%></font></a><font color=CC9966>(<%=rs("hit")%>)</font><font color=green><%if trim(rs("pic"))<>"" then Response.Write "[图]"%></font>
<%
if admindj<>"1" and rs("sh")="2" then
Response.Write "<font color=FF0000>[未审]</font>"
end if
if rs("sh")="0" then Response.Write "<font color=666666>[回收站中]</font>"
%>
</td>
<td align=center>
<%
if rs2.recordcount<>0 then
if Request.Cookies(Art2008)("admindj")="1" then
response.write "<a href=?lm="&rs2("id")&">"&rs2("lm")&rs2("lm2")&rs2("lm3")&"</a>"
else
response.write ""&rs2("lm")&rs2("lm2")&rs2("lm3")&""
end if
else
response.write "<font color=blue>栏目不正确</font>"
end if
%></td>
<td align="center"><%=Format_Time(rs("time"),1)%></td>
<td>
<p align="center"><%=rs("adduser")%></td>
<td align="right">
<%if Request.Cookies(Art2008)("admindj")="1" then
if rs("tj")="不推荐" then
Response.Write "<a href=admin_news_list.asp?tj=推荐&id="&rs("ID")&"&page="&page&"&lm="&lm&" title='此文章没有推荐'>推荐</a> "
else
Response.Write "<a href=admin_news_list.asp?tj=不推荐&id="&rs("ID")&"&page="&page&"&lm="&lm&"&cj="&cj&" title='此文章已经推荐'><font color=red>推荐</font></a> "
end if
ontop=rs("ontop")
if ontop=3 then
response.write "<a href=?topid="&rs("id")&"&ontop=5&page="&page&"&lm="&lm&"&cj="&cj&" title='此文章没固顶'>固顶</a> "
else
response.write "<a href=?topid="&rs("id")&"&ontop=3&page="&page&"&lm="&lm&"&cj="&cj&" title='此文章已固顶'><font color=red>固顶</font></a> "
end if
else
response.write "<font color='#D1D1D1'>推荐 固顶 </font>"
end if
if Request.Cookies(Art2008)("admindj")="1" or rs("adduser")=Request.Cookies(Art2008)("adminuser") or shusername=Request.Cookies(Art2008)("adminuser") then
%>
<a href="admin_news_add.asp?id=<%=rs("ID")%>" title='编辑此文章'>修改</a>
<a href=# onclick='window.open("../NewsPL.asp?id=<%=rs("id")%>","newsview","width=850,height=400,top=70,left=120,scrollbars=yes" )' title='查看此文章的评论信息'>评论</a>
<a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href=admin_news_list.asp?delid=<%=rs("id")%>&page=<%=page%>&lm=<%=lm%>&cj=<%=cj%>&title=<%=title%> title='永久删除此文章'>删除</a>
<%else
response.write "<font color='#D1D1D1'>修改 评论 删除</font>"
end if
if Request.Cookies(Art2008)("admindj")="1" then
if rs("sh")="1" then
Response.Write "<a href=?id="&rs("id")&"&shsh=0&lm="&lm&"&sh="&sh&"&cj="&cj&"&word="&word&" title='放入回收站中'><img width=16 height=16 border=0 src='../images/isdel2.gif'></a>"
elseif rs("sh")=2 or rs("sh")=3 then
Response.Write "<a href=?id="&rs("id")&"&shsh=1&lm="&lm&"&sh="&sh&"&cj="&cj&"&word="&word&"><font color=red>待审</font></a>"
Response.Write "<a href=?id="&rs("id")&"&shsh=4&lm="&lm&"&sh="&sh&"&cj="&cj&"&word="&word&"><font color=red> 退稿</font></a>"
else
Response.Write "<a href=?id="&rs("id")&"&shsh=1&lm="&lm&"&sh="&sh&"&cj="&cj&"&word="&word&">还原</a>"
end if
Response.Write " <a href='?ontopid="&rs("id")&"&ontoplx=1&lm="&lm&"&sh="&sh&"&cj="&cj&"&word="&word&"&page="&page&"' title='顺序上升'>↑</a><a href='?ontopid="&rs("id")&"&ontoplx=0&lm="&lm&"&sh="&sh&"&cj="&cj&"&word="&word&"&page="&page&"' title='顺序下降'>↓</a>"
%>
<input type="checkbox" name="ppdelid" value="<%=rs("id")%>" onClick="checkItem(this, 'blogall')">
<%
else
response.write "<font color='#D1D1D1'> <img width=16 height=16 border=0 src='../images/isdel2.gif'> ↑↓ "
end if%>
</td>
</tr>
<%
response.flush
rs.movenext
if rs.eof then exit for
next
else
Response.Write "<tr><td colspan=5 bgcolor=#FFFFFF height=25>暂无信息</td></tr>"
end if
%>
<Tr><td align="center" class=forumRow height="30" colspan="5" >
<%
if rs.recordcount<>0 then
if page>1 then%>
<a href='<%=request.servervariables("URL")%>?page=1&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>&cj=<%=cj%>'>首页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>&cj=<%=cj%>'>上一页</a>
<%end if%>
<%if page<gg then%>
<a href='<%=request.servervariables("URL")%>?page=<%=page+1%>&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>&cj=<%=cj%>'>下一页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>&cj=<%=cj%>'>尾页</a>
<%end if%>
共<%=rs.recordcount%>条 每页显示<%=pagecount%>条 第<%=page%>页 共<%=rs.pagecount%>页
<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>
<select size="1" onChange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
<%for i=1 to rs.pagecount%>
<option value="<%=request.servervariables("URL")%>?page=<%=i%>&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>&cj=<%=cj%>" <%if page=i then response.write "selected"%>>第<%=i%>页</option>
<%next%>
</select>
<%if Request.Cookies(Art2008)("admindj")="1" then %>
<input type=checkbox name=blogall onClick="checkAll(this, 'ppdelid')">全选/取消
<input type="submit" name="DelFlag" value="删除选定新闻" onClick="document.holyfish.Action.value='Del'" >
<%if cj=1 then %>
<input type="submit" name="DelFlag" value="审核所选新闻">
<input type="submit" name="DelFlag" value="清空采集新闻">
<%end if
end if
%>
<%
end if
Response.flush
%>
</td></tr></form></table>
<%
Function DelHtml(Del_id)
'删除静态文件
html_url_sql = "select id,file_path,file_name from news where id="&clng(Del_id)
Set html_url_rs = Server.CreateObject("ADODB.RecordSet")
html_url_rs.Open html_url_sql,conn,1,3
if html_url_rs("file_path")<>"" and html_url_rs("file_name")<>"" then '输出静态文件
array_file_name=split(html_url_rs("file_name"),"|")
file_path=html_url_rs("file_path")
'判断是否有文件存在,如果存在,则调用静态文件,不存在,调用数据库显示
root_path=finddir(request.servervariables("URL")) '取出系统程序的工作目录.
wl_root_path=server.mappath(root_path)&"\" '栏目物理存放的目录
set fileobj=Server.Createobject("Scripting.FileSystemObject")
for file_n=0 to ubound(array_file_name)
file_name=array_file_name(file_n)
wl_file=wl_root_path&file_path&file_name
If fileobj.FileExists(wl_file) Then
fileobj.DeleteFile(wl_file) '跳转到静态文件
end if
next
set fileobj=nothing
end if '结束判断html_url_rs("file_path")<>"" 的条件.
html_url_rs.close
set html_url_rs=nothing
'删除静态文件
End Function
rs.close:set rs=nothing
call CloseConn()
call AdminPageEnd()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -