<%
dim MaxPerPage,totalPut,currentPage
MaxPerPage = 25
sql="SELECT id,title,pic,path,otime,hits " & _
"FROM news " & _
"WHERE categoryid = '.2.学校新闻.' " & _
"ORDER BY otime DESC"
rs.open sql,conn,1,1
'response.write(rs.recordCount)
'计算分页变量
totalPut=rs.recordcount
if request("page") and request("page") > 1 then
currentpage= request("page")
else
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
if (currentPage-1)*MaxPerPage[图]"
else
title = left(rs("title"),30)
end if
html = "
"
rs.moveNext
response.Write(html)
i=i+1
if i>=MaxPerPage then exit do
loop
'分页导航栏函数
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
if CurrentPage<2 then
response.write "