www.gusucode.com > 星云DJ舞曲 4.5a源码程序 > admin/SpecialSort.asp

    <!--#include file="const.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>生成列表</title>
</head>
<body>
<center>
<%
'on error resume Next
Specialid =request("Specialid")
ttid=Specialid
currentPage=cint(request("page"))
MaxPerPage=cint(request("MaxPerPage"))

'位置
Set rs= server.CreateObject("ADODB.RecordSet")
Sql ="select * from Special where SpecialID="&Specialid&""
rs.open sql,conn,1,1
If rs.eof Then 
	BANNER=BANNER&"暂时没任何记录!"
Else 
	BANNER=BANNER&""&rs("name")&"-"
	TYPE1=rs("name")
End If 



'分类导航
sql="select * from Special"
set rs_item=Server.CreateObject("adodb.recordset")                  
rs_item.open sql,conn,1,1                 
if rs_item.eof Then
L_M=L_M&"<td background=""/images/dj_27.gif"" align=""center""><font color=#FF0000>暂时没有专辑!</font></td>"
Else 
Do while not rs_item.eof
L_M=L_M&"<b><a href=""/ShowDj/"&rs_item("Specialid")&"_1.html""><font color=""#ffff00"">"&rs_item("name")&"</font></a></b>&nbsp;&nbsp;&nbsp;"
rs_item.movenext
loop
End If 
rs_item.close

'Top10
T=0
Set rs= server.CreateObject("ADODB.RecordSet")
Sql="select * from MusicList where Specialid="&Specialid&" order by downhits desc"
rs.open sql,conn,1,1
If rs.eof Then 
TOP=TOP&"暂时没有记录!"
Else 
Do While Not rs.eof 
T=T+1
TOP=TOP&"<table border=0 width=100% id=table32 style=border-collapse: collapse>"
TOP=TOP&"<tr>"
TOP=TOP&"<td width=10><img border=0 src=../images/ic_num_0"&T&".gif></td>"
TOP=TOP&"<td><p align=left style=text-indent: 2px><a href=/p/"&rs("id")&".html target=97mix title='↘舞曲全称:"&rs("musicname")&"&#13;↘加入时间:"&year(rs("dateandtime"))&"年"&month(rs("dateandtime"))&"月"&day(rs("dateandtime"))&"日&#13;↘试听人气:"&rs("hits")&"&#13;↘下载人气:"&rs("downhits")&"'>"&Left(rs("musicname"),9)&"</A></td>"
TOP=TOP&"<td width=15><A href=/p/"&rs("id")&".html title=播放 target=97mix><img border=0 src=../images/player2.gif></a></td>"
TOP=TOP&"</tr></table>"
if t>=12 then exit do
rs.movenext
loop
end if
rs.close

'HOT10
H=0
Sql="select * from MusicList where Specialid="&Specialid&" order by hits desc"
rs.open sql,conn,1,1
If rs.eof Then 
HOT=HOT&"暂时没有记录!"
Else 
Do While Not rs.eof 
H=H+1
HOT=HOT&"<table border=0 width=100% id=table32 style=border-collapse: collapse>"
HOT=HOT&"<tr>"
HOT=HOT&"<td width=10><img border=0 src=../images/ic_num_0"&H&".gif></td>"
HOT=HOT&"<td><p align=left style=text-indent: 2px><a href=/play/"&rs("id")&".html target=97mix title='↘舞曲全称:"&rs("musicname")&"&#13;↘加入时间:"&year(rs("dateandtime"))&"年"&month(rs("dateandtime"))&"月"&day(rs("dateandtime"))&"日&#13;↘试听人气:"&rs("hits")&"&#13;↘下载人气:"&rs("downhits")&"'>"&Left(rs("musicname"),9)&"</A></td>"
HOT=HOT&"<td width=15><A href=/p/"&rs("id")&".html title=播放 target=97mix><img border=0 src=../images/player2.gif></a></td>"
HOT=HOT&"</tr></table>"
if h>=12 then exit do
rs.movenext
loop
end if
rs.close

'LIST
Set RS=server.CreateObject("ADODB.RecordSet")
Sql ="select * from MusicList where Specialid="&Specialid&" order by id desc"
rs.open sql,conn,1,1

'###开始分页###
const maxperpage=30	'定义分页大小
mpage=rs.pagecount    
dim currentpage
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
	if currentpage > rs.pagecount then
	currentpage=rs.pagecount
	end if
end if
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if

rs.pagesize=MaxPerPage
mpage=rs.pagecount  
rs.move(currentpage-1)*maxperpage
For i = 1 to rs.PageSize
if rs.EOF then     
Exit For 
End If
%>


<%
LIST=LIST&"<tr bgcolor=#53523E>"
LIST=LIST&"<td width=4% bgcolor=#323125 height=20><div align=center><input type='CheckBox' name='songid' value='"&rs("id")&"'></div></td>"
LIST=LIST&"<td width=48% onmouseover=this.style.background='#323125'; onmouseout =this.style.background='#53523E'; this.style.borderColor='#53523E'>&nbsp;<A href=/p/"&rs("id")&".html target=97mix title='↘舞曲全称:"&rs("musicname")&"&#13;↘加入时间:"&year(rs("dateandtime"))&"年"&month(rs("dateandtime"))&"月"&day(rs("dateandtime"))&"日&#13;↘试听人气:"&rs("hits")&"&#13;↘下载人气:"&rs("downhits")&"'>" & left(rs("musicname"),24) &"</A>"
if rs("isgood")=true then
LIST=LIST&"<A href=/shgood.asp?Classid="&request("classid")&" title='推荐舞曲'><font color=#FFFFFF> √</font></a>"
end if
LIST=LIST&"</td><td width=7% bgcolor=#323125><p align=center><font color=#727154>"&rs("id")&"</font></td>"
LIST=LIST&"<td width=7% onmouseover=this.style.background='#323125';  onmouseout=this.style.background='#53523E'; this.style.borderColor='#53523E'><p align=center>"&rs("hits")&"</td>"
LIST=LIST&"<td width=16% bgcolor=#323125><p align=center><font color=#727154>"&year(rs("dateandtime"))&"年"&month(rs("dateandtime"))&"月"&day(rs("dateandtime"))&"日</font></td>"
LIST=LIST&"<td width=5% bgcolor=#323125><p align=center><A href=/p/"&rs("id")&".html target=97mix><img border=0 src=/images/player2.gif alt=试听 width=15 height=15></a></td>"
LIST=LIST&"<td width=5% bgcolor=#323125><p align=center><a href=/user/UserCollect.asp?action=add&id="&rs("id")&" target=vip><img border=0 src=../images/box.gif alt=收藏 width=15 height=15></a></td>"
LIST=LIST&"<td width=7% align=center onmouseover=this.style.background='#323125';  onmouseout=this.style.background='#53523E'; this.style.borderColor='#53523E'><a href=""javascript:window_open('/download.asp?id="&rs("id")&"','_blank','width=299,height=320,scrollbars=0,resizable=0,')"">Rm</a><font color=#b5af84>|</font>"
if isnull(rs("DownUrl")) then
LIST=LIST&"<font color=#323125>Mp3</font>"
else
LIST=LIST&"<a href=""javascript:window_open('/download.asp?id="&rs("id")&"','_blank','width=299,height=320,scrollbars=0,resizable=0,')"">Mp3</a>"
end if
LIST=LIST&"</td></tr>"

rs.MoveNext
next
rs.close
set rs=nothing
conn.close
set conn=Nothing

%>


<% 
L_B1=L_B1&"<table border=""0"" width=""100%"" height=""30"" cellspacing=""0"" cellpadding=""0""><tr><td width=""15%"" nowrap></td><td width=""65%"" nowrap><p align=""center"">"
pageno=currentPage
if cint(pageno)>1 then
L_B1=L_B1&"<a href=../ShowDj/"&ttid&"_1.html title=""最前页"">"
end if
L_B1=L_B1&"<font face=""Webdings"">9</font></a>&nbsp;"
if cint(pageno)>1 then
L_B1=L_B1&"<a href=../ShowDj/"&ttid&"_"&pageno-1&".html title=""上一页"">"
end if
L_B1=L_B1&"<font face=""Webdings"">7</font></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
L_B1=L_B1&"&nbsp;<font color=""#b5af84"">第"&pno&"页</font>"
else
L_B1=L_B1&"&nbsp;<a href=../ShowDj/"&ttid&"_"&pno&".html>第"&pno&"页</a>"
end if                                                                        
if p>=10 then exit for            
next
L_B1=L_B1&"&nbsp;"
if cint(pageno)< mpage then
L_B1=L_B1&"<a href=../ShowDj/"&ttid&"_"&pageno+1&".html title=""下一页"">"
end if
L_B1=L_B1&"<font face=""Webdings"">8</font></a>&nbsp;"
if cint(pageno)< mpage then
L_B1=L_B1&"<a href=../ShowDj/"&ttid&"_"&mpage&".html title=""最后页"">"
end if
L_B1=L_B1&"<font face=""Webdings"">:</font></a></p></td><td width=""18%"" nowrap><table cellpadding=""0"" cellspacing=""0"">"
L_B1=L_B1&"<form onsubmit=""window.location=this.KKK2.options[this.KKK2.selectedIndex].value; return false;"">"
L_B1=L_B1&"<tr><td nowrap>&nbsp;&nbsp;<select name=""select"" onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">"
   for i=1 to mpage
      selected=""
      if currentpage=i then
          selected=" selected"
      end if
L_B1=L_B1&"<option value=../ShowDj/"&ttid&"_"&i&".html"&selected&">"&i&"</option>"
   next
L_B1=L_B1&"</select>页</td></tr></form></table></td></tr></table>"


Set fso = Server.CreateObject("Scripting.FileSystemObject")
set type_d = fso.opentextfile(server.mappath("show.html"),1,True)
pencat= type_d.ReadAll

pencat =Replace(pencat,"[%TYPE%]",TYPE1)
pencat =Replace(pencat,"[%L_M%]",L_M)
pencat =Replace(pencat,"[%CLASSID%]",BANNER)
pencat =Replace(pencat,"[%Top10%]",TOP)
pencat =Replace(pencat,"[%Hot10%]",HOT)
pencat =Replace(pencat,"[%PAGE%]",L_B1)
pencat =Replace(pencat,"[%DJLIST%]",LIST)

'response.write ""&pencat&""

Set type_x = fso.CreateTextFile(server.mappath("../ShowDj/"&ttid&"_"&currentPage&".html"))
type_x.WriteLine pencat
set fso = nothing
type_d.close
type_x.close
%>

<%
 response.write "<br>已生成/要生成专辑:<font color=#FF0000>"&currentPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
 if n=<currentPage then
 response.write "操作完成!<br><br><a href='javascript:history.back(1)'>返回</a>"
 response.end
 else
 response.write "<br>已生成/此专辑页:<font color=#FF0000>"&currentPage&"</font>/<font color=#FF0000><b>"&n&"</b></font>个,"
 response.write "<meta http-equiv=Refresh content='0; URL=SpecialSort.asp?Specialid="&Specialid&"&pageid="&currentPage+1&"'>"
end if
%>
</center>

</body>
</html>