<%
Dim TotalPages '总记录数
Dim CurrentPage
Dim MaxPerPage '每页记录数
MaxPerPage = 300
page = Request.QueryString("Page")
dim types
if trim(request("types"))="" or trim(request("types2"))="" then
types=2
types2=14
else
types=trim(request("types"))
types2=trim(request("types2"))
end if
R=trim(request("R"))
T=trim(request("T"))
set rstt=server.CreateObject("ADODB.RecordSet")
sqlt="select * from downtype where (ts like '"&types&"%' ) and tj=2 "
'response.write sqlt&" "
//response.end
rstt.open sqlt,conn,1,1
set rs=server.createobject("adodb.recordset")
if T<>"" then
sql="SELECT * from down where tid="&types2&" and show=1 order by date desc"
elseif R<>"" then
sql="SELECT * from down where tid="&types2&" order by hits desc"
else
sql="SELECT * from down where tid="&types2&" order by date desc"
end if
'response.write sql
rs.open sql,conn,1,1
%>
<%
if rs.eof then
response.write "
没有相关数据
"
else
totalPut = rs.recordcount//总页数
rs.pagesize = MaxPerPage
CurrentPage = 0
If Trim(page) <> "" then
CurrentPage = CLng(request("page"))
If CurrentPage > rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage = 1
End If
if not rs.eof then
rs.MoveFirst
totalPut = rs.recordcount
if CurrentPage<>1 then
if (CurrentPage - 1)*MaxPerPage < totalPut then
rs.move(CurrentPage - 1)*MaxPerPage
end if
end if
dim n,k
if (totalPut mod MaxPerPage)=0 then
n = totalPut \ MaxPerPage
else
n = totalPut \ MaxPerPage + 1
end if
end if
i = 0
'---------------------分页中部数字分页----------------------
Dim x
Dim Num,sb
Num=""
Num=10 '显示页数
CurrentIndex=(page\num)
if CurrentIndex=0 then
BeginPage=1
EndPage=Num
else
BeginPage=(-1)
EndPage=Num
end if
'------------------------------------------------------
'分页显示过程
sub pageshow()
if CurrentPage>1 then
Response.write " "
Response.write " "
else
Response.write ""
Response.write ""
end if
p=""
For p = BeginPage to EndPage
if CurrentIndex*num +p > n then exit for
Response.Write ""
if page-1=(CurrentIndex*Num+p-1) then
Response.Write "" & CurrentIndex*num +p & ""
else
Response.Write "" & CurrentIndex*num +p & ""
end if
Response.Write " | "
Next
if CurrentPage"
Response.write ""
Response.write ""
Response.write ""
else
Response.write ""
Response.write ""
end if
Response.write ""
end sub
//分页显示过程结束
%>
<%
types=trim(request("types"))
//response.write types
set rst=server.CreateObject("ADODB.RecordSet")
sqlt="select * from downtype where (ts like '"&types&"%' ) and tj=2 order by id desc "
//response.write sqlt
//response.end
rst.open sqlt,conn,1,1%><%do while NOT rst.EOF%>
&types2=<%=split(rst("ts"),",")(1)%>" class="chengcu_12"><%=split(rst("tname"),"|")(rst("tj")-1)%>
<%
rst.movenext
loop
rst.close:set rst=nothing
%>
<%call pageshow%>
<%
do while not rs.eof and i < MaxPerPage
i=i+1
%>
<%if i mod 2 =0 then%>