%
DIM articleperpage
sql="select articleid,title,classid,updatetime from pe_article where classid=111 order by articleid desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
articleperpage=20
%>
<%
dim totalart,i,showye,j,page
if not rs.eof then
rs.movefirst
rs.pagesize=articleperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totalart=rs.recordcount
if currentpage<>1 then
if(currentpage-1)*articleperpage
<%
i=i+1
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
<%=currentpage%> /<%=totalpages%>页,<%=totalart%>条记录/<%=articleperpage%>篇每页.
<%
if currentpage>9 then
i=int(currentpage/10)*10-1
if i+9>totalpages then
showye=totalpages
else
showye=int(currentpage/10)*10+10
end if
elseif totalpages<=10 then
i=1
showye=totalpages
else
i=1
showye=10
end if
for j=i to showye
if j=currentpage then
%>
<%=j%>
<%else%>
<%=j%>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=2
else
page=currentpage+1
end if%>
>>
<%end if%>