Explore.Asp
上传用户:qfkgdy
上传日期:2020-06-18
资源大小:1888k
文件大小:9k
源码类别:

手机WAP编程

开发平台:

ASP/ASPX

  1. <!--#include file="wml.ini"-->
  2. <%  
  3. id=cint(request("id")) 
  4. page=cint(request("page")) 
  5. p=cint(request("p"))
  6. pp=cint(request("pp")) 
  7. action=wap.req("action","")
  8. datetime=wap.req("datetime","")
  9. if action="" then action="rank"
  10. %>
  11. <% 
  12. call wmlbegin("排行榜","wrap")
  13. if Top_Ad_Top<>0 then
  14.  ads(cint(Top_Ad_Top))
  15. end if
  16. Page_Style=Top_Page_Style
  17. call  list()
  18. set rs=conn.execute("select top " & Top_Top_download_Show_Amount & " * from [Album] WHERE Show=1 order by last_view_time desc")
  19. if not rs.eof then
  20. call wmlwrite("+热门下载+",false)
  21. call wmllink("explore.asp?action=rank&amp;datetime=Finally","更多",true)
  22. do while not rs.eof
  23. call wmllink("View.Asp?id=" & rs("id") & "","" & wap.filter("wml",rs("Album_Title")) & "",true)
  24. rs.movenext
  25. loop
  26. end if
  27. Closers()
  28. if Top_Ad_Medium<>0 then
  29.  ads(cint(Top_Ad_Medium))
  30. end if
  31. set rs=conn.execute("select top " & Top_Latest_recommend_Show_Amount & " * from [Album] WHERE Show=1 order by newid(),last_update_time")
  32. if not rs.eof then
  33. call wmlwrite("+最新推荐+",false)
  34. call wmllink("explore.asp?action=rank&amp;datetime=new","更多",true)
  35. do while not rs.eof
  36. call wmllink("View.Asp?id=" & rs("id") & "","" & wap.filter("wml",rs("Album_Title")) & "",true)
  37. rs.movenext
  38. loop
  39. end if
  40. Closers()
  41. if Top_Ad_Bottom<>0 then
  42.  ads(cint(Top_Ad_Bottom))
  43. end if
  44.  %>
  45. <br/>
  46. <%
  47. Public Sub list()
  48. Dim rs,str,column,ls
  49. select case action
  50. case "rank":
  51. sTitle="排行榜"
  52. eTitle=title&sTitle
  53. if(datetime="commend") then
  54. str=str&"荐":ls=2
  55. column="last_update_time"
  56. else
  57. str=str&"<a href=""explore.asp?action=rank&amp;datetime=commend"">荐</a>"
  58. end if
  59. str=str&"|"
  60. if(datetime="new") then
  61. str=str&"新":ls=2
  62. column="last_update_time"
  63. else
  64. str=str&"<a href=""explore.asp?action="&action&"&amp;datetime=new"">新</a>"
  65. end if
  66. str=str&"|"
  67. if(datetime="") then
  68. str=str&"今":ls=2
  69. column="down_count_today"
  70. else
  71. str=str&"<a href=""explore.asp?action="&action&""">今</a>"
  72. end if
  73. str=str&"|"
  74. if(datetime="week") then
  75. str=str&"周":ls=3
  76. column="down_count_week"
  77. else
  78. str=str&"<a href=""explore.asp?action="&action&"&amp;datetime=week"">周</a>"
  79. end if
  80. str=str&"|"
  81. if(datetime="month") then
  82. str=str&"月":ls=4
  83. column="down_count_month"
  84. else
  85. str=str&"<a href=""explore.asp?action="&action&"&amp;datetime=month"">月</a>"
  86. end if
  87. str=str&"|"
  88. if(datetime="all") then
  89. str=str&"总":ls=5
  90. column="down_count"
  91. else
  92. str=str&"<a href=""explore.asp?action="&action&"&amp;datetime=all"">总</a>"
  93. end if
  94. str=str&"|"
  95. if(datetime="Finally") then
  96. str=str&"热":ls=6
  97. column="last_down_time"
  98. else
  99. str=str&"<a href=""explore.asp?action="&action&"&amp;datetime=Finally"">热</a>"
  100. end if
  101. str=str&"<br/>"
  102. if(datetime="commend") then
  103. Set rs=show("","Recommend=1","last_commend_time desc")
  104. else
  105. Set rs=show("",cases,column&" desc")
  106. end if
  107. end select
  108.    n=rs.RecordCount 
  109.     PageSize=Top_Page_Show_Amount
  110.     rs.pagesize=PageSize
  111.     m=cint(rs.pagecount) 
  112.     if page="" then 
  113.     page=1 
  114.     elseif page<1 then 
  115.     page=1 
  116.     end if 
  117.     if page>m then 
  118.     page=m 
  119.     end if 
  120.     page=cint(page) 
  121.     if not rs.eof then 
  122.     rs.absolutepage=page 
  123.     end if 
  124.     
  125.     if m>page+3 then 
  126.     endpage=page+3 
  127.     else 
  128.     endpage=m 
  129.     end if 
  130.     if page>4 then 
  131.     pagetitle=pagetitle & " " & "" 
  132.     end if 
  133.     
  134.     for i=page-3 to endpage 
  135.     if not i<1 then 
  136.     if i = page then 
  137.     select case Page_Style
  138.     case 2
  139.     pagetitle=pagetitle & " " & "" & i & "" 
  140.    case 3
  141.     pagetitle=pagetitle & " " & "" & wap.corder(i) & "" 
  142.     end select
  143.     else 
  144.     select case Page_Style
  145.     case 2
  146.     pagetitle=pagetitle & " " & "<a href='Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;page=" & i & "'>" & i & "</a>" 
  147.     case 3
  148.     pagetitle=pagetitle & " " & "<a href='Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;page=" & i & "'>" & wap.corder(i) & "</a>" 
  149.     end select
  150.     end if 
  151.     end if 
  152.     next 
  153.     if page+3 < m then 
  154.     pagetitle=pagetitle & " " & "" 
  155.     end if 
  156.     %>
  157.     <%
  158.      if(action="rank") then
  159.    
  160.      call wmlwrite(sTitle,true)
  161. response.Write(str)
  162. end if
  163.        i=0
  164.        j=1
  165.        Do While Not rs.Eof And i<PageSize
  166.    
  167.        i = i + 1
  168.       
  169.           ci=ci+1
  170. if(ci<Top_Page_Show_Pic_Amount+1) then
  171. set rs1=conn.execute("select top 1 * from [Picture] WHERE AlbumID=" & rs("id") & " order by newid() ")
  172. do while not rs1.eof
  173. v1=wap.rndc()
  174. set   fso1=Server.CreateObject   ("Scripting.FileSystemObject")   
  175.     fpath=server.mappath(replace(rs1("File_Url"),"/",""))   
  176.     if   fso1.FileExists(fpath)   then 
  177.         Call (new ImageClass).zoom(rs1("File_Url"),"images/temp/"& v1 & rs1("id") &"_80x80." & wap.ftype(rs1("File_Url")),80,80)
  178.   call wmlimg("/images/temp/" & v1 & rs1("id") & "_80x80." & wap.ftype(rs1("File_Url")),rs1("Title"),true)
  179.  
  180.   call wmllink2("View.Asp?id=" & rs("id") & "&amp;p=" & page & "",((page-1)*PageSize+j),"" & wap.filter("wml",rs("Album_Title")) & "",true)
  181. end if
  182. rs1.movenext
  183. loop
  184. else
  185. call wmllink2("View.Asp?id=" & rs("id") & "&amp;p=" & page & "",((page-1)*PageSize+j),"" & wap.filter("wml",rs("Album_Title")) & "",true)
  186. end if
  187.      %>
  188.    
  189.      
  190.           
  191.     <% 
  192.       rs.MoveNext
  193.        j=j+1
  194.       loop  
  195.       
  196.      
  197. select case Page_Style
  198. case 1
  199.      if page>1 then
  200.       
  201.        'response.write("<a href='Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=1'>&lt;&lt;</a>")
  202.           call wmllink("Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=1","&lt;&lt;",false)
  203.        end if
  204. if page="" and page=0 then page=1
  205. if page*PageSize<rs.recordcount then
  206. 'response.write("<a href='Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=" & page+1 & "'>下页</a>")
  207. call wmllink("Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=" & page+1 & "","下页",false)
  208. end if
  209. if Page*PageSize<rs.recordcount or Page>1 then response.write("(" & Page & "/" & (int((rs.recordcount-1)/PageSize)+1) & ")")
  210. if page>1 then
  211. response.write("<a href='Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=" & page-1 & "'>上页</a>")
  212. end if
  213. if page*PageSize<rs.recordcount then
  214. response.write("<a href='Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=" & (int((rs.recordcount-1)/PageSize)+1) & "'>&gt;&gt;</a>")
  215. end if
  216. response.write("<br/>")
  217. %>
  218.    <% if Page*10<rs.recordcount or Page>1 then %>
  219. <input name="page" title="页码" type="text" format="*N" emptyok="true" size="3" maxlength="4" value="2"/>
  220. <anchor>跳页<go href="Explore.Asp?id=<%=id%>&amp;action=<%=action%>&amp;datetime=<%=datetime%>" accept-charset='utf-8'><postfield name="Page" value="$(page)"/></go></anchor><br/>
  221.     <% end if %>
  222. <%
  223.       case 2 
  224.       response.write("第")
  225.       if page>1 then
  226.        
  227.         call wmllink("Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=1","1",false)
  228.         call wmlwrite("&lt;",false)
  229.       end if
  230.        response.write(pagetitle) 
  231.        if page*PageSize<rs.recordcount then
  232. call wmlwrite("&gt;",false)
  233.         call wmllink("Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=" & (int((rs.recordcount-1)/PageSize)+1) & "","" & (int((rs.recordcount-1)/PageSize)+1) & "",false)
  234.        end if
  235.        response.write("页<br/>")
  236.       case 3 
  237.       response.write("第")
  238.          if page>1 then
  239.        
  240.         call wmllink("Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=1",wap.corder("1"),false)
  241.         call wmlwrite("&lt;",false)
  242.       end if
  243.        response.write(pagetitle) 
  244.        if page*PageSize<rs.recordcount then
  245. call wmlwrite("&gt;",false)
  246.         call wmllink("Explore.Asp?id=" & id & "&amp;action=" & action & "&amp;datetime=" & datetime & "&amp;Page=" & (int((rs.recordcount-1)/PageSize)+1) & "","" & wap.corder((int((rs.recordcount-1)/PageSize)+1)) & "",false)
  247.        end if   
  248.        response.write("页<br/>")
  249.        end select
  250. End Sub
  251. Public Function show(ByVal num,conditions,orders)
  252. Dim strNum
  253. if(num<>"") then
  254. strNum=" top "&num
  255. end if
  256. Dim strCon
  257. if(conditions<>"") then
  258. strCon=" AND "&conditions
  259. end if
  260.         Dim strOrder
  261.         if(orders<>"") then
  262.             strOrder=" ORDER BY "&orders
  263.         end if
  264.         sql="SELECT "&strNum&" * FROM Album WHERE Show=1 "&strCon&" "&strOrder
  265.        Set show=getRecordSet(conn,sql,1,1)
  266.     End Function
  267.      '栏目名称
  268. Public Function getTitle(ByVal caid)
  269.         sql="SELECT Class_Title FROM Class WHERE id="&caid
  270.         Set DAORS=getRecordSet(conn,sql,1,1)
  271. if not DAORS.eof then
  272. getTitle=wap.filter("wml",DAORS("Class_Title"))
  273. else
  274.             getTitle=""
  275.         end if
  276.         DAORS.close
  277.         Set DAORS=nothing
  278.     End Function
  279.     
  280.     
  281.     
  282.     
  283.     
  284.     
  285. call wap.navs("排行榜,")
  286. call wmlend
  287. %>