makesort.asp
上传用户:qyswxdl
上传日期:2013-06-01
资源大小:1373k
文件大小:9k
源码类别:

家庭/个人应用

开发平台:

ASP/ASPX

  1. <!--#include file="articleconn.asp" -->
  2. <html>
  3. <head>
  4. <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
  5. <meta name="ProgId" content="FrontPage.Editor.Document">
  6. </head>
  7. <%
  8. if session("flag")>1 then
  9. response.write "<br><p align=center>您没有操作的权限</p>"
  10. response.end
  11. end if
  12. %>
  13. <%
  14. dim rs
  15. dim sql
  16.     dim rs1
  17. dim sql1
  18.     dim moban
  19. if request("page")<>"" then
  20.       if cint(request("page"))<1 then
  21.          currentpage=1
  22.       else
  23.          currentpage=cint(request("page"))
  24.       end if
  25.          
  26.    end if
  27. set rs1 = server.CreateObject("ADODB.RecordSet")
  28.         sql1 = "select moban from moban1 where id=2 "
  29. set rs1 = conn.Execute (sql1)
  30.         moban=rs1("moban")
  31.         moban1=moban
  32. set rs=conn.execute("select * from [home]")
  33. homes=rs("homes")
  34. set rs=server.CreateObject("ADODB.RecordSet")
  35. if request("typeid")="" then
  36. response.write "请先选择类别"
  37. else
  38. set rs_sort=server.createobject("adodb.recordset")
  39. sql="select typeid,type from type where typeid="&request("typeid")&""
  40. rs_sort.open sql,conn,1,1
  41. type_name=rs_sort("type")
  42. type_id=rs_sort("typeid")
  43. rs_sort.close
  44. set rs_sort=nothing
  45. rs.open("select * from learning where typeid='"&type_name&"' order by articleid desc"),conn,1,1
  46. if rs.eof and rs.bof then
  47. body=body&"<tr><td width='100%'><p align=center>没有或没有找到任何电影</td></tr>"
  48. pagecount1=1
  49. totalnumber=0
  50. else
  51. maxperpage=12
  52. rs.pagesize=maxperpage
  53. pagecount1=rs.pagecount
  54. rs.move  (currentpage-1)*maxperpage
  55. totalnumber=rs.recordcount
  56. n=0
  57. '分页程序
  58. plist_top=plist_top&"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr><td width=""50%"" nowrap colspan=5><p align=list>&nbsp;本类<b><font color=#FF0000>"&totalnumber&"</font></b>个&nbsp;"
  59. plist_top=plist_top&"页次:<b><font color=#FF0000>"&currentpage&"</font></b>/<b>"&pagecount1&"</b> <b>"&maxperpage&"</b>个/页</p></td><td width=""50%"" nowrap><p align=right>"
  60. pageno=currentpage
  61. if cint(pageno)>1 then
  62. plist_top=plist_top&"<a class=mName href="&request("typeid")&"_1.html title=""首页"">"
  63. end if
  64. plist_top=plist_top&"首页</a>&nbsp;"
  65. if cint(pageno)>1 then
  66. plist_top=plist_top&"<a class=mName href="&request("typeid")&"_"&pageno-1&".html title=""上一页"">"
  67. end if
  68. plist_top=plist_top&"上一页</a>&nbsp;" 
  69. if cint(pageno)< pagecount1 then
  70. plist_top=plist_top&"&nbsp;<a class=mName href="&request("typeid")&"_"&pageno+1&".html title=""下一页"">"
  71. end if
  72. plist_top=plist_top&"下一页</a>&nbsp;"
  73. if cint(pageno)< pagecount1 then
  74. plist_top=plist_top&"<a class=mName href="&request("typeid")&"_"&pagecount1&".html title=""尾页"">"
  75. end if
  76. plist_top=plist_top&"尾页</a>"
  77. plist_top=plist_top&"</p></td></tr></table>"
  78. plist_bottom=plist_bottom&"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr><td width=""82%"" nowrap colspan=5><p align=left>&nbsp;本类<b>&nbsp;<font color=#FF0000>"&totalnumber&"</font></b>个&nbsp;|&nbsp;"
  79. pageno=currentpage
  80. if cint(pageno)>1 then
  81. plist_bottom=plist_bottom&"<a class=mName href="&request("typeid")&"_1.html title=""首页"">"
  82. end if
  83. plist_bottom=plist_bottom&"首页</a>&nbsp;"
  84. if cint(pageno)>1 then
  85. plist_bottom=plist_bottom&"&nbsp;<a class=mName href="&request("typeid")&"_"&pageno-1&".html title=""上一页"">"
  86. end if
  87. plist_bottom=plist_bottom&"上一页</a>&nbsp;" 
  88. if cint(pageno)< pagecount1 then
  89. plist_bottom=plist_bottom&"<a class=mName href="&request("typeid")&"_"&pageno+1&".html title=""下一页"">"
  90. end if
  91. plist_bottom=plist_bottom&"下一页</a>&nbsp;"
  92. if cint(pageno)< pagecount1 then
  93. plist_bottom=plist_bottom&"<a class=mName href="&request("typeid")&"_"&pagecount1&".html title=""尾页"">"
  94. end if
  95. plist_bottom=plist_bottom&"尾页</a>&nbsp;&nbsp;页次:<b><font color=#FF0000>"&currentpage&"</font></b>/<b>"&pagecount1&"</b> <b>"&maxperpage&"</b>个/页"
  96. plist_bottom=plist_bottom&"</p></td><td width=""18%"" nowrap>转到:<select name=""select"" size='1' style=""font-size: 9pt"" onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">"
  97.    for i=1 to pagecount1
  98.       selected=""
  99.       if currentpage=i then
  100.           selected=" selected"
  101.       end if
  102.     plist_bottom=plist_bottom&"<option value="&request("typeid")&"_"&i&".html"&selected&">第"&i&"页</option>"
  103.    next
  104. plist_bottom=plist_bottom&"</select></td></tr></table>"
  105. '主页面
  106. body=body&"<tr>"
  107. row_count=1
  108. do while not rs.eof
  109. n=n+1
  110. name=rs("typeid")
  111. total=rs.recordcount
  112. arter=rs("name")
  113. if rs("movietype")="rm" then
  114. format="<img src=../img/real.gif border=0 width=30 height=16>"
  115. elseif rs("movietype")="md" then
  116. format="<img src=../img/media.gif border=0 width=30 height=16>"
  117. elseif rs("movietype")="mov" then
  118. format="<img src=../img/lookmov.gif border=0 width=30 height=16>"
  119. end if
  120. if len(arter)>9 then arter=left(arter,9)&"..."
  121. marter=""&arter&""
  122. body=body&"<td valign=top><table width=100% border=0 bgColor=#303430 bordercolorlight=#000000 STYLE=border:#000000 3px Solid cellpadding=0>"
  123. body=body&"<tr><td width=121 rowspan=2 valign=top>"
  124. body=body&"<TABLE width=115 height=144 border=0 cellPadding=0 cellSpacing=0 background=../images/image_bg.gif>"
  125. body=body&"<TR><TD height=16 align=middle vAlign=center><img src=../images/spacer.gif width=1 height=1></TD></TR>"
  126. body=body&"<TR><TD align=center><a target=_blank href=../html/"&rs("articleid")&".html>"
  127. if rs("domurl")="" then
  128. body=body&"<img border=0 height=119 src=../images/nopic.gif width=100></a></td>"
  129. else
  130. body=body&"<img border=0 height=119 src="&rs("domurl")&" width=100></a></td>"
  131. end if
  132. body=body&"<TR><TD height=9><img src=../images/spacer.gif width=1 height=1></TD></TR></TABLE></td><td>"
  133. body=body&"<span class=3dfont2><a target=_blank class=mayi href=../html/"&rs("articleid")&".html><strong>"&left(rs("title"),10)&"</strong></a></td></tr><tr><td>"
  134. body=body&"<img src=../images/dot.gif width=15 height=15>类别:"
  135. if rs("canlook")=1 then
  136. body=body&"普通电影"
  137. elseif rs("canlook")=3 then
  138. body=body&"黄金电影" 
  139. elseif rs("canlook")=0 then
  140. body=body&"免费电影"
  141. end if
  142. body=body&"<br><img src=../images/dot.gif width=15 height=15>主演:"&left(rs("name"),6)&"<br> "
  143. body=body&"<img src=../images/dot.gif width=15 height=15>地区:"&rs("where")&"地区<br> "
  144. body=body&"<img src=../images/dot.gif width=15 height=15>上传:"&rs("dateandtime")&"<br> "
  145. body=body&"<img src=../images/dot.gif width=15 height=15>推荐:<SPAN class=xinxin>"&rs("softlevel")&"</SPAN><br>"
  146. body=body&"<img src=../images/dot.gif width=15 height=15>点播:"&rs("hits")&"</td>"
  147. body=body&"</tr><tr bgcolor=#ffffff><td colspan=2></td></tr></table></td>"
  148. if row_count mod 2 =0 then 
  149. body=body&"</tr>"
  150. end if
  151. row_count=row_count+1
  152. if n>=MaxPerPage then exit do
  153. rs.movenext
  154. loop
  155. rs.close
  156. end if
  157. set rs_top=server.createobject("adodb.recordset")
  158. sql="select top 10 * from learning where typeid='"&name&"' order by hits desc"
  159. rs_top.open sql,conn,1,1
  160. if rs_top.eof and rs_top.bof then
  161. top=top&"暂时没有电影"
  162. else
  163. top=top&"<table width=100% border=0 cellpadding=0 cellspacing=0>"
  164. do while not rs_top.eof
  165. top_n=top_n+1
  166. top=top&"<tr><td width=80% height=4>&nbsp;<A href=../html/"&rs_top("articleid")&".html class=left" 
  167. top=top&" target=_blank >"&left(rs_top("title"),10)&"</A></td><td width=20% height=4 valign=top><font class=eng_S color=#3B591B1>"&rs_top("hits")&"</font></td></tr>"
  168. rs_top.movenext
  169. if top_n>9 then exit do
  170. loop
  171. top=top&"</table>"
  172. end if
  173. rs_top.close
  174. set rs_top=nothing
  175. set rs_new=server.createobject("adodb.recordset")
  176. sql="select top 10 * from learning order by dateandtime desc"
  177. rs_new.open sql,conn,1,1
  178. if rs_new.eof and rs_new.bof then
  179. top=top&"暂时没有电影"
  180. else
  181. top_new=top_new&"<table width=100% border=0 cellpadding=0 cellspacing=0>"
  182. do while not rs_new.eof
  183. new_n=new_n+1
  184. top_new=top_new&"<tr><td width=80% height=4>"&new_n&".<A href=../html/"&rs_new("articleid")&".html " 
  185. top_new=top_new&" target=_blank class=xhx>"&left(rs_new("title"),10)&"</A></td><td width=20% height=4><font color=#999999>"&rs_new("hits")&"</font></td></tr>"
  186. rs_new.movenext
  187. if new_n>9 then exit do
  188. loop
  189. top_new=top_new&"</table>"
  190. end if
  191. rs_new.close
  192. set rs_new=nothing
  193. moban=replace(moban,"CAT",type_name)
  194. moban=replace(moban,"<!-top->",top)
  195. moban=replace(moban,"<!-new->",top_new)
  196. moban=replace(moban,"<!-homes->",homes)
  197. moban=replace(moban,"<!-sortid->",type_id)
  198. moban=replace(moban,"<!-plist_bottom->",plist_bottom)
  199. moban=replace(moban,"<!-plist_top->",plist_top)
  200. moban=replace(moban,"<!-total->",total)
  201. moban=replace(moban,"<!-body->",body)
  202. Set fso = Server.CreateObject("Scripting.FileSystemObject")
  203. Set fout = fso.CreateTextFile(server.mappath("../mlist/"&type_id&"_"&request("page")&".html"))
  204. fout.Write moban
  205. fout.close
  206. if currentpage<pagecount1 then
  207.   response.write "生成第:&nbsp;<font color=#FF0000> "&currentpage&" </font>页<br>共有<font color=#FF0000><b>"&pagecount1&"</b></font>页"
  208.   response.write "<meta http-equiv=Refresh content='0; URL=makesort.asp?typeid="&request("typeid")&"&page="&cint(currentpage+1)&"'>"
  209. end if
  210. if currentpage=pagecount1 then%>
  211. <body>
  212. <p><br>
  213. 生成<font color="#FF0000"><%=currentpage%></font>页<br>
  214. 此类共有<font color="#ff0000"><%=pagecount1%></font>页,自动关闭窗口.
  215. <script LANGUAGE="JavaScript">
  216. <!--
  217. setTimeout('window.close();', 700);
  218. // -->
  219. </script>
  220. </p>
  221. </body>
  222. <%end if
  223. rs1.close 
  224. set rs1=nothing 
  225. set rs=nothing
  226. end if
  227. conn.close
  228. set conn=nothing
  229. %></html>