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

手机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. tt=cint(request("tt")) 
  7. v=cint(request("v")) 
  8. PicSize=cint(request("PicSize"))
  9. if PicSize="" or PicSize=0 then 
  10. PicSize=Session("PicSize")
  11. end if
  12. if v="" or v=0 then 
  13. v=Session("v")
  14. end if
  15. Session("v")=v
  16. Session("PicSize")=PicSize
  17. if PicSize="" or PicSize=0 then PicSize=1
  18. if v="" or v=0 then v=2
  19. dim rss,Page_Style,Album_Title,last_update_time
  20. set rss = server.CreateObject ("adodb.recordset")
  21. sql="select * from Album where id=" & id & " order by id desc"
  22.    set rss=getRecordSet(conn,sql,1,2)
  23. if not rss.eof and not rss.bof then
  24.    do while not rss.eof
  25. Album_ClassID=rss("Album_ClassID")
  26. last_update_time=rss("Add_Time")
  27. Album_Title=wap.filter("wml",rss("Album_Title"))
  28. rss("View_count")=rss("View_count")+1
  29. rss("last_view_time")=now
  30.      call wmlbegin(""&wap.filter("wml",rss("Album_Title"))&"","wrap")
  31. rss.movenext
  32. loop
  33. end if
  34. rss.close
  35. set rss=Nothing
  36. if View_Ad_Top<>0 then
  37.  ads(cint(View_Ad_Top))
  38. end if
  39. Page_Style=View_Page_Style
  40. '统计分析
  41. Set picture=load(id)
  42. Public Sub analyze(ByVal is_dcount)
  43. if(is_dcount) then
  44. Dim statDAO
  45. Set statDAO=new StatDAOClass
  46. Call statDAO.analyze(date,"pid",id,"view_count")
  47. Set statDAO=nothing
  48. end if
  49. Dim analysisDAO
  50. Set analysisDAO=new AnalysisDAOClass
  51. Call analysisDAO.analyze(date,"pic_view")
  52. Set analysisDAO=nothing
  53. End Sub
  54. Call analyze(picture.getIs_dcount())
  55. %><%=Album_Title%><br/>
  56. 每页显:
  57. <% if v=2 then
  58. response.write "2."
  59. else
  60. %>
  61. <a  href= "View.Asp?id=<%=id%>&amp;page=<%=page%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=2&amp;PicSize=<%=PicSize%>">2</a>.
  62. <% end if %>
  63. <% if v=4 then
  64. response.write "4."
  65. else
  66. %>
  67. <a  href= "View.Asp?id=<%=id%>&amp;page=<%=page%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=4&amp;PicSize=<%=PicSize%>">4</a>.
  68. <% end if %>
  69. <% if v=6 then
  70. response.write "6."
  71. else
  72. %>
  73. <a  href= "View.Asp?id=<%=id%>&amp;page=<%=page%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=6&amp;PicSize=<%=PicSize%>">6</a>.
  74. <% end if %>
  75. <% if v=8 then
  76. response.write "8"
  77. else
  78. %>
  79. <a  href= "View.Asp?id=<%=id%>&amp;page=<%=page%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=8&amp;PicSize=<%=PicSize%>">8</a>
  80. <% end if %>
  81. <br/>
  82. 预览大小:<% if PicSize=1 then
  83. response.write "小-"
  84. else
  85. %>
  86. <a  href= "View.Asp?id=<%=id%>&amp;page=<%=page%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=<%=v%>&amp;PicSize=1">小</a>-
  87. <% end if %>
  88. <% if PicSize=2 then
  89. response.write "中-"
  90. else
  91. %>
  92. <a  href= "View.Asp?id=<%=id%>&amp;page=<%=page%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=<%=v%>&amp;PicSize=2">中</a>-
  93. <% end if %>
  94. <% if PicSize=3 then
  95. response.write "大"
  96. else
  97. %>
  98. <a  href= "View.Asp?id=<%=id%>&amp;page=<%=page%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=<%=v%>&amp;PicSize=3">大</a>
  99. <% end if %><br/>----------<br/>
  100. <% 
  101.     sql="Select * from [Picture] where AlbumID=" & id & " order by id desc"
  102.     Set rs = Server.CreateObject("ADODB.Recordset")
  103.     rs.open sql,conn,1,1 
  104.     n=rs.RecordCount 
  105.     PageSize=v
  106.     rs.pagesize=PageSize
  107.     m=cint(rs.pagecount) 
  108.     if page="" then 
  109.     page=1 
  110.     elseif page<1 then 
  111.     page=1 
  112.     end if 
  113.     if page>m then 
  114.     page=m 
  115.     end if 
  116.     page=cint(page) 
  117.     if not rs.eof then 
  118.     rs.absolutepage=page 
  119.     end if 
  120.     
  121.     if m>page+3 then 
  122.     endpage=page+3 
  123.     else 
  124.     endpage=m 
  125.     end if 
  126.     if page>4 then 
  127.     pagetitle=pagetitle & " " & "" 
  128.     end if 
  129.     
  130.     for i=page-3 to endpage 
  131.     if not i<1 then 
  132.     if i = page then 
  133.     select case Page_Style
  134.     case 2
  135.     pagetitle=pagetitle & " " & "" & i & "" 
  136.    case 3
  137.     pagetitle=pagetitle & " " & "" & wap.corder(i) & "" 
  138.     end select
  139.     else 
  140.     select case Page_Style
  141.     case 2
  142.     pagetitle=pagetitle & " " & "<a href='View.Asp?id=" & id & "&amp;page=" & i & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "'>" & i & "</a>" 
  143.     case 3
  144.     pagetitle=pagetitle & " " & "<a href='View.Asp?id=" & id & "&amp;page=" & i & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "'>" & wap.corder(i) & "</a>" 
  145.     end select
  146.     end if 
  147.     end if 
  148.     next 
  149.     if page+3 < m then 
  150.     pagetitle=pagetitle & " " & "" 
  151.     end if 
  152.     %>
  153.     <%
  154.        i=0
  155.        j=0
  156.        Do While Not rs.Eof And i<PageSize
  157.         vv1=wap.rndc()
  158.        i = i + 1
  159.        j=j+1
  160.        dim ii, k
  161.        ii=int(rnd*100)
  162.        
  163. if wap.ftype(rs("File_Url"))="gif" then
  164. Set fso = Server.CreateObject("Scripting.FileSystemObject") 
  165. fso.copyfile server.mappath(replace(rs("File_Url"),"/","")),server.mappath("") & "imagestemp"
  166. set objfso=nothing  
  167. end if
  168. set   fso1=Server.CreateObject   ("Scripting.FileSystemObject")   
  169.     fpath=server.mappath(replace(rs("File_Url"),"/",""))   
  170.     if   fso1.FileExists(fpath)   then 
  171.  if tt=1 then
  172.  
  173. if PicSize=1 then 
  174. k="100x133"
  175.  Call (new ImageClass).zoom(rs("File_Url"),"images/temp/b"& vv1 & rs("id") &"_100x133." & wap.ftype(rs("File_Url")) & "",100,133)
  176. elseif PicSize=2 then
  177. k="176x220"
  178. Call (new ImageClass).zoom(rs("File_Url"),"images/temp/b"& vv1 & rs("id") &"_176x220." & wap.ftype(rs("File_Url")) & "",176,220)
  179.  elseif PicSize=3 then
  180. k="240x320"
  181. Call (new ImageClass).zoom(rs("File_Url"),"images/temp/b"& vv1 & rs("id") &"_240x320." & wap.ftype(rs("File_Url")) & "",240,320)
  182. end if
  183. if wap.ftype(rs("File_Url"))<>"gif" then
  184. call wmlimgl("/images/temp/b" & vv1 & rs("id") & "_" & k & "." & wap.ftype(rs("File_Url")) & "",wap.filter("wml",rs("Title")),"Download.Asp?id=" & rs("id") & "&amp;pp=" & page & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "",wap.filter("wml",rs("Title")),false)
  185.  else
  186. call wmlimgl("/images/temp/" & Split(rs("File_Url"),"/")(4) & "",wap.filter("wml",rs("Title")),"Download.Asp?id=" & rs("id") & "&amp;pp=" & page & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "",wap.filter("wml",rs("Title")),false) 
  187.  end if
  188.    else
  189. if PicSize=1 then 
  190. k="100x133"
  191.  Call (new ImageClass).zoom(rs("File_Url"),"images/temp/b"& vv1 & rs("id") &"_100x133." & wap.ftype(rs("File_Url")) & "",100,133)
  192. elseif PicSize=2 then
  193. k="176x220"
  194. Call (new ImageClass).zoom(rs("File_Url"),"images/temp/b"& vv1 & rs("id") &"_176x220." & wap.ftype(rs("File_Url")) & "",176,220)
  195. elseif PicSize=3 then
  196. k="240x320"
  197. Call (new ImageClass).zoom(rs("File_Url"),"images/temp/b"& vv1 & rs("id") &"_240x320." & wap.ftype(rs("File_Url")) & "",240,320)
  198. end if
  199. if wap.ftype(rs("File_Url"))<>"gif" then
  200. call wmlimg("/images/temp/b" & vv1 & rs("id") & "_" & k & "." & wap.ftype(rs("File_Url")) & "",wap.filter("wml",rs("Title")),true)  
  201. else
  202. call wmlimg("/images/temp/" & Split(rs("File_Url"),"/")(4) & "",wap.filter("wml",rs("Title")),true)  
  203. end if
  204. if wap.ftype(rs("File_Url"))<>"gif" then
  205. call wmllink("Downloads.Asp?id=" & rs("id") & "&amp;t=100&amp;h=133","小图",false)
  206. response.write("-")
  207. call wmllink("Downloads.Asp?id=" & rs("id") & "&amp;t=176&amp;h=220","中图",false)
  208. response.write("-")
  209. call wmllink("Downloads.Asp?id=" & rs("id") & "&amp;t=240&amp;h=320","大图",true)
  210. else
  211. call wmllink("/images/temp/" & Split(rs("File_Url"),"/")(4) & "","下载原图",true)
  212. end if
  213. 'call wmlimg(rs("File_Url"),wap.filter("wml",rs("Title")),true)
  214. call wmllink("Download.Asp?id=" & rs("id") & "&amp;pp=" & page & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "","自定义下载",true)
  215.        end if
  216.        end if
  217.      %>
  218.    
  219.      
  220.           
  221.     <% 
  222.       rs.MoveNext
  223.       loop  
  224.       
  225.       call wmlwrite("",true)
  226. select case Page_Style
  227. case 1
  228.      if page>1 then
  229.       
  230.        'response.write("<a href='Categories.Asp?id=" & id & "&amp;Page=1&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "'>&lt;&lt;</a>")
  231.           call wmllink("View.Asp?id=" & id & "&amp;Page=1&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "","&lt;&lt;",false)
  232.        end if
  233. if page="" and page=0 then page=1
  234. if page*v<rs.recordcount then
  235. 'response.write("<a href='Categories.Asp?id=" & id & "&amp;Page=" & page+1 & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "'>下页</a>")
  236. call wmllink("View.Asp?id=" & id & "&amp;Page=" & page+1 & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "","下页",false)
  237. end if
  238. if Page*v<rs.recordcount or Page>1 then response.write("(" & Page & "/" & (int((rs.recordcount-1)/v)+1) & ")")
  239. if page>1 then
  240. response.write("<a href='View.Asp?id=" & id & "&amp;Page=" & page-1 & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "'>上页</a>")
  241. end if
  242. if page*v<rs.recordcount then
  243. response.write("<a href='View.Asp?id=" & id & "&amp;Page=" & (int((rs.recordcount-1)/v)+1) & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "'>&gt;&gt;</a>")
  244. end if
  245. response.write("<br/>")
  246. %>
  247.    <% if Page*v<rs.recordcount or Page>1 then %>
  248. <input name="page" title="页码" type="text" format="*N" emptyok="true" size="3" maxlength="4" value="2"/>
  249. <anchor>跳页<go href="View.Asp?id=<%=id%>&amp;p=<%=p%>&amp;tt=<%=tt%>&amp;v=<%=v%>&amp;PicSize=<%=PicSize%>" accept-charset='utf-8'><postfield name="Page" value="$(page)"/></go></anchor><br/>
  250.     <% end if %>
  251. <%
  252.       case 2 
  253. response.write("第")
  254.       if page>1 then
  255.        
  256.         call wmllink("View.Asp?id=" & id & "&amp;Page=1","1",false)
  257.         call wmlwrite("&lt;",false)
  258.       end if
  259.        response.write(pagetitle) 
  260.        if page*v<rs.recordcount then
  261. call wmlwrite("&gt;",false)
  262.         call wmllink("View.Asp?id=" & id & "&amp;Page=" & (int((rs.recordcount-1)/v)+1) & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "","" & (int((rs.recordcount-1)/v)+1) & "",false)
  263.        end if
  264.        response.write("页<br/>")   
  265.       case 3 
  266.       response.write("第")
  267.          if page>1 then
  268.        
  269.         call wmllink("View.Asp?id=" & id & "&amp;Page=1",wap.corder("1"),false)
  270.         call wmlwrite("&lt;",false)
  271.       end if
  272.        response.write(pagetitle) 
  273.        if page*v<rs.recordcount then
  274. call wmlwrite("&gt;",false)
  275.         call wmllink("View.Asp?id=" & id & "&amp;Page=" & (int((rs.recordcount-1)/v)+1) & "&amp;p=" & p & "&amp;tt=" & tt & "&amp;v=" & v & "&amp;PicSize=" & PicSize & "","" & wap.corder((int((rs.recordcount-1)/v)+1)) & "",false)
  276.        end if   
  277. response.write("页<br/>")    
  278.        end select
  279.     %>
  280. <%
  281. set rs=conn.execute("select * from [Class] WHERE id=" & Album_ClassID & "")
  282. if not rs.eof then
  283. do while not rs.eof
  284. Class_Title=rs("Class_Title")
  285. rs.movenext
  286. loop
  287. end if
  288. Closers()
  289. call wmllink("Categories.Asp?id="& Album_ClassID &"&amp;page=" & p & "","返回上级",false)
  290. call wmlwrite("|",false)
  291. if tt<>1 then
  292. call wmllink("View.Asp?id="& id &"&amp;page=" & p & "&amp;tt=1&amp;v=" & v & "&amp;PicSize=" & PicSize & "","图片墙模式",true)
  293. else
  294. call wmllink("View.Asp?id="& id &"&amp;page=" & p & "&amp;tt=0&amp;v=" & v & "&amp;PicSize=" & PicSize & "","列表模式",true)
  295. end if
  296. call wmlimg("/images/g.gif","&lt;",false)
  297. call wmlwrite("共" & n & "张图片",true)
  298. call wmlimg("/images/time.gif","&lt;",false)
  299. 'call wmlimg("Clear_temporary_files.Asp",".",false)
  300. call wmlwrite("更新日期:" & wap.formatTime(last_update_time,8),true)
  301. set rs3=conn.execute("select top 1 * from Album where id>"& id &" order by id asc") 
  302. if not rs3.eof then
  303. call wmlimg("/images/Under.gif","&lt;",false)
  304. call wmlwrite("下一组:",false)
  305. call wmllink("View.Asp?id=" & rs3("id") & "","" & wap.filter("wml",rs3("Album_Title")) & "",true)
  306. end if
  307. set rs2=conn.execute("select top 1 * from Album where id<"& id &" order by id desc")  
  308. if not rs2.eof then
  309. call wmlimg("/images/On.gif","&gt;",false)  
  310.  
  311. call wmlwrite("上一组:",false)
  312. call wmllink("View.Asp?id=" & rs2("id") & "","" & wap.filter("wml",rs2("Album_Title")) & "",true)
  313. end if
  314. set rs=conn.execute("select top " & View_Top_download_Show_Amount & " * from [Album] WHERE Show=1 order by last_view_time desc")
  315. if not rs.eof then
  316. call wmlwrite("+热门下载+",false)
  317. call wmllink("explore.asp?action=rank&amp;datetime=Finally","更多",true)
  318. do while not rs.eof
  319. call wmllink("View.Asp?id=" & rs("id") & "","" & wap.filter("wml",rs("Album_Title")) & "",true)
  320. rs.movenext
  321. loop
  322. end if
  323. Closers()
  324. if View_Ad_Medium<>0 then
  325.  ads(cint(View_Ad_Medium))
  326. end if
  327. set rs=conn.execute("select top " & View_Latest_recommend_Show_Amount & " * from [Album] WHERE Show=1 order by newid(),last_update_time")
  328. if not rs.eof then
  329. call wmlwrite("+最新推荐+",false)
  330. call wmllink("explore.asp?action=rank&amp;datetime=new","更多",true)
  331. do while not rs.eof
  332. call wmllink("View.Asp?id=" & rs("id") & "","" & wap.filter("wml",rs("Album_Title")) & "",true)
  333. rs.movenext
  334. loop
  335. end if
  336. Closers()
  337. if View_Ad_Bottom<>0 then
  338.  ads(cint(View_Ad_Bottom))
  339. end if
  340. call wap.navs(Class_Title&",Categories.Asp?id="& Album_ClassID &"&amp;page=" & p & "|"&Album_Title&",")
  341. call wmlend
  342. %>