📄 newslist.asp
字号:
<%PageName="newslist.asp?typeid="&request("typeid")%>
<!--#include file="top.asp"-->
<%
MaxPerPageCount=MaxPerPage*3
typeid=request("typeid")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<table border="0" width=770 align=center cellspacing="1" cellpadding="1" bgcolor="<%=Tablebackcolor%>">
<tr>
<td bgcolor="<%=Tabletitlecolor%>" align="center" width="163" valign="top">
<table width="98%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td align="center">热 点</td>
</tr>
<tr>
<td bgcolor="<%=aTablebodycolor%>"><script src=hotnews.asp?typeid=<%=request("typeid")%>></script></td>
</tr>
</table>
</td>
<td bgcolor="<%=Tablebodycolor%>" width="600" height="2" align="center" valign="top">
<%
sql="select * from announce where type="&typeid&" order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'>暂时没有收集</p>"
else
totalPut=rs.recordcount
PageUrl="newslist.asp?typeid="&typeid
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPageCount>totalput then
if (totalPut mod MaxPerPageCount)=0 then
currentpage= totalPut \ MaxPerPageCount
else
currentpage= totalPut \ MaxPerPageCount + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPageCount,PageUrl
showcontent
showpage totalput,MaxPerPageCount,PageUrl
else
if (currentPage-1)*MaxPerPageCount<totalPut then
rs.move (currentPage-1)*MaxPerPageCount
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPageCount,PageUrl
showcontent
showpage totalput,MaxPerPageCount,PageUrl
else
currentPage=1
showpage totalput,MaxPerPageCount,PageUrl
showcontent
showpage totalput,MaxPerPageCount,PageUrl
end if
end if
end if
rs.close
sub showContent
i=0
response.write "<table width=""100%"" cellspacing=""1"" cellpadding=""1""><tr>"
do while not rs.eof
i=i+1
response.write "<td height=16><img src=images/gb1.gif><a href=newsshow.asp?id="&rs("id")&"&typeid="&typeid&" target=_blank>"&rs("title")&"</a> <font color=#666666>["&rs("author")&"]</font>"
if right(rs("DateAndTime"),2)=right(date(),2) then
response.write "<font color=#ff0000> "
else
response.write "<font color=#999999> "
end if
response.write rs("DateAndTime")&"</font></td>"
if i mod 2=0 and i>1 then response.write"</tr><tr>"
if i>=MaxPerPageCount then exit do
rs.movenext
loop
response.write "</table>"
end sub
function showpage(totalnumber,MaxPerPageCount,filename)
dim n
if totalnumber mod MaxPerPageCount=0 then
n= totalnumber \ MaxPerPageCount
else
n= totalnumber \ MaxPerPageCount+1
end if
response.write "<div align=right><form method=Post action="&filename&">"&_
"共找到<b>"&totalnumber&"</b>项记录"
if CurrentPage<2 then
response.write " 首页 上一页 "
else
response.write " <a href="&filename&"&page=1>首页</a> <a href="&filename&"&page="&CurrentPage-1&">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 末页 "
else
response.write "<a href="&filename&"&page="&CurrentPage+1&">下一页</a> "&_
"<a href="&filename&"&page="&n&">末页</a>"
end if
response.write " 页次:<strong>"&CurrentPage&"/"&n&"</strong>页 转到:<select name='page' size='1' onchange='javascript:submit()'>"
for i = 1 to n
response.write "<option value="&i
if cint(CurrentPage)=cint(i) then response.write " selected "
response.write ">第"&i&"页</option>"
next
response.write "</select></form></div>"
end function
%>
</td>
</tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
<%
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -