📄 news.asp
字号:
<!--#Include File="Check_hx.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/inc.asp"-->
<%
start="新闻动态"
dim founderr
founderr=false
if request.querystring("cat_id")<>"" then
if not isInteger(request.querystring("cat_id")) then
founderr=true
Response.Write "<script language=javascript>alert('参数非法');javascript:history.back();</script>"
end if
end if
if request("page")<>"" then
if not isInteger(request("page")) then
founderr=true
Response.Write "<script language=javascript>alert('参数非法');javascript:history.back();</script>"
end if
end if
if request("keyword")<>"" then
if instr(request("keyword"),"'")>0 then
founderr=true
Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
end if
end if
cat_id=request.querystring("cat_id")
mtyid2=cat_id
call head()
call menu()
aabb01=""
mtyid2=int(mtyid2)
aabb01=aabb01+"<table border=0 width=760 align=center bgcolor=#FFFFFF cellpadding=0 cellspacing=0 height=20 class=table-hx66s><tr><td><table border=0 align=center bgcolor=#FFFFFF width=756 cellpadding=0 cellspacing=0>"
set hx01=conn.execute("select cat_id,cat_name,sid from newcat order by cat_id")
do while not hx01.eof
if hx01("sid")=0 then
if hx01("cat_id")=mtyid2 then
hx1=hx1+"<a href=news.asp?cat_id="&hx01("cat_id")&" title="&hx01("cat_name")&"><font color=red>"&hx01("cat_name")&"</font></a> <img src=img/menu.gif align=absmiddle border=0> "
else
hx1=hx1+"<a href=news.asp?cat_id="&hx01("cat_id")&" title="&hx01("cat_name")&">"&hx01("cat_name")&"</a> <img src=img/menu.gif align=absmiddle border=0> "
end if
end if
if mtyid2=hx01("sid") then
hx66010=hx66010+" or cat_id="&hx01("cat_id") '显示页所需变量news.asp
hx2=hx2+"<a href=news.asp?cat_id="&hx01("cat_id")&" title="&hx01("cat_name")&">"&hx01("cat_name")&"</a> <img src=img/menu.gif align=absmiddle border=0> "
end if
if mtyid2=hx01("cat_id") then
hx6603=hx01("sid")
if hx6603<>0 then
hxa01="select cat_id,cat_name,sid from newcat where sid="&hx6603&" order by cat_id"
set hx02=conn.execute(hxa01)
do while not hx02.eof
if hx02("cat_id")=mtyid2 then
hx5=hx5+"<a href=news.asp?cat_id="&hx02("cat_id")&" title="&hx02("cat_name")&"><font color=red>"&hx02("cat_name")&"</font></a> <img src=img/menu.gif align=absmiddle border=0> "
else
hx5=hx5+"<a href=news.asp?cat_id="&hx02("cat_id")&" title="&hx02("cat_name")&">"&hx02("cat_name")&"</a> <img src=img/menu.gif align=absmiddle border=0> "
end if
hx02.movenext
loop
hx02.close
set hx02=nothing
end if
end if
hx01.movenext
loop
hx01.close
set hx01=nothing
'if hx1<>"" then aabb01=aabb01+"<tr align=left><td height=23> · <a href=news.asp>全部新闻</a> <img src=img/menu.gif align=absmiddle border=0> "&hx1&" </td></tr>"
if hx2<>"" then aabb01=aabb01+"<tr align=center><td><img src=img/menu.gif align=absmiddle border=0> "&hx2&"</td></tr>"
if hx3<>"" then aabb01=aabb01+"<tr align=center><td><img src=img/menu.gif align=absmiddle border=0> "&hx3&"</td></tr>"
if hx4<>"" then aabb01=aabb01+"<tr align=center><td><img src=img/menu.gif align=absmiddle border=0> "&hx4&"</td></tr>"
if hx5<>"" then aabb01=aabb01+"<tr align=center><td><img src=img/menu.gif align=absmiddle border=0> "&hx5&"</td></tr>"
aabb01=aabb01+"</table></td></tr></table>"
response.write aabb01
%>
<%
dim totalnews,Currentpage,totalpages,i
sql="select * from news order by istop desc,news_date DESC"
if request("cat_id")<>"" then
sql="select * from news where (cat_id="&cat_id&hx66010&") order by istop desc,news_date DESC"
elseif request("keyword")<>"" then
sql="select * from news where "&request("select")&" like '%"&request("keyword")&"%' order by istop desc,news_date DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="table-hx66s">
<TBODY>
<TR vAlign=top align=left>
<TD width=188>
<DIV class="table-right">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-shangxia">
<tr>
<td height="23" class="a1"> 新 闻 分 类</td>
</tr>
</table>
<table width="100%" border=0 cellspacing="0" cellpadding="5">
<tr><td>
<%
response.write " <font color=#FF0000>·</font> <a href=news.asp>全部新闻</a><BR>"
sql="select * from newcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
if request("cat_id")=cstr(rs1("cat_id")) then
sql2 = "select * from newcat where sid="&rs1("cat_id")&""
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
response.write " <font color=#FF0000>· "&rs1("cat_name")&"</a></font> (小类:"
response.write rs2.recordcount&"个)<BR>"
else
sql2 = "select * from newcat where sid="&rs1("cat_id")&""
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
response.write " <font color=#FF0000>·</font> <a href='?cat_id="&rs1("cat_id")&"'>"&rs1("cat_name")&"</a> (小类:"
response.write rs2.recordcount&"个)<BR>"
end if
rs1.movenext
loop
rs1.close
set rs1=nothing%>
</td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-shangxia">
<tr>
<td height="23" class="a1"> 新 闻 查 找</td>
</tr>
</table>
<form name="form2" method="post" action="news.asp"><div align=center><input type="radio" name="select" value="news_title" checked class='inuptCG'>标题 <input type="radio" name="select" value="news_content" class='inuptCG'>内容 <input type='radio' name='select' value='review' class='inuptCG'>评论<br><input type='text' name='keyword' size='15' value='搜索关键字' maxlength='50' onfocus="this.value=''" class='input'> <input type='submit' name='search' value='搜索' onmouseover="this.className='boton'" onmouseout="this.className='botoff'">
</div></form>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-shangxia">
<tr>
<td height="23" class="a1"> 本 站 声 明</td>
</tr>
</table>
<div style="LINE-HEIGHT: 180%"> <font color=#FF0000>·</font>本站的大部分资料,文章都来自网上收集,其版权归作者本人所有,如果有任何侵犯您权益的地方,请联系我们,我们将马上进行整理,谢谢。
</TD>
<TD>
<DIV class=mframe>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-shangxia">
<tr>
<td height="23" class="a1"> 共有<span class='newshead'><%=rs.recordcount%></span>篇新闻</td>
</tr>
</table>
<table width="99%" border="1" cellspacing="0" cellpadding="3" bgcolor="#FFFFFF" style="border-collapse: collapse" class="table-left" align="right" frame=lhs>
<tr><TD width="6%" align=Center height="26">状态</TD><td width="60%" bgcolor="#FFFFFF" align="center">主 题</td><TD width="10%" align=Center>人气</TD><td width="24%" bgcolor="#FFFFFF" align="center">发表时间</td></tr>
<%
if not rs.eof then
rs.movefirst
rs.pagesize=newsperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totalnews=rs.recordcount
if currentpage<>1 then
if (currentpage-1)*newsperpage<totalnews then
rs.move(currentpage-1)*newsperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totalnews mod newsperpage)=0 then
totalpages=totalnews\newsperpage
else
totalpages=totalnews\newsperpage+1
end if
i=0
do while not rs.eof and i<newsperpage
%>
<%
sql="select cat_id,cat_name from newcat where cat_id="&rs("cat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
if rs("istop")="1" then
folder="<img src=""img/1.gif"" title=固顶新闻>"
else
folder="<img src=""img/4.gif"">"
end if
%>
<TR bgColor=#FFFFFF><TD width="6%" align=Center height="26"><%=folder%></TD><TD width="60%"><a href='news.asp?cat_id=<%=rs("cat_id")%>'>『<%=rscat("cat_name")%>』</a><a href='shownews.asp?news_id=<%=rs("news_id")%>' target='_blank' Title='新闻名称:<%=rs("news_title")%>
上传时间:<%=rs("news_date")%>
浏览指数:<%=rs("news_count")%>'><font color="<%=rs("news_color")%>"><%=rs("news_title")%></font></a>
<%if rs("isimg")=1 then
Response.Write "<img src='img/img.gif' alt='图片新闻'>" & vbCrLf
end if%>
<%if DateDiff("h",rs("news_date"),now())<=24 then
Response.Write "<img src='img/new.gif' alt='24小时内新闻'>" & vbCrLf
end if%></TD><TD width="10%" align=Center><%=rs("news_count")%></TD><TD width="24%" align=Center><%=rs("news_date")%></TD></TR>
<%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
<TR bgColor=#FFFFFF><TD colspan="4" align="center">当前没有新闻!</TD></TR>
<%end if
end if
if not request("type")=1 then%>
<form name="form1" method="post" action="news.asp">
<tr height=30 bgColor=#FFFFFF><td colspan="4">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD align=middle width="35%" height=25><IMG height=14 src="img/so.gif" width=14 align=absMiddle> 共[<font color="#FF6666"><%=totalnews%></font>]个作品 分[<font color="#FF6666"><%=totalpages%></font>]页</TD>
<TD width="40%" align=middle><IMG height=11 src="img/lt.gif" width=11 align=absMiddle>
<%
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href=news.asp?page=1>首页</a> "
response.write "<a href=news.asp?page="&CurrentPage-1&">上一页</a> "
end if
if totalpages-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href=news.asp?page="&(CurrentPage+1)
response.write ">下一页</a> <a href=news.asp?page="&totalpages&">尾页</a>"
end if
%> <IMG height=11 src="img/rt.gif" width=11 align=absMiddle></TD>
<form name="form1" method="post" action="news.asp">
<TD align=middle width="25%">
<select name="page" class="lanyu">
<%
i=1
for i=1 to totalpages
if i=currentpage then
%>
<option value=<%=i%> selected>第<%=i%>頁</option>
<%else%>
<option value=<%=i%>>第<%=i%>頁</option>
<%end if
next%>
</select><input type="submit" name="Submit2" value="轉向" onmouseover="this.className='boton'" onmouseout="this.className='botoff'" class="botoff"> </TD>
</TR>
</FORM>
</TABLE> </td></tr>
<%end if%>
<tr align="center"><td height="10" colspan="4"></td></tr></table><br>
</DIV></TD></TR>
</TBODY></TABLE>
<%
rs.close
set rs=nothing
call footer()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -