 |
| |
<%
Const MaxPerPage=18
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
classid=request("classid")
set rs=server.CreateObject("adodb.recordset")
if classid = "" then
rs.open "select * from news order by goodnews desc,id desc",conn,1,1
else
rs.open "select * from news where classid = "&classid&" order by goodnews desc,id desc",conn,1,1
end if
if err.number<>0 then
response.write " 数据库中暂时无数据,请重新选择查询选项"
end if
if rs.eof And rs.bof then
Response.Write " 数据库中暂时无数据,请重新选择查询选项"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
else
if (currentPage-1)*MaxPerPage
|
title="<%=rs("title")%>" target="_blank" class="a"><%=rs("title")%> (<%=mid(year(rs("adddate")),3,2)%>-<%=month(rs("adddate"))%>-<%=day(rs("adddate"))%>) |
<%i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
end sub
%>
| <%showpage2 totalput,MaxPerPage,"newslist.asp",classid,parentName%>
|
| |
|
|
|
 |