% dim exec, rs, page, recordcount dim pagecount, strPageList exec="select * from ly where jh=1 order by id desc" Set RS = Server.CreateObject("ADODB.RecordSet") rs.Open exec, Conn, 0, 1 exec="select top 1 bestNum from const" set rs=conn.execute(exec) RecordCount=rs(0) rs.close page=encodestr(Request.querystring("page")) if page="" or not isNumeric(page) then page=1 else page=int(page) end if pageCount=RecordCount/rcPerPage pageCount=int(pageCount) if (RecordCount mod rcPerPage)>0 then PageCount=PageCount +1 end if if page>pageCount then page=pageCount end if %>
| 共有精华 "& RecordCount &" 个,共 "& pageCount &" 页 | " pageList=pageList & ""
if page=1 then
pageList=pageList & " "
else
pageList=pageList & " "
end if
if page=1 then
pageList=pageList & " "
else
pageList=pageList & " "
end if
if pagecount-page=0 then
pageList=pageList & " "
else
pageList=pageList & " "
end if
pageList=pageList & " | " 'pagecount=2 p=int(page/pageLinkNum) if page mod pageLinkNum>0 then p=p+1 end if p=(p-1)*pageLinkNum+1 'response.write p 'response.end i=p+(pageLinkNum-1) if i> pagecount then i=pagecount end if if p>pageLinkNum then pageList=pageList & "[<<]" end if do while p<=i if p=page then pageList=pageList & "["&p&"]" else pageList=pageList & "["&p&"]" end if p=p+1 loop p=p-1 if p< pagecount then pageList=pageList & "[>>]" end if pageList=pageList & " |