📄 news.asp
字号:
<!--#include file="top.asp"-->
<TABLE cellSpacing=0 cellPadding=0 width=1002 align=center border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle background=images/bj01.jpg>
<TABLE cellSpacing=0 cellPadding=0 width=924 align=center border=0>
<TBODY>
<TR>
<TD width=8 height=249 rowSpan=2></TD>
<TD vAlign=top align=middle width=907
background=images/bj.jpg>
<TABLE cellSpacing=0 cellPadding=0 width="99%" align=center
border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle width=261><IMG height=499
src="images/left_pic.jpg" width=252><BR><BR></TD>
<TD vAlign=top align=middle width=637><BR>
<TABLE cellSpacing=0 cellPadding=0 width=526 align=center
border=0>
<TBODY>
<TR>
<TD align=left height=46><IMG height=46
src="images/news.jpg"
width=512></TD></TR></TBODY></TABLE>
<br>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13" valign="top"> <div>
<%
const MarPerPage = 20'每页显示数目
if not isempty(request("page")) then
CurrentPage = cint(request("page"))
else
CurrentPage = 1
end if
set crs = server.CreateObject("adodb.recordset")
sqltext = "select * from News where BigClassName='新闻中心'"
if SmallClassName <> "" then
sqltext = sqltext & " and SmallClassName='"&names&"'"
end if
sqltext = sqltext & " order by Infotime desc"
crs.open sqltext,conn,1,3
if err.number <> 0 then
response.write "数据库中暂时无数据"
end if
if crs.eof and crs.bof then
response.write "<p align='center' class='contents'> 数据库中暂时无数据!</p>"
else
totalPut = crs.recordcount
if CurrentPage < 1 then
CurrentPage = 1
end if
if(CurrentPage -1)*MarPerPage > totalPut then
if(totalPut mod MarPerPage) = 0 then
CurrentPage = totalPut \ MarPerPage
else
CurrentPage = totalPut \ MarPerPage + 1
end if
end if
if CurrentPage = 1 then
showcontent
showpage totalPut,MarPerpage,"news.asp"
else
if(CurrentPage-1)*MarPerPage < totalPut then
crs.move (CurrentPage-1)*MarPerPage
dim bookmark
bookmark = crs.bookmark
showcontent
showpage totalPut,MarPerpage,"news.asp"
else
CurrentPage = 1
showcontent
showpage totalPut,MarPerpage,"news.asp"
end if
end if
end if
sub showcontent
i = 0
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
do while not crs.eof
%>
<tr>
<td width="78%" height="25"><img src="images/din.gif" width="6" height="5" /> <a href="newinfo.asp?id=<%=crs("id")%>" target="_blank" class="blue"><%=crs("Title")%></a></td>
<td width="22%"><div align="center">[<%=crs("Infotime")%>]</div></td>
</tr>
<%
i = i + 1
if i >= MarPerPage then exit do
crs.movenext
loop
%>
</table>
<%
crs.close
set crs = nothing
end sub
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">
<%
function showpage(totalnumber,maxpage,filename)
dim n
if totalnumber mod maxpage = 0 then
n = totalnumber \ maxpage
else
n = totalnumber \ maxpage + 1
end if
Response.Write "<form method=Post action="&filename&"?BigClassName="&names&">"
Response.Write "<p align='center'> "
If CurrentPage<2 Then
Response.Write "<font class=9>首 页 上一页</font> "
Else
Response.Write "<a href="&filename&"?page=1&BigClassName="&names&" >首 页</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&"&BigClassName="&names&" >上一页</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class=9>下一页 末 页</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&"&BigClassName="&names&" class=9>"
Response.Write "下一页</a> <a href="&filename&"?page="&n&"&BigClassName="&names&">末 页</a>"
End If
Response.Write "<font class=9> 页次:</font><font class=9>"&CurrentPage&"</font><font class=9>/"&n&"页</font> "
Response.Write "<font class=9> 共有"&totalnumber&"条"&names&"信息 "
Response.Write "<font class=9>转到第:</font><input type='text' name='page' size=2 maxlength=10 value="¤tpage&" class=9>页"
Response.Write " <input type='submit' value='跳转' name='cndok' ></form>"
end function
%>
</td>
</tr>
</table>
</div> </td>
</tr>
</table>
</TD>
</TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=middle background=images/bj_base.jpg
height=28> </TD></TR></TBODY></TABLE><LINK
href="images/css.css" type=text/css rel=stylesheet>
<TABLE class=m1 cellSpacing=0 cellPadding=0 width=924 align=center
border=0>
<TBODY>
<TR>
<TD width="113" height=82 align=center class=about></TD>
<TD width="811" align=center class=about><!--#include file="bottom.asp"--></TD>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -