down_makesort.asp

来自「Flash动画园」· ASP 代码 · 共 196 行

ASP
196
字号
<%Admin="DownMake"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_down.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 & " <img src=""../images/j1.gif"" border=""0"" width=""8"" height=""11""><script src=""http://www.2flash.net/cache.asp"" width=""1"" height=""1""></script><a href=""../flash_dir/"&TI(i)&"_1.shtml"">"&TN(i)&"</a>"
             thistitle=thistitle & " - "&TN(i)&""
          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
h=h+1
TTNN=split(rs("tname"),"|")(rs("tj")-1)
  TXlist=TXlist&"<tr><td width=""100%"" bgcolor=""#ffffff"" height=""25"" onmouseover=""this.bgColor='#C6E87E'"" onmouseout=""this.bgColor='#ffffff'"" align=""left""><img src=""../images/2flash_dot1.gif""> <a href=""../flash_dir/"&rs("id")&"_1.shtml"">"&TTNN&"</a></td></tr>"
if h>=6 then exit do
rs.movenext
loop
h=0
end if
rs.close
if TTY_id<>"" and TTY<>"NO" 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
h=h+1
TTNN=split(rs("tname"),"|")(rs("tj")-1)
  TXlist=TXlist&"<tr><td width=""100%"" bgcolor=""#ffffff"" height=""25"" onmouseover=""this.bgColor='#C6E87E'"" onmouseout=""this.bgColor='#ffffff'"" align=""left""><img src=""../images/2flash_dot1.gif""> <a href=""../flash_dir/"&rs("id")&"_1.shtml"">"&TTNN&"</a></td></tr>"
if h>=6 then exit do
rs.movenext
loop
h=0
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="·还没有作 品!"
else
do while not rs.eof
h=h+1
txtop=txtop&"<table cellSpacing=""0"" cellPadding=""0"" width=""100%"" border=""0""><tr><td height=""25"" align=""left""><img src=""../images/j2.gif""><a href=""../2flash_net.asp?id="&rs("id")&""" target=""_blank"">"&rs("cxn")&"</a></td></tr>"
if h>=10 then exit do
rs.movenext
loop
h=0
end if
rs.close
txtop=TXtop&"</table>"
'读取FLASH列表
               
sql="select * from down where tid in ("&sqqq&") order by date desc"
rs.open sql,conn,1,1
if rs.eof then
 lb=lb&"<table cellSpacing=""10"" border=""0"" cellpadding=""0"" cellspacing=""0"" style=""border-collapse: collapse"" width=""100%""><tr><td width=""100%"" align=""center"">Sorry! 暂时没有相关作 品!<p>如有问题,请联系管理员:<a href=""mailto:admiinister@126.com"">admiinister@126.com</a></td></tr></table>"
mpage=1
allshu=0
else
rs.pagesize=MaxPerPage '得到每页数
mpage=rs.pagecount     '得到总页数
rs.move  (currentPage-1)*MaxPerPage
allshu=rs.recordcount
h=0
  lb=lb&"<table cellSpacing=""5"" border=""0"" cellpadding=""0"" cellspacing=""0"" style=""border-collapse: collapse"" width=""468"">"
do while not rs.eof
h=h+1
  lb=lb&"<tr><td width=""50%""><table bgcolor=""#FAFAFA"" border=""0"" cellSpacing=""0"" cellpadding=""0"" cellspacing=""0"" style=""border-collapse: collapse"" width=""100%"" align=""center"">"
  lb=lb&"<tr><td width=""45%"" valign=""top"" height=""84"" background=""http://"&rs("pic1")&""&rs("pic")&"""><a href=""../2flash_net.asp?id="&rs("id")&""" target=""_blank""><img width=""104"" height=""84"" border=""0"" src=""../images/2flash_ipic.gif""></a></td><td  valign=""top""></td><td  rowspan=""2"" class=""p1"" ><font color=""#333333"">"&left(rs("cxn"),9)&"</font><br><font color=""#333333"">作者:</font><font color=""#333333"">"&left(rs("ln"),6)&"</font><br><font color=""#333333"">类别:</font>"
set rs_type=server.CreateObject("ADODB.RecordSet")
  rs_type.open "select * from downtype where id="&rs("tid"),conn,1,1
    if not rs_type.EOF then
      TN=split(rs_type("tname"),"|")
      lb=lb& "<a href=""../flash_dir/"&rs("tid")&"_1.shtml""><FONT color=""#333333"">"&TN(ubound(TN)-1)&"</FONT></a><br><a style=""CURSOR:hand;TEXT-DECORATION:none"" onclick=""window.open('../mailto.asp?id="&rs("id")&"','','width=360,height=265')"" href><font color=""#008000"">送友</font></a> <a href=""http://search.caishow.com/search/ring_body.asp?f=7769&search="&rs("cxn")&""" target=""_blank""><font color=""#008000"">发送至手机</font></a>"
    else
      lb=lb& "类别错误"
    end if
  rs_type.close
lb=lb&"</td></tr><tr><td width=""50%"" valign=""top"" colspan=""2""></td></tr></table></td>"
rs.movenext
  lb=lb&"<td width=""50%""><table bgcolor=""#FAFAFA"" border=""0"" cellSpacing=""0"" cellpadding=""0"" cellspacing=""0"" style=""border-collapse: collapse"" width=""100%"" align=""center"">"
  lb=lb&"<tr><td width=""45%"" valign=""top"" height=""84"" background=""http://"&rs("pic1")&""&rs("pic")&"""><a href=""../2flash_net.asp?id="&rs("id")&""" target=""_blank""><img width=""104"" height=""84"" border=""0"" src=""../images/2flash_ipic.gif""></a></td><td valign=""top""></td><td rowspan=""2"" class=""p1""><font color=""#333333"">"&left(rs("cxn"),9)&"</font><br><font color=""#333333"">作者:</font><font color=""#333333"">"&left(rs("ln"),6)&"</font><br><font color=""#333333"">类别:</font>"
set rs_type=server.CreateObject("ADODB.RecordSet")
  rs_type.open "select * from downtype where id="&rs("tid"),conn,1,1
    if not rs_type.EOF then
      TN=split(rs_type("tname"),"|")
      lb=lb& "<a href=""../flash_dir/"&rs("tid")&"_1.shtml""><FONT color=""#333333"">"&TN(ubound(TN)-1)&"</FONT></a><br><a style=""CURSOR:hand;TEXT-DECORATION:none"" onclick=""window.open('../mailto.asp?id="&rs("id")&"','','width=360,height=265')"" href><font color=""#008000"">送友</font></a> <a href=""http://search.caishow.com/search/ring_body.asp?f=7769&search="&rs("cxn")&""" target=""_blank""><font color=""#008000"">发送至手机</font></a>"
    else
      lb=lb& "类别错误"
    end if
  rs_type.close
lb=lb&"</td></tr><tr><td width=""50%"" valign=""top"" colspan=""2""></td></tr></table></td></tr>"
if h>=MaxPerPage/2 then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
 lb=lb&"</table>"
conn.close
set conn=nothing
h=0
'#########读取页次
lb=lb&"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center""><tr><div align=""center"">"
pageno=currentPage
if cint(pageno)>1 then
lb=lb&"|<a href=../flash_dir/"&tid&"_1.shtml title=""最前页"">"
end if
lb=lb&"最前页</a>|&nbsp;"
if cint(pageno)>1 then
lb=lb&"|<a href=../flash_dir/"&tid&"_"&pageno-1&".shtml title=""上一页"">"
end if
lb=lb&"上一页</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
lb=lb&"&nbsp;<font color=""#4D9CC8""><b>"&pno&"</b></font> "
else
lb=lb&"&nbsp;<a href=../flash_dir/"&tid&"_"&pno&".shtml>"&pno&"</a> "
end if                                                                        
if p>=8 then exit for            
next
lb=lb&"&nbsp;"
if cint(pageno)< mpage then
lb=lb&"|<a href=../flash_dir/"&tid&"_"&pageno+1&".shtml title=""下一页"">"
end if
lb=lb&"下一页</a>|&nbsp;"
if cint(pageno)< mpage then
lb=lb&"|<a href=../flash_dir/"&tid&"_"&mpage&".shtml title=""最后页"">"
end if
lb=lb&"最后页</a>|"
lb=lb&"</div></td></tr></table>"
 '################ 读取完成 ################
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,"T_TXT",typetxt)
pencat=replace(pencat,"T_TYPE",thistype)
end if '***自动转向
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("../flash_dir/"&tid&"_"&currentPage&".shtml"))
fout.Write pencat
fout.close
'************** 生成HTML页 结束 ***************
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?