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

📄 admin_news_list.asp

📁 迅时后台可以 对新闻栏目进行管理
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% Response.Buffer = True %>
<%
ON ERROR RESUME NEXT
%>
<!--#include file = admin_chk.asp -->
<!--#include file = admin_conn.asp -->
<!--#include file = titleb.asp -->
<html>

<head>
<!--#include file = language.asp -->

<STYLE type="text/css"> <!-- a:link { text-decoration: none; font-family: AdobeSm; color: #000000 }
a:visited { text-decoration: none; color: #000000 }
A:hover {COLOR: green; FONT-FAMILY: "宋体"; TEXT-DECORATION: underline;}
body { font-size: 9pt; font-family: 宋体, Arial;color: #000000}
TD {FONT-SIZE: 9pt; FONT-FAMILY: "宋体", "Arial";color: #000000}
p {FONT-SIZE: 9pt; FONT-FAMILY: "宋体", "Arial";color: #000000}
input {FONT-SIZE: 9pt; FONT-FAMILY: "宋体", "Arial";color: #000000}
body { margin-top: 0; margin-bottom: 0; color: #000000 }
--></STYLE>
<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>
<base target="_self">
</head>

<body topmargin="0" bgcolor="#ffffff" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

<%
delid=trim(request("delid"))
tj=trim(request("tj"))
sh=trim(Request("sh"))
shsh=trim(Request("shsh"))
if sh="" then sh=1
delallid=trim(Request("delallid"))
id=trim(request("id"))
ontopid=trim(Request("ontopid"))
ontoplx=trim(Request("ontoplx"))


function hrefIDD(ID,filename)
	if filename<>"0" then
		hrefidd="../"&filename
	else
		hrefidd="../News_View.asp?NewsID="&ID
	end if
end function

if ontopid<>"" and ontoplx<>"" then

	if ontoplx="1" then
		set rs = Server.CreateObject("ADODB.RecordSet")
		rs.Open "select ID,ontop,time,updat from [news] where ID="&ontopid&"  order by id asc",conn,1,3
		if rs.recordcount<>0 then
			ontoptime=rs("updat")
				set rs2 = Server.CreateObject("ADODB.RecordSet")
				rs2.Open "select id,ontop,time,updat from [NEWS] where updat>"&ontoptime&"  and ontop=3 order by updat asc , id asc",conn,1,3
				if rs2.recordcount<>0 then
				
					rs("updat")=rs2("updat")
					rs2("updat")=ontoptime
					rs2.update
					rs.update
				end if
				rs2.close:set rs2=nothing
		end if
		rs.close:set rs=nothing
	end if
	
	if ontoplx="0" then
		set rs = Server.CreateObject("ADODB.RecordSet")
		rs.Open "select ID,ontop,time,updat from [news] where ID="&ontopid&"   order by id asc",conn,1,3
		if rs.recordcount<>0 then
			ontoptime=rs("updat")
				set rs2 = Server.CreateObject("ADODB.RecordSet")
				rs2.Open "select id,ontop,time,updat from [NEWS] where updat<"&ontoptime&"  and ontop=3 order by updat desc , id desc",conn,1,3
				if rs2.recordcount<>0 then
				
					rs("updat")=rs2("updat")
					rs2("updat")=ontoptime
					rs2.update
					rs.update
				end if
				rs2.close:set rs2=nothing
		end if
		rs.close:set rs=nothing
	end if	
end if

if delid<>"" then
	set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open "select id,filename from [news] where ID="&delid&" order by id desc",conn,1,1
	if rs.recordcount<>0 then
		filename=rs("filename")
		if filename<>"0" then
			sdDel("../"&rs("filename"))
		end if
	end if
	rs.close:set rs=nothing
  conn.Execute "delete from [news] where ID="&clng(delid)
  conn.Execute "delete from [newspl] where newsID="&clng(delid)
end if

if delallid<>"" then 
	delallid=replace(delallid," ","")
	delid=split(delallid,",")
	'Response.Write DELallID
	for i=0 to ubound(delid)
		if (isNumeric(delid(i))) then
		
				set rs = Server.CreateObject("ADODB.RecordSet")
				rs.Open "select id,filename from [news] where ID="&delid(i)&" order by id desc",conn,1,1
				if rs.recordcount<>0 then
					filename=rs("filename")
					if filename<>"0" then
						sdDel(rs("filename"))
					end if
				end if
				rs.close:set rs=nothing
						
			  conn.Execute "delete from [news] where ID="&clng(delid(i))
			  conn.Execute "delete from [newspl] where newsID="&clng(delid(i))
			  'Response.Write DELID(i)
		end if
	next
	
end if

if shsh<>"" and id<>"" then
	conn.Execute "update [news] set [sh]="&shsh&",[shUsername]='"&Request.Cookies("adminuser")&"' where id="&clng(id)
end if

if tj<>"" then
	conn.Execute = "update news set tj='"&tj&"' where ID="&id
end if
%>
<div align="center">
	<table border="0" width="100%" id="table2" cellspacing="0" cellpadding="5" bordercolor="#C0C0C0" >
		<tr>
			<td background="../images/bj3.jpg">
			<p align="center">分类显示:
<select size="1" onchange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt">
<option value>请选择栏目</option>
<option value=admin_news_list.asp?all=all>显示所有新闻信息</option>
					  <%					  
					  sql = "select * from lm where lm<>'' order by id asc"
					  Set rs = Server.CreateObject("ADODB.RecordSet")
					  rs.Open sql,conn,1,1
					  while not rs.eof
					       'response.write "<optgroup label=(ID:"&rs("id")&")"&rs("lm")&">"
					       %>
					         <option value='admin_news_list.asp?lm=<%=rs("id")%>' <% if clng(lmid)=clng(rs("id")) then response.write " selected" %>>(ID:<%=rs("id")%>)<%=rs("lm")%></option>
					       <%
							sql2 = "select * from lm where lmid='"&rs("id")&"' order by id asc"
							Set rs2 = Server.CreateObject("ADODB.RecordSet")
							rs2.Open sql2,conn,1,1
							while not rs2.eof
							%>
							   <option value='admin_news_list.asp?lm=<%=rs2("id")%>' <% if clng(lmid)=clng(rs2("id")) then response.write " selected" %>> ├(ID:<%=rs2("id")%>)<%=rs2("lm2")%></option>
							<%
				        Set rs33 = Server.CreateObject("ADODB.RecordSet")
				        rs33.Open "select * from [lm] where lmid='"&rs2("id")&"' and LM3<>'' order by id desc",conn,1,1
				        while not rs33.eof
				        %>
				        	<option value='admin_news_list.asp?lm=<%=rs33("id")%>' <% if clng(lmid)=clng(rs33("id")) then response.write " selected" %>>  ├(ID:<%=rs33("id")%>)<%=rs33("lm3")%></option>
				        <%
				        rs33.movenext
				        wend
							rs2.movenext
							wend
					  rs.movenext
					  wend 
					  rs.close
					  set rs=nothing
					 
					%>

</select>

			</td>
		</tr>
<%if Request.Cookies("admindj")=1 then%>
		<tr>
			<td background="../images/bj3.jpg">
			<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.title.value == "")
  {
    alert("请在 关键字 域中输入值。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length < 1)
  {
    alert("在 关键字 域中,请至少输入 1 个字符。");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length > 10)
  {
    alert("在 关键字 域中,请最多输入 10 个字符。");
    theForm.title.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="admin_news_list.asp" name="FrontPage_Form1" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript">
				<center>
				<table border="0" width="100%" id="table3" cellpadding="0" cellspacing="0">
					<tr>
						<td width="407">
						<%
						set rs = Server.CreateObject("ADODB.RecordSet")
						rs.Open "select sh,id from [News] where sh=2 order by id desc",conn,1,1
							shs=rs.recordcount
						rs.close:set rs=nothing
						set rs = Server.CreateObject("ADODB.RecordSet")
						rs.Open "select sh,id from [News] where sh=0 order by id desc",conn,1,1
							hszs=rs.recordcount
						rs.close:set rs=nothing						
						%>
						<p align="center"><a href="?sh=0">查看回收站(<%=hszs%>)</a> <a href="?sh=2">待审核文章(<%=shs%>)</a> <a href="?sh=1">正常显示的文章</a></td>
						<td width="106">按标题搜索新闻</td>
						<td width="476">
						&nbsp;<!--webbot bot="Validation" s-display-name="关键字" b-value-required="TRUE" i-minimum-length="1" i-maximum-length="10" --><input type="text" name="title" size="20" maxlength="10" style="border-style: solid; border-width: 1px">&nbsp; <input type="submit" value="搜索" name="B1" style="border: 1px solid #000000; background-color: #FFFFFF"></td>
					</tr>
				</table>
				</center>
			</td>
		</tr>
<%end if%>


<%

⌨️ 快捷键说明

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