📄 news_body.asp
字号:
<%sub news_body()
dim totalnews,Currentpage,totalpages,i
opennews
sql="select news_id,news_title,news_date from news order by news_date DESC"
if request("type")=1 then
sql="select top 10 news_id,news_title,news_date from news order by news_date DESC"
elseif request("type")=2 then
sql="select news_id,news_title,news_date from news order by news_date DESC"
elseif request("type")=3 then
sql="select news_id,news_title,news_date from news order by news_date ASC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<link href="../site_css.css" rel="stylesheet" type="text/css">
<table width="<%=tablewidth%>" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr bgcolor="#e6e7e8">
<td colspan="3" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td width="74%" valign="top"><table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><img src="yslm/BANNER2.jpg" width="558" height="110"></td>
</tr>
</table>
<table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="chinese"> <font color="#666666">
<%if request("type")=1 then%>
最新的10篇新闻
<%else%>
共有<span class="newshead"><%=rs.recordcount%></span>篇新闻
<%end if%>
</font> </td>
</tr>
</table>
<br>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="2" background="image/dotlineh.gif">
<tr bgcolor="#FFFFFF">
<td width="73%" height="22" align="center" class="chinese"><strong><font color="#666666">新闻列表</font></strong></td>
<td width="27%" align="center" class="chinese"><strong><font color="#666666">更新时间</font></strong></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
%>
<tr bgcolor="#FFFFFF">
<td width="73%" height="28" class="chinese"><a href="shownews.asp?news_id=<%=rs("news_id")%>" target="_blank"> <%=rs("news_title")%></a></td>
<td width="27%" align="center" class="chinese"><%=rs("news_date")%></td>
</tr>
<%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
<tr bgcolor="#FFFFFF">
<td height="22" colspan="2" align="center" class="chinese">当前没有新闻!</td>
</tr>
<%end if
end if%>
</table>
<%if not request("type")=1 then%>
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center" class="chinese">
<form name="form1" method="post" action="news.asp">
<tr>
<td align="right"> <font color="#666666"><%=currentpage%> /<%=totalpages%>页,<%=totalnews%>条记录/<%=newsperpage%>篇每页.</font>
<%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="news.asp?page=<%=i%>"><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="news.asp?page=<%=page%>" title="下一页">>></a>
<%end if%>
<input type="text" name="page" class="textarea" size="4">
<input type="submit" name="Submit" value="Go" class="button">
</td>
</tr>
</form>
</table>
<%end if%>
<br>
<br>
</td>
<td width="1" background="images/dotlinev.gif"></td>
<td width="25%" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF"> </td>
</tr>
</table>
<table width="85%" border="0" cellpadding="8" cellspacing="1" bgcolor="#CBCFD6" class="chinese">
<tr>
<td bgcolor="#F5F5F5" width="84%" align="right">
<P style="LINE-HEIGHT: 150%"><a href="?type=1">最新的10篇新闻</a><br>
<a href="?type=2">按时间降序排列</a><br>
<a href="?type=3">按时间升序排列</a></p>
</td>
</tr>
</table>
<br>
<table width="85%" border="0" align="center" cellpadding="5" cellspacing="0" class="chinese">
<tr>
<td align="right" class="chinese"> <p align="left" style="LINE-HEIGHT: 150%"><strong><font color="#666666">本
站 声 明</font></strong><br>
</p></td>
</tr>
<tr>
<td align="right">
<div align="left"><font color="#999999"> 本站的大部分资料,文章都来自网上收集,其版权归作者本人所有,如果有任何侵犯您权益的地方,请联系我,我将马上进行整理,谢谢。
</font> </div></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3" height="1"></td>
</tr>
</table>
<%
rs.close
set rs=nothing
end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -