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

📄 newslist.asp

📁 请认真阅读您的文件包然后写出其具体功能(至少要20个字)。尽量不要让站长把时间都花费在为您修正说明上。压缩包解压时不能有密码。
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<%
if cint(anysale.asGroups(8))=0 then call anysale.asNote("权限出错","你所在的用户组没有浏览资讯的权限!") end if

dim channelID,topic
if request("channelID")="" or not isnumeric(request("channelID")) then
	channelID=0
	topic="相关资讯列表"
else
	channelID=clng(request("channelID"))
	topic=anysale.getValue("as_channel","channelName","channelID="&channelID)
end if

call anysale.header("news",anysale.nav("channel",channelID,2,"")&"行业资讯",anysale.asInfo(3),anysale.asInfo(4))
%>
<%=anysale.ad(54,"class=""banner padT5""")%>

<div class="line5"></div>
<div class="bodyer">
 <!--1-->
 <div class="tab" style="width:948px;">
  <div class="tabList">
   <ul><li class="line30">&nbsp;&nbsp;<strong>您的位置:</strong>&nbsp;<a href="index.asp">首页</a>&raquo;<a href="news.asp">行业资讯</a><%=anysale.nav("channel",channelID,0,"newslist.asp?")%></li></ul>
  </div>  

  <div class="subClass" style="padding:0 10px;">
   <!--list-->
   <ul class="line10"><li></li></ul>
   <ul>
    <%=anysale.subList("channel",channelID,6,0,"newslist.asp?")%>
   </ul>
   <ul class="line10"><li></li></ul>
   <!--list.end-->
  </div>
  
 </div>
 <!--1.end-->
</div>
<div class="line5"></div>
<div class="bodyer">
 <!--list-->
 <div class="tab" style="width:690px;">
  <div class="tabList">
   <div><ul class="tabH"><li class="tabL">&nbsp;</li><li class="tabM"><%=topic%></li><li class="tabR">&nbsp;</li></ul></div>
  </div>
  <div>
   <ul class="line10"><li>&nbsp;</li></ul>
   <ul class="left borderR" style="padding:9px;width:440px;">
<%
dim rs,sql,page,ipage,npage,search
page = clng(request("page"))
if page="" or page<1 then page=1 end if

set rs= Server.CreateObject("ADODB.Recordset")
sql="select newsID,channelID,front,title,addtime,istop from as_news where islock=0 "
if request("keywords")<>"" then
	sql=sql+" and (title like '%"&anysale.checkStr(trim(request("keywords")))&"%' or tags like '%"&anysale.checkStr(trim(request("keywords")))&"%' or intro like '%"&anysale.checkStr(trim(request("keywords")))&"%')"
	search="&amp;keywords="&request("keywords")
end if
if channelID>0 then
	sql=sql+ anysale.IDList("channel",channelID)
	search=search+"&amp;channelID="&channelID
end if
if request("elite")=1 then
	sql=sql+ " and iselite=1"
	search=search+"&amp;elite="&request("elite")
end if
select case request("orders")
case 1
	sql=sql+" order by istop desc, addtime desc"
case 2
	sql=sql+" order by istop desc, views desc"
case else
	sql=sql+" order by istop desc, newsID desc"
end select
if request("orders")>0 then
	search=search+"&amp;orders="&request("orders")
end if

rs.open sql,conn,1

if not rs.eof then
	rs.pageSize = 50
	if page>rs.pageCount then page=rs.pageCount end if
	rs.absolutePage = page
	npage=rs.pageCount
	for ipage = 1 to rs.pageSize
%>
	<li>·<%=rs("front")%> <a href="newsdetail.asp?id=<%=rs("newsID")%>"><%=rs("title")%></a> <span class="date">[<%=anysale.formatDate(rs("addtime"),1)%>]</span></li>
<%
		if ipage mod 5=0 then response.write "<li>&nbsp;</li>" end if
		rs.moveNext
		if rs.eof then exit for end if
	next
%>
    <li>&nbsp;</li>
	<li><span class="right f14">共有<%=rs.recordcount%>条资讯&nbsp;<%=anysale.pagelink(page,npage,"newslist.asp?",search)%></span></li>
<%
else
	response.write "<ul class=""line10""><li></li></ul><ul><li>&nbsp;&nbsp;暂无相关资讯!</li></ul>"
end if
rs.close
set rs=nothing
%>
   </ul>
   <ul class="left" style="padding:9px;width:210px;">
    <%
	dim rst
	set rst=conn.execute("select top 10 title,newsID,intro,image from as_news where istopic=1 and islock=0 order by newsID desc")
	if not (rst.bof and rst.eof) then
	do while not rst.eof
	%>
    <li class="newsH">
     <img src="<%=rst(3)%>" alt="<%=rst(0)%>" />
     <h5><a href="newsdetail.asp?ID=<%=rst(1)%>"><%=rst(0)%></a></h5>
     <p><%=anysale.cutStr(rst("intro"),20)%></p>
	</li>
	<li class="line">&nbsp;</li>
    <%
	rst.movenext
	loop
	end if
	rst.close:set rst=nothing
	%>
	
   </ul>
   <ul class="line10"><li>&nbsp;</li></ul>
  </div>
 </div>
 
 <div style="float:left;width:252px;margin:0 0 0 6px;">
 <!--right-->
 <div class="tab" style="width:250px;">
  <div class="tabList">
   <div><ul class="tabH"><li class="tabL">&nbsp;</li><li class="tabM">今日资讯</li><li class="tabR">&nbsp;</li></ul></div>
  </div>
  <div style="padding:9px;">
   <ul>
    <%
	dim rsf
	set rsf=conn.execute("select top 10 newsID,title,addtime from as_news where istoday=1 and islock=0 order by newsID desc")
	if not (rsf.bof and rsf.eof) then
	do while not rsf.eof
	%>
    <li>·<a href="newsdetail.asp?ID=<%=rsf(0)%>"><%=anysale.cutStr(rsf(1),16)%></a></li>
    <%
	rsf.movenext
	loop
	end if
	rsf.close:set rsf=nothing
	%>
   </ul>
  </div>
 </div>
 <div class="line5"></div>
 
 <%if anysale.ad(55,"")<>"" then%>
 <div class="tab" style="width:250px;">
  <div class="tabList">
   <div><ul class="tabH"><li class="tabL">&nbsp;</li><li class="tabM">赞助商链接</li><li class="tabR">&nbsp;</li></ul></div>
  </div>
  <%=anysale.ad(55,"")%>
 </div>
 <div class="line5"></div>
 <%end if%>
 
 <div class="tab" style="width:250px;">
  <div class="tabList">
   <div><ul class="tabH"><li class="tabL">&nbsp;</li><li class="tabM">焦点资讯</li><li class="tabR">&nbsp;</li></ul></div>
  </div>
  <div style="padding:9px;">
   <ul>
    <%
	dim rsh,n
	set rsh=conn.execute("select top 11 newsID,title from as_news where islock=0 order by views desc")
	if not (rsh.bof and rsh.eof) then
	n=1
	do while not rsh.eof and n<12
	%>
    <li>·<a href="newsdetail.asp?ID=<%=rsh(0)%>"><%=anysale.cutStr(rsh(1),16)%></a></li>
    <%
	rsh.movenext
	n=n+1
	loop
	end if
	rsh.close:set rsh=nothing
	%>
   </ul>
  </div>
 </div>
 <div class="line5"></div>
 <div class="tab" style="width:250px;">
  <div class="tabList">
   <div><ul class="tabH"><li class="tabL">&nbsp;</li><li class="tabM">推荐资讯</li><li class="tabR">&nbsp;</li></ul></div>
  </div>
  <div style="padding:9px;">
   <ul>
    <%
	dim rse
	set rse=conn.execute("select top 11 newsID,title from as_news where iselite=1 and islock=0 order by newsID desc")
	if not (rse.bof and rse.eof) then
	do while not rse.eof
	%>
    <li>·<a href="newsdetail.asp?ID=<%=rse(0)%>"><%=anysale.cutStr(rse(1),16)%></a></li>
    <%
	rse.movenext
	loop
	end if
	rse.close:set rse=nothing
	%>
   </ul>
  </div>
 </div>
 
 <!--right.end-->
 </div>
 
 <!--list.end-->
</div>
<%
anysale.footer
closeConn
%>

⌨️ 快捷键说明

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