求高手解决下列表分页问题
按年度分类列表页 指定数字20 只能生成一页 数字多少都是一页,比如2010年一页 2011年的一页 如何把多出20的if i>=20生成下一页呢<%Admin="DownMake"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>年度分类</title>
<style>
body{font-size:12pt;line-height:140%}
</style>
</head>
<body>
<!--#include file="check.asp"-->
<!--#include file="config.asp"-->
<!--#include file="pingyin.asp"-->
<%
page=ubound(split(webDownPt,","))+1
pagepath="../year/"
JyDownNewPage=request("JyDownNewPage")
if JyDownNewPage<>"" then
%>
<!--#include file="mdb_path_down.asp"-->
<%
shu=15
if JyDownNewPage="0" then
sql="select top 20 * from down order by hits desc"
pagename=pagepath&"top_"&JyDownNewPage&""&softfile&""
title="all"
else
si=cint(JyDownNewPage)-1
if webDownLbShu<>"" then
LBshu=split(webDownLbShu,",")
shu=LBshu(si)
end if
if webDownPt<>"" then
LBname=split(webDownPt,",")
title=LBname(si)
end if
qttt="system='"&title&"'"
sql="select top 20 * from down where "&qttt&" order by hits desc"
pagename=pagepath&"top_"&JyDownNewPage&""&softfile&""
end if
set rs=server.createobject("adodb.recordset")
set rs_type=server.createobject("adodb.recordset")
'列表内容
rs.open sql,conn,1,1
if not rs.eof then
i=0
do while not rs.eof
lb=lb&"<dl class=""groupInfo clearfix""><dt></dt>"
lb=lb&"<dd><ul><li><a href=""../"&softpath&"/"&c(rs("cxn"))&""&softdir&""&rs("id")&""&softfile&"""><strong>"&rs("cxn")&"</strong></a></li>"
lb=lb&"<li>内容:"
if rs("body")<>"" then
tempstr=replace(rs("body"),"<br>","")
tempstr=replace(tempstr,"<p>","")
tempstr=replace(tempstr,"</p>","")
tempstr=replace(tempstr,"<b>","")
tempstr=replace(tempstr,"<","")
tempstr=replace(tempstr,">","")
tempstr=replace(tempstr,"/","")
tempstr=replace(tempstr," ","")
lb=lb&""&left(tempstr,300)&" ..."
else
lb=lb&"没有内容"
end if
lb=lb&"</li>"
lb=lb&"<li class=""playBtn""><a class=""play_icon"" href=""../"&softpath&"/"&c(rs("cxn"))&""&softdir&""&rs("id")&""&softfile&"""><span>播放</span></a></li></ul></dd></dl>"
i=i+1
if i>=20 then exit do
rs.movenext
loop
end if
rs.close
'读取模板
rs.open ("select down_web from mb"),conn,1,1
pencat=""&rs("down_web")&""
rs.close
set rs_type=nothing
set rs=nothing
conn.close
set conn=nothing
pencat=replace(pencat,"T_TITLE",title)
pencat=replace(pencat,"T_LIST",ttypelist)
pencat=replace(pencat,"T_BZTOP",bztop)
pencat=replace(pencat,"T_LB",lb)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath(""&pagename&""))
fout.Write pencat
fout.close
Set fout=nothing
Set fso=nothing
else
if request("pageshu")<>"" then
response.write"成功:共生成[分类]页面<font color=""#FF0000"">"&request("pageshu")&"</font>个,总费时<font color=""#FF0000"">"&FormatNumber((timer()-request("D")),2)&"</font>秒,完成时间"&Now()&""
else
response.write"<b><font color=""#FF0000"">正在生成[分类]页(Html),请等待......</font></b><span id=showImport></span><IE:Download ID=""oDownload"" STYLE=""behavior:url(#default#download)"" />"
for i=0 to page
response.write"<script>function onDownloadDone(downDate){showImport.innerHTML=downDate}oDownload.startDownload('year_makesortall.asp?JyDownNewPage="&i&"',onDownloadDone)</script>"
next
response.write"<meta http-equiv=""refresh"" content=""0;url='year_makesortall.asp?pageshu="&page+1&"&d="&timer()&""">"
end if
end if
%></body></html>
请改以上的 下面的是个分类的代码,如何把下面的分页代码改到上面的内容里呀
--------------------------------------------------------------------------------------
<%Admin="DownMake"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_down.asp"-->
<!--#include file="pingyin.asp"-->
<!--#include file="config.asp"-->
<%
set rs=server.createobject("adodb.recordset")
rs.open ("select down_list from mb"),conn,1,1
pencat=rs("down_list")
rs.close
tid=request("tid")
currentPage=cint(request("page"))
MaxPerPage=cint(request("MaxPerPage"))
rs.open "select * from downtype where id="&tid,conn,1,1
if not rs.eof then
ts=rs("ts")
tstart=rs("tstart")
TN=split(rs("tname"),"|")
TI=split(rs("ts"), ",")
for i = 0 to ubound(TN)-1
if i=ubound(TN)-2 and ubound(TN)>1 then
TTY_id=TI(i)
TTY_name=TN(i)
end if
all_type_top_id=TI(i)
all_type_name=TN(i)
thistype=thistype & " » <a href=""../"&softlist&"/"&TI(i)&"_1"&softfile&""">"&TN(i)&"</a>"
'thistitle=thistitle & "|"&TN(i)&""
thistitle=TN(ubound(TN)-1)
next
end if
rs.close
if tstart<>"" then '***自动转向
pencat="<meta http-equiv=""Refresh"" content=""0; URL="&tstart&"""><a href="""&tstart&""">正在进入...</a>"
else '***自动转向
sqqq=sqqq&""&tid&", "
sql="select * from downtype where ts like '"&ts&"%'"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
sqqq=sqqq&""&rs("id")&", "
rs.MoveNext
loop
end if
rs.close
''########读取下级分类
rs.open "select * from downtype where tn="&tid&" order by id",conn,1,1
if NOT rs.EOF then
TTY="NO"
Tname=all_type_name
do while NOT rs.EOF
TTNN=split(rs("tname"),"|")(rs("tj")-1)
txlist=txlist&"<li><a href=""../"&softlist&"/"&rs("id")&"_1"&softfile&""">"&TTNN&"</a></li>"
rs.MoveNext
loop
end if
rs.close
if TTY_id<>"" and TTY<>"没有" then
rs.open "select * from downtype where tn="&TTY_id&" order by id",conn,1,1
if NOT rs.EOF then
Tname=TTY_name
do while NOT rs.EOF
TTNN=split(rs("tname"),"|")(rs("tj")-1)
txlist=txlist&"<li><a href=""../"&softlist&"/"&rs("id")&"_1"&softfile&""">"&TTNN&"</a></li>"
rs.MoveNext
loop
end if
rs.close
end if
''########读取本类top10
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from down where tid in ("&sqqq&") order by hits desc"
rs.open sql,conn,1,1
if rs.eof then
txtop="<li class=""n1"">No Programmes</li>"
else
do while not rs.eof
th=th+1
txtop=txtop&"<li class=""n"&th&"""><a href=""../"&softpath&"/"&c(rs("cxn"))&""&softdir&""&rs("id")&""&softfile&""">"&left(rs("cxn"),16)&"</a></li>"
if th>=10 then exit do
rs.movenext
loop
th=0
end if
rs.close
'读取软件列表
sql="select * from down where tid in ("&sqqq&") order by date desc"
rs.open sql,conn,1,1
if rs.eof then
lb=lb&"<dl class=""groupInfo clearfix"">Sorry! No Programmes</dl>"
mpage=1
allshu=0
else
rs.pagesize=MaxPerPage '得到每页数
mpage=rs.pagecount '得到总页数
rs.move (currentPage-1)*MaxPerPage
allshu=rs.recordcount
h=0
do while not rs.eof
h=h+1
lb=lb&"<dl class=""groupInfo clearfix"">"
lb=lb&"<dd><ul><li><a href=""../"&softpath&"/"&c(rs("cxn"))&""&softdir&""&rs("id")&""&softfile&"""><strong>"&rs("cxn")&"</strong></a></li>"
lb=lb&"<li>内容:"
if rs("body")<>"" then
tempstr=replace(rs("body"),"<br>","")
tempstr=replace(tempstr,"<p>","")
tempstr=replace(tempstr,"</p>","")
tempstr=replace(tempstr,"<b>","")
tempstr=replace(tempstr,"<","")
tempstr=replace(tempstr,">","")
tempstr=replace(tempstr,"/","")
tempstr=replace(tempstr," ","")
lb=lb&""&left(tempstr,300)&" ..."
else
lb=lb&"没有内容"
end if
lb=lb&"</li>"
lb=lb&"<li class=""playBtn""><a class=""play_icon"" href=""../"&softpath&"/"&c(rs("cxn"))&""&softdir&""&rs("id")&""&softfile&"""><span>play</span></a></li></ul></dd></dl>"
if h>=MaxPerPage then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
h=0
'#########读取页次
ymfl=ymfl&"Page:"¤tPage&"/"&mpage&" Channel "&allshu&" "
pageno=currentPage
if cint(pageno)>1 then
ymfl=ymfl&"<a href=""../"&softlist&"/"&tid&"_1"&softfile&""">"
end if
ymfl=ymfl&"<font face=""Webdings"">9</font></a> "
if cint(pageno)>1 then
ymfl=ymfl&"<a href=""../"&softlist&"/"&tid&"_"&pageno-1&""&softfile&""">"
end if
ymfl=ymfl&"<font face=""Webdings"">7</font></a>"
pp=cint(pageno)-2
if pp<1 then
pp=1
end if
for pno=pp to mpage
p=p+1
if pno*1=cint(pageno)*1 then
ymfl=ymfl&" <a href=""#"">["&pno&"]</a>"
else
ymfl=ymfl&" <a href="""&tid&"_"&pno&""&softfile&""">["&pno&"]</a>"
end if
if p>=6 then exit for
next
ymfl=ymfl&" "
if cint(pageno)< mpage then
ymfl=ymfl&"<a href=""../"&softlist&"/"&tid&"_"&pageno+1&""&softfile&""">"
end if
ymfl=ymfl&"<font face=""Webdings"">8</font></a> "
if cint(pageno)< mpage then
ymfl=ymfl&"<a href=""../"&softlist&"/"&tid&"_"&mpage&""&softfile&""">"
end if
ymfl=ymfl&"<font face=""Webdings"">:</font></a>"
if request("type")<>"" then
if request("page")<>"" then
page=cint(request("page"))
D=request("D")
else
page=1
D=timer()
end if
mpage=1
mpage1=1
MaxPerPage=20
id=request("id")
ts=id&","
set rs=server.createobject("adodb.recordset")
if request("type")="all" then
rs.open ("select id,ts from downtype where ts like '"&request("ts")&"%' order by id desc"),conn,1,1
if not rs.eof then
rs.pagesize=1 '得到每页数
mpage1=rs.pagecount '得到总页数
rs.move (page-1)*1
do while not rs.eof
i=i+1
id=rs("id")
ts=rs("ts")
if i>=1 then exit do
rs.movenext
loop
rs.close
end if
end if
'################ 读取完成 ################
pencat=replace(pencat,"T_TYPE",thistype)
pencat=replace(pencat,"T_TITLE",thistitle)
pencat=replace(pencat,"T_NAME",tname)
pencat=replace(pencat,"TXlist",txlist)
pencat=replace(pencat,"TXtop",txtop)
pencat=replace(pencat,"T_LB",lb)
pencat=replace(pencat,"TF_LB",ymfl)
end if
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("../"&softlist&"/"&tid&"_"¤tPage&""&softfile&""))
fout.Write pencat
fout.close
'************** 生成HTML页 结束 ***************
%>