⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_news_list.asp

📁 迅时后台可以 对新闻栏目进行管理
💻 ASP
📖 第 1 页 / 共 2 页
字号:
lm=trim(request("lm"))
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><font color=ff0000><B>查看“<%=rs("lm")&rs("lm2")&rs("lm3")%>”的新闻文章</b></font></td>
		</tr>
<%end if%>
	</table>
</div>
</form>
<%
if sh=0 then 
	Response.Write "<center><font style='font-size:17pt;line-height:160%;color=ff0000'><b>回收站的文章</b></font><BR><font color=ff0000>(回收站的文章就是不会显示在前台的文章!)</font>"
elseif sh=2 then
	Response.Write "<center><font style='font-size:17pt;line-height:160%;color=ff0000'><b>待审核文章</b></font>"	
end if
%>

<div align="center">
<form action=?delall=1 method=post>
	 <table border="1" id="table1" cellspacing="0" cellpadding="3" width=800 style="border-collapse: collapse" bordercolor="#C0C0C0">
		<%
			ccc=""
			if sh=1 then 
				ccc="../images/bj5.jpg"
			else
				ccc="../images/bg11.gif"
			end if
		%>
		<tr style="background-image: url('<%=ccc%>')">
			<td align="center" height="25" width="269">
			<font color="#FFFFFF">(编号)标题(阅读)</font></td>
			<td align="center" height="25" width="99">
			<font color="#FFFFFF">栏目</font></td>
			<td align="center" height="25" width="141">
			<font color="#FFFFFF">加入时间</font></td>
			<td align="center" height="25" width="79">
			<font color="#FFFFFF">加入人员</font></td>
			<td align="center" height="25" width="178">
			<font color="#FFFFFF">操作</font></td>
		</tr>
	</table>
<%
lm=trim(request("lm"))
title=trim(request("title"))


  sql = "select title,adduser,id,lm,lm2,lm3,time,hit,ontop,updat,tj,titlecolor,pic,sh,filename,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
	    sql = sql & " and title like '%"&title&"%' "
	  end if  
	  if Request.Cookies("admindj")="3" then
	    sql= sql &" and adduser='"&Request.Cookies("adminuser")&"' or sh=2  "
	  end if
	  if Request.Cookies("admindj")="2" then
	  	sql=sql & " and ( [sh]=2 or [sh]=3 or [adduser]='"&Request.Cookies("adminuser")&"') or [shusername]='"&Request.Cookies("adminuser")&"' "
	  end if
	  
	  if Request.Cookies("admindj")="1" then
	  	sql=sql & "  and sh="&sh&"  "
	  end if
	  
   sql= sql& "  order by ontop desc , updat desc  , id desc"
   
	'sql=" exec NewsListall"
  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
	
	bbb=0
	
	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
			    	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





%>
	<table border="1" id="table1" cellspacing="0" cellpadding="3" width=800 style="border-collapse: collapse" bordercolor="#C0C0C0">
		<tr <% if bbb=1 then Response.Write "style='background-color: #F2F2F2'"%>>
			<td width="267"><%if rs("ontop")="5" then Response.Write "<b><font color=blue>[顶]</font></b>"%>(<%=rs("id")%>)<a href="<%=hrefIDD(rs("ID"),rs("filename"))%>" target=_blank title='<%=rs("title")%>'><font color=<%=trim(fontcolor)%>><%=titleb(rs("title"),18)%></font></a><font color=999999>(<%=rs("hit")%>)<%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("filename")<>"0" then
					Response.Write "<font color=blue>[静]</font>"
				end if
				if rs("sh")="0" then Response.Write "<font color=bbbbbb>[回收站中]</font>"
			%>
			</td>
			<td align=center width="99">
			   <%

			   if rs2.recordcount<>0 then 
			      response.write rs2("lm")&rs2("lm2")&rs2("lm3")
			   else
			      response.write "<font color=blue>栏目不正确</font>" 
			   end if
			   %></td>
			<td align="center" width="141"><%=datetime(rs("time"))%></td>
			<td align=center width="79">
			<p align="center"><%=rs("adduser")%></td>
			<td align=center width="178">
			<%
			  if Request.Cookies("admindj")="1" then
			%>
			<p align="center">
			<%
			  if rs("tj")="不推荐" then
			    Response.Write "<a href=admin_news_list.asp?tj=推荐&id="&rs("ID")&"&page="&page&"&lm="&lm&" title='此文章没有推荐'>荐</a>&nbsp;"
			  else
			    Response.Write "<a href=admin_news_list.asp?tj=不推荐&id="&rs("ID")&"&page="&page&"&lm="&lm&" title='此文章已经推荐'><font color=red>荐</font></a>&nbsp;"
			  end if
			  %>
			   <%

			     ontop=rs("ontop")
			     if ontop=3 then
			       response.write "<a href=admin_news_ontop.asp?id="&rs("id")&"&ontop=5&page="&page&"&title="&title&"&lm="&lm&" title='此文章没固顶'>顶</a>&nbsp;"
			     else
			       response.write "<a href=admin_news_ontop.asp?id="&rs("id")&"&ontop=3&page="&page&"&title="&title&"&lm="&lm&" title='此文章已固顶'><font color=red>顶</font></a>&nbsp;"
			     end if
			   
			   end if
			   
			   if rs("adduser")=Request.Cookies("adminuser") or rs("shusername")=Request.Cookies("adminuser") or Request.Cookies("admindj")="1" then

			   %><a href="admin_news_add.asp?id=<%=rs("ID")%>" title='编辑此文章'>编辑</a> 
			  <a href="../NewsPL.asp?id=<%=rs("id")%>" title='查看此文章的评论信息' target=_blank>评</a>
			  <%end if
			  if Request.Cookies("admindj")="1" or Request.Cookies("admindj")="2" or rs("adduser")=Request.Cookies("adminuser") then
			  %>
			   <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href=admin_news_list.asp?delid=<%=rs("id")%>&page=<%=page%>&lm=<%=lm%>&title=<%=title%> title='永久删除此文章'>删</a>
			   <input type="checkbox" name="DELallID" value="<%=rs("id")%>">
			   <%end if%>
			   <%
			   		if Request.Cookies("admindj")="1" or Request.Cookies("admindj")="2" then
			   			if rs("sh")="1" then 
			   				Response.Write "<a href=?id="&rs("id")&"&shsh=0&lm="&lm&"&sh="&sh&"&word="&word&" title='放入回收站中'><img width=16 height=16 border=0 src='../images/isdel2.gif'></a>"
			   			elseif rs("sh")=2 then
			   				Response.Write "<a href=?id="&rs("id")&"&shsh=1&lm="&lm&"&sh="&sh&"&word="&word&">待审</a>"
			   			else
			   				Response.Write "<a href=?id="&rs("id")&"&shsh=1&lm="&lm&"&sh="&sh&"&word="&word&">还原</a>"
			   			end if
			   		end if
			   		if Request.Cookies("admindj")="1" then
			   			Response.Write "&nbsp;<a href='?ontopid="&rs("id")&"&ontoplx=1&lm="&lm&"&sh="&sh&"&word="&word&"&page="&page&"' title='顺序上升'>↑</a><a href='?ontopid="&rs("id")&"&ontoplx=0&lm="&lm&"&sh="&sh&"&word="&word&"&page="&page&"' title='顺序下降'>↓</a>"
			   		end if
			   %>
			   </td>
		</tr>
	</table>
<%
bbb=bbb+1
if bbb>=2 then bbb=0
response.flush
rs.movenext
if rs.eof then exit for
next
else
  Response.Write "<tr><td colspan=4>暂无信息</td></tr>"
   end if
%>

</div>
<center><br>
<%
if rs.recordcount<>0 then
  if page>1 then%>
     <a href='<%=request.servervariables("URL")%>?page=1&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>'>首页</a>
     <a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>'>上一页</a>
  <%end if%>
  <%if page<gg then%>
     <a href='<%=request.servervariables("URL")%>?page=<%=page+1%>&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>'>下一页</a>
     <a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&title=<%=title%>&lm=<%=lm%>&sh=<%=sh%>'>尾页</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%>" <%if page=i then response.write "selected"%>>第<%=i%>页</option>
        <%next%>
    </select>

<input onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' type="submit" name="" value=批量删除></p>
<%
end if
Response.flush  
%>
</form>


</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -