📄 news.asp
字号:
<!--#include file="top.asp" -->
<%
if request("typeid")<>empty then
sql="select * from [news] where type="&cint(request("typeid"))&" and display=0 order by id desc"
else
sql="select * from [news] where display=0 order by id desc"
end if
rs.open sql,conn,1,1
pagesetup=15 '设定每页的显示数量
rs.pagesize=pagesetup
TotalPage=rs.pagecount '总页数
PageCount = cint(Request.QueryString("ToPage"))
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>0 then rs.absolutepage=PageCount '跳转到指定页数
%>
<TABLE class=tableborder cellSpacing=0 cellPadding=0 width=778 align=center
border=0>
<TBODY>
<TR>
<TD bgColor=#efefef height=22>
<TABLE cellSpacing=2 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align=middle width="4%"><IMG height=13
src="images/class_ar.gif" width=13></TD>
<TD width="74%">您当前的位置:<A href="<%=siteurl%>"><%=site%></A> -> <a href="news.asp">新闻资讯</a>
</TD>
<TD align=middle width="22%"> </TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
<TD bgColor=#d9d9d9 height=1></TD>
</TR>
<TR>
<TD height=5></TD>
</TR>
</TBODY>
</TABLE>
<table width="778" height="400" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder">
<tr valign="top">
<td class="tableleft"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="titleback2">栏目导航</td>
</tr>
<tr>
<td height="100" valign="top"><%
Set rsnewstype=conn.Execute("select * from [newstype]")
if rsnewstype.eof and rsnewstype.bof then
response.write "<br><br><center>暂无文章分类</center>"
else
%> <table width="100%" border="0" cellspacing="1" cellpadding="4" class=tabmenubar>
<%
do while not rsnewstype.eof
%>
<tr>
<td class=showbody1><%if rsnewstype("id")=cint(request("typeid")) then
response.write "· <a href=?typeid="&rsnewstype("id")&"><b>"&rsnewstype("typename")&"</b></a>"
else
response.write "· <a href=?typeid="&rsnewstype("id")&">"&rsnewstype("typename")&"</a>"
end if
%></td>
</tr>
<%
rsnewstype.movenext
loop
end if
rsnewstype.close
set rsnewstype=nothing
%>
</table> </td>
</tr>
<tr>
<td height="2" bgcolor="#FFFFFF"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="titleback1">热门文章</td>
</tr>
<%
Set rshot=conn.Execute("select top 10 id,title from [news] order by counter desc")
%>
<tr>
<td height="100" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
<%do while not rshot.eof%>
<tr>
<td class="list1">· <a href="news_show.asp?id=<%=rshot("id")%>"><%=left(rshot("title"),12)%>...</a></td>
</tr>
<%
rshot.movenext
loop
rshot.close
set rshot=nothing
%>
</table></td>
</tr>
</table></td>
<td align="right" class="tableright"><table width="575" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="130" height="30" bgcolor="#EFEFEF"><img src="images/search.gif" width="120" height="26"></td>
<td width="445" bgcolor="#EFEFEF"><!--搜索表单--> <table width="70%" border="0" cellpadding="0" cellspacing="0">
<form name="form1" method="post" action=""><tr>
<td>
<input type="text" name="textfield"></td>
<td><select name="select">
<option>搜索条件</option>
<option value="1">按标题</option>
<option value="2">按内容</option>
</select></td>
<td><input type="submit" name="Submit" value="提 交"></td>
</tr></form>
</table> </td>
</tr>
<tr>
<td height="5" colspan="2"></td>
</tr>
</table>
<table width="99%" border="0" cellpadding="3" cellspacing="0">
<tr>
<th width="2%"></th>
<th width="73%" align="left">新闻标题</th>
<th width="15%" noWrap>加入时间</th>
<th width="10%" noWrap>阅读次数</th>
</tr>
<tr>
<td colspan="4" height="1"></td>
</tr>
</table>
<%
i=0
j=0
Do While Not RS.EOF and i<pagesetup
i=i+1
if j mod 2 = 0 then
titleclass="showlist1"
else
titleclass="showlist2"
end if
%>
<table width="99%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td width="2%" height="25" align="center" class="<%=titleclass%>"> ·</td>
<td width="73%" class="<%=titleclass%>"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank"><%=rs("title")%></a></td>
<td width="15%" class="<%=titleclass%>" align="center"><%=rs("time")%></td>
<td width="10%" class="<%=titleclass%>" align="center"><%=rs("counter")%></td>
</tr>
</table>
<%
j=j+1
rs.movenext
loop
rs.close
set rs=nothing
%>
<table width="99%" border="0" cellpadding="3" cellspacing="0">
<tr align="center">
<td height="25" align="right">
[<b>共有 <font color="990000"><%=TotalPage%></font> 页
<script>
ShowPage(<%=TotalPage%>,<%=PageCount%>,"typename=<%=Request("typename")%>&typeid=<%=Request("typeid")%>")
</script>
</b>] </td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="links.asp"-->
<!--#include file="bottom.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -