📄 news_body.asp
字号:
<table width="605" border="0" align="center">
<tr align="center">
<td colspan="5"><img src="img/newsbanner.gif"></td>
</tr>
<tr>
<td width="20%" align="center"><a href="<%=dh1url%>"><%=dh1name%></a></td>
<td width="20%" align="center"><a href="<%=dh2url%>"><%=dh2name%></a></td>
<td width="20%" align="center"><a href="<%=dh3url%>"><%=dh3name%></a></td>
<td width="20%" align="center"><a href="<%=dh4url%>"><%=dh4name%></a></td>
<td width="20%" align="center"><a href="<%=dh5url%>"><%=dh5name%></a></td>
</tr>
</table>
<table width="605" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" height="30"><img src="img/1.gif" width="30" height="30"></td>
<td height="30" background="img/1_.gif"> </td>
<td width="30" height="30"><img src="img/2.gif" width="30" height="30"></td>
</tr>
<tr>
<td width="30" background="img/4-.gif"> </td>
<td valign="top">
<%sub news_body()
dim totalnews,Currentpage,totalpages,i
sql="select news_id,news_title,news_date from news order by news_date DESC"
if 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
%>
<TABLE width=552 border=0 align=center cellpadding="0" cellspacing="0" frame=vsides rules=none>
<TBODY>
<TR>
<td width=552 align="center" vAlign=top bgcolor="#990000"><table width='100%' border='0' align="center" cellpadding='0' cellspacing='1'>
<tr><td bgcolor="#990000"> <img src="img/biao.gif" align="absmiddle">
<%if request("type")=1 then%>
最新的10篇新闻
<%else%>共有<span class="newshead"><%=rs.recordcount%></span>篇新闻<%end if%></td>
</tr>
</table>
<table width="552" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#666666" bgcolor="#990000" style="border-collapse: collapse">
<tr bgcolor="#990000">
<td width="400" align="center">新闻列表</td>
<td width="150" 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
%>
<tr bgcolor="#000000">
<td width="400" align="left"> <img src=img/none.gif border=0><img src=img/i4.gif border='0'> <a href="javascript:news('shownews.asp?news_id=<%=rs("news_id")%>')">
<%=left(rs("news_title"),30) & "..."%>
</a></td>
<td width="150" align="center"><%=rs("news_date")%> </td>
</tr>
<%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
<tr>
<td colspan="2" align="center">当前没有新闻!</td>
</tr>
<%end if
end if
if not request("type")=1 then%>
<tr>
<td align="right" bgcolor="#990000" colspan="2">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR bgcolor="#990000">
<TD width="32%" height=30 align=middle><IMG height=14 src="img/cha.gif" width=14 align=absMiddle> 共[<font color="#FF6666"><%=totalnews%></font>]篇新闻 分[<font color="#FF6666"><%=totalpages%></font>]页</TD>
<TD width="38%" height="30" align=middle><IMG height=11 src="img/lt.gif" width=11 align=absMiddle>
<%
if CurrentPage<2 then
response.write "首页 上一页"
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 "下一页 尾页"
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/gt.gif" width=11 align=absMiddle></TD>
<form name="form1" method="post" action="news.asp">
<TD width="30%" height="30" align=middle>
<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="转向" class="button"> </TD>
</FORM>
</TABLE>
</td></tr>
</table>
</form></TD>
</TR>
</TBODY>
</TABLE></td>
<td width="30" background="img/2-.gif"> </td>
</tr>
<tr>
<td width="30" height="30"><img src="img/3.gif" width="30" height="30"></td>
<td height="30" background="img/3-.gif"> </td>
<td width="30" height="30"><img src="img/4.gif" width="30" height="30"></td>
</tr>
</table>
<%end if%>
<%
rs.close
set rs=nothing
end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -