<%
if guestdj<>"yes" and UserLogined<>True then
call guesterror()
response.end
end if

dim dj_id,djcat_id,Specialid
dim founderr,errmsg,Rshxcms

if request.querystring("dj_id")<>"" then
    if not isInteger(request.querystring("dj_id")) then
    Response.Redirect "show_error.asp?eid=传值参数非法!"
    Response.End
    end if
	dj_id=CLng(request("dj_id"))
else
	dj_id=0
end if

if request.querystring("djcat_id")<>"" then
  if not isInteger(request.querystring("djcat_id")) then
    Response.Redirect "show_error.asp?eid=传值参数非法!"
    Response.End
  end if
  djcat_id=CLng(request("djcat_id"))
else
  djcat_id=0
end if

if request.querystring("Specialid")<>"" then
  if not isInteger(request.querystring("Specialid")) then
    Response.Redirect "show_error.asp?eid=传值参数非法!"
    Response.End
  end if
  Specialid=CLng(request("Specialid"))
else
  Specialid=0
end if

if dj_id>0 then
   sql="select * from dj where dj_id="&dj_id
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,3
	if rs.bof and rs.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>你要找的音乐不存在，或者已经被管理员删除！</li>"
	else	
		if rs("Passed")=1 then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>你要找的音乐尚未被管理员审核！</li>"
		else
			start="音乐视听 - "&rs("dj_name")&""
                        djcat_id=CLng(rs("djcat_id"))
                        rs("dj_count")=rs("dj_count")+1
			rs.update
		end if
	end if
end if

if Specialid>0 then
   sql="select * from djspecial where Specialid="&Specialid
   set rszj=server.createobject("adodb.recordset")
   rszj.open sql,conn,1,3
	if rszj.bof and rszj.eof then
		FoundErr=True
		ErrMsg=ErrMsg & "<br><li>你要找的专集不存在，或者已经被管理员删除！</li>"
	else	
		start="专集试听 - "&rszj("name")&""
                djcat_id=rszj("ClassID")
                zjpic=rszj("pic")
                zjname=rszj("name")
                zjuser=rszj("zjuser")
                zjhits=rszj("hits")
                zjYuyan=rszj("Yuyan")
                zjGongsi=rszj("Gongsi")
                zjtime=rszj("dateandtime")
                zjintro=rszj("intro")
                rszj("hits")=rszj("hits")+1
		rszj.update
		rszj.close
                set rszj=nothing
	end if
end if

'=================================================
if FoundErr=True then
	Call HxErrMsg()
	response.end
end if
'=================================================
'过程名：error_dj
'作  用：音乐连接错误报告
'参  数：无
'=================================================
if request.querystring("action")="djerror" then
	Call error_dj()
	response.end
end if
'=================================================
sub error_dj()
sql="UPDATE dj SET error = error + 1 where dj_id="&rs("dj_id")
conn.execute(sql)
rs.close
set rs=nothing
Response.write "<script language = 'javascript'>alert('感谢你向我们报告了错误,我们会尽快恢复歌曲连接!');</script>"
Response.write "<p align=""center"" height=""100"" style=""font-size:14px;color:#ff0000;"">错误报告已经发出，谢谢你的支持！<BR><BR><a href=""index.asp""> << 返回首页</a></p>"
end sub

'=================================================
'过程名：main_dj
'作  用：显示音乐位置导航
'参  数：无
'=================================================
sub main_dj()
if djcat_id>0 then
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='music.asp'>铃声音乐</a>" & vbCrLf
  sql="select * from djcat where djcat_id="&djcat_id
  set rs3=conn.execute(sql)
  if rs3.eof then
  Response.Redirect "show_error.asp?eid=参数错误，找不到相关的记录!"
  Response.End
  End IF
  if rs3("sid")<>"0" then
     sql="select * from djcat where djcat_id="&rs3("sid")
     set rs4=conn.execute(sql)
     Response.Write " >> <a href=""dj.asp?djcat_id="&rs4("djcat_id")&""">"&rs4("djcat_name")&"</a>" 
     rs4.close
     set rs4=nothing
  end if
  Response.Write " >> <a href=""dj.asp?djcat_id="&rs3("djcat_id")&""">"&rs3("djcat_name")&"</a>" 
  rs3.close
  set rs3=nothing 
else
  Response.Write "您的位置： <a href='index.asp'>"&webname&"</a> >> <a href='dj.asp'>铃声音乐</a>" & vbCrLf
end if
end sub

'=================================================
'过程名：top_dj
'作  用：热门单曲排行
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub top_dj(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set Rshxcms=server.createobject("adodb.recordset")
set Rshxcms=conn.execute("SELECT top "&n&" * FROM dj where passed=0 ORDER by dj_count DESC,dj_id DESC")
do while not Rshxcms.eof
Response.Write "<tr><td height=22 class=table-xia>&nbsp;<font color=#FF0000>·</font><a href='showdj.asp?dj_id="&Rshxcms("dj_id")&"' Title='歌曲名称："&Rshxcms("dj_name")&"&#13&#10视听次数："&Rshxcms("dj_count")&"&#13&#10上传时间："&Rshxcms("dj_date")&"' "& nnn &">"&gotTopic(Rshxcms("dj_name"),nn)&"</a></td><td height=22 class=table-xia align=right><a href='djplaylist.asp?checked="&Rshxcms("dj_id")&"&player=+' onclick=""HxWindow(this.href,'dj','350','260','no','no','center');return false"" Title='点击单首弹窗试听'><img border='0' src='img/play_dj/bt_play.gif' width='14' height='14'></a>&nbsp;</td></tr>" & vbCrLf
Rshxcms.movenext
loop
if Rshxcms.bof and Rshxcms.eof then
Response.Write "<tr><td align='center' valign='middle'>当前没有音乐！</td></tr>"
end if
Rshxcms.close
set Rshxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub


'=================================================
'过程名：topzj_dj
'作  用：热门专集排行
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub topzj_dj(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set rszj=server.createobject("adodb.recordset")
set rszj=conn.execute("SELECT top "&n&" * FROM djspecial ORDER by hits DESC,SpecialID DESC")
do while not rszj.eof
Response.Write "<tr><td height=22 class=table-xia>&nbsp;<font color=#FF0000>·</font><a href='Showdj_Special.asp?Specialid="&rszj("SpecialID")&"' Title='专集名称："&rszj("name")&"&#13&#10视听次数："&rszj("hits")&"&#13&#10上传时间："&rszj("dateandtime")&"' "& nnn &">"&gotTopic(rszj("name"),nn)&"</a></td></tr>" & vbCrLf
rszj.movenext
loop
if rszj.bof and rszj.eof then
Response.Write "<tr><td align='center' valign='middle'>当前没有专集！</td></tr>"
end if
rszj.close
set rszj=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：best_dj
'作  用：推荐歌曲
'参  数：n-调用条数,nn-显示长度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub best_dj(n,nn,NewWindows)
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
Response.Write "<TABLE width='100%' cellSpacing=0 cellPadding=0 border=0 align='center'>" & vbCrLf
set Rshxcms=server.createobject("adodb.recordset")
set Rshxcms=conn.execute("SELECT top "&n&" * FROM dj where isbest = 1 order by dj_id desc")
do while not Rshxcms.eof
Response.Write "<tr><td height=22 class=table-xia>&nbsp;<font color=#FF0000>·</font><a href='showdj.asp?dj_id="&Rshxcms("dj_id")&"' Title='歌曲名称："&Rshxcms("dj_name")&"&#13&#10视听次数："&Rshxcms("dj_count")&"&#13&#10上传时间："&Rshxcms("dj_date")&"' "& nnn &">"&gotTopic(Rshxcms("dj_name"),nn)&"</a></td><td height=22 class=table-xia align=right><a href='djplaylist.asp?checked="&Rshxcms("dj_id")&"&player=+' onclick=""HxWindow(this.href,'dj','350','260','no','no','center');return false"" Title='点击单首弹窗试听'><img border='0' src='img/play_dj/bt_play.gif' width='14' height='14'></a>&nbsp;</td></tr>" & vbCrLf
Rshxcms.movenext
loop
if Rshxcms.bof and Rshxcms.eof then
Response.Write "<tr><td align='center' valign='middle'>没有推荐音乐！</td></tr>"
end if
Rshxcms.close
set Rshxcms=nothing
Response.Write "</TABLE>" & vbCrLf
end sub

'=================================================
'过程名：djtop_dj
'作  用：音乐单曲调用
'参  数：num-------------调用条数
'参  数：classid------------一级分类调用id，0为全部
'参  数：orders------------调用方式，0为最新歌曲，1为热门歌曲，2为推荐歌曲，3为固顶歌曲,4为下载最多的歌曲
'        fontnum---------标题长度
'=================================================
sub djtop_dj(num,classid,orders,fontnum)
Response.Write "<TABLE width='95%' cellSpacing=0 cellPadding=0 align=center border=0>" & vbCrLf
Response.Write "<form name='form' onsubmit='return lbsong();' target='lbsong' action='djplaylist.asp'>"
dim orders1
if orders=0 then
orders1="dj_id DESC"
elseif orders=1 then
orders1="dj_count desc,dj_id DESC"
elseif orders=2 then
orders1="isbest desc,dj_id desc"
elseif orders=3 then
orders1="istop desc,dj_id desc"
elseif orders=4 then
orders1="dj_dcount desc,dj_id desc"
end if
if classid=0 then
   sql="select top "&num&" * from dj where passed=0 order by "&orders1&""
else
   sql="select top "&num&" * from dj where passed=0 and (djcat_id="&classid&" or djcat_id in(select djcat_id from djcat where sid="&classid&")) order by "&orders1&""   
end if 
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
Response.Write "<tr><td height=22 class=table-xia><font color=#FF0000>·<a href='showdj.asp?dj_id="&rs("dj_id")&"' Title='音乐名称："&rs("dj_name")&"&#13&#10视听次数："&rs("dj_count")&"&#13&#10上传时间："&rs("dj_date")&"'>"&gotTopic(rs("dj_name"),fontnum)&"</a></TD>" & vbCrLf
Response.Write "<TD class=table-xia align=center width='8%'><input type='checkbox' name='checked' value='"&rs("dj_id")&"'></TD></TR>" & vbCrLf
rs.movenext
loop
if rs.eof and rs.bof then
   Response.Write "<TR><TD>暂时没有音乐</TD></TR>"
end if
Response.Write "<TR><TD colspan=7 align=Center height='26'><div align='center'>"
Response.Write "<input type='button' name='chkall' value='' onclick=""CheckAll(this.form)"" title=""选择显示的所有歌曲"" style=""width: 62px; height: 23px; background-image: url('img/ly1.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf         
Response.Write "<input type='button' name='chkOthers' value='' onclick=""CheckOthers(this.form)"" title=""反向选择歌曲"" style=""width: 62px; height: 23px; background-image: url('img/ly2.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf
Response.Write "<input type='submit' name='player' value='' title=""请先选择你想听的音乐后再点击播放"" style=""width: 62px; height: 23px; background-image: url('img/ly3.gif'); border-style: none; border-width: medium"">" & vbCrLf
Response.Write "</div></TD></TR></form>" & vbCrLf
Response.Write(MultiPages)
Response.Write "</table>" & vbCrLf
rscat.close
set rscat=nothing
rs.close
set rs=nothing
end sub


'=================================================
'过程名：bestzj_dj
'作  用：音乐专集调用
'参  数：num-------------调用条数
'        fontnum---------标题长度
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub bestzj_dj(num,fontnum,ImgWidth,ImgHeight,NewWindows)
Response.Write "<TABLE width='100%' cellSpacing=2 cellPadding=0 align=center border=0><TR>" & vbCrLf
set rszj=conn.execute("SELECT top "&num&" * FROM djSpecial order by Specialid desc") 
if rszj.EOF then
	Response.Write "<TD align=center>暂无专集</TD>"
else
	do while not rszj.eof
dim nnn
if NewWindows=True then
        nnn="target='_blank'"
else
        nnn=""				
end if 
Response.Write "<TD>"
Response.Write "<table border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='#C5C5C5'>"
Response.Write "<tr><td align='center' bgcolor='#FFFFFF'><a href='Showdj_Special.asp?Specialid="&rszj("SpecialID")&"' title='最新专辑："&rszj("name")&"' "& nnn &"><img src="&rszj("pic")&" width='"&ImgWidth&"' height='"&ImgHeight&"' border=0 alt='最新专辑："&rszj("name")&"'></a></TD></TR>" & vbCrLf
Response.Write "</table><table border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
Response.Write "<tr><td align='center'><a href='Showdj_Special.asp?Specialid="&rszj("SpecialID")&"' title='最新专辑："&rszj("name")&"' "& nnn &">"&gotTopic(rszj("name"),fontnum)&"</a></TD></TR>" & vbCrLf
Response.Write "</table></TD>" & vbCrLf
i=i+1
if i mod 5 = 0 then
Response.Write "</tr>"
end if
rszj.movenext
loop
end if
rszj.close
Response.Write "</TR></TABLE>" & vbCrLf
end sub

'=================================================
'过程名：class_dj
'作  用：歌曲分类——纵排
'参  数：无
'=================================================
sub class_dj()
sql="select * from djcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
if request("djcat_id")=cstr(rs1("djcat_id")) then
response.write "&nbsp;&nbsp;<font color=""#FF0000"">·"&rs1("djcat_name")&"</a></font><BR>"
else
response.write "&nbsp;&nbsp;<a href='dj.asp?djcat_id="&rs1("djcat_id")&"'>·"&rs1("djcat_name")&"</a><BR>"
end if
sql="select * from djcat where sid="&rs1("djcat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
if request("djcat_id")=cstr(rs2("djcat_id")) then
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=""#FF0000"">├ "&rs2("djcat_name")&"</a></font><BR>"
else
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='dj.asp?djcat_id="&rs2("djcat_id")&"'>├ "&rs2("djcat_name")&"</a><BR>"
end if
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub

'=================================================
'过程名：class1_dj
'作  用：歌曲分类——横排
'参  数：无
'=================================================
sub class1_dj(n)
sql="select top "&n& " * from djcat where sid=0"
set rs1=conn.execute(sql)
do while not rs1.eof
if request("djcat_id")=cstr(rs1("djcat_id")) then
response.write "<font color=""#FF0000""></font>"
else
response.write "<a href='dj.asp?djcat_id="&rs1("djcat_id")&"'></a>"
end if
sql="select top "&n& " * from djcat where sid="&rs1("djcat_id") 
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
if request("djcat_id")=cstr(rs2("djcat_id")) then
response.write "&nbsp;<font color=""#FF0000"">·"&rs2("djcat_name")&"</font>"
else
response.write "&nbsp;·<a href='dj.asp?djcat_id="&rs2("djcat_id")&"'>"&rs2("djcat_name")&"</a>"
end if
rs2.movenext
loop
rs1.movenext
loop
rs2.close
set rs2=nothing
rs1.close
set rs1=nothing
end sub

'=================================================
'过程名：search_dj
'作  用：显示音乐搜索表单
'参  数：无
'=================================================
sub search_dj()
Response.Write "<form name='form2' method='post' action='dj.asp'><div align=center><input type='radio' name='select' value='dj_name' checked class='inuptCG'>名称&nbsp;<input type='radio' name='select' value='dj_user' class='inuptCG'>歌手&nbsp;<input type='radio' name='select' value='review' class='inuptCG'>评论<input type='text' name='keyword'  size='15' value='搜索关键字' maxlength='50' onfocus=""this.value=''"" class='input'>&nbsp;<input type='submit' name='search'  value='搜索' onmouseover=""this.className='boton'"" onmouseout=""this.className='botoff'""></form>" & vbCrLf
end sub

'=================================================
'过程名：searchzj_dj
'作  用：显示音乐专集搜索表单
'参  数：无
'=================================================
sub searchzj_dj()
Response.Write "<form name='form2' method='post' action='dj_Speciallist.asp'><div align=center><input type='radio' name='select' value='name' checked class='inuptCG'>专集名称&nbsp;<input type='radio' name='select' value='zjuser' class='inuptCG'>歌手姓名<BR><input type='text' name='keyword'  size='15' value='搜索关键字' maxlength='50' onfocus=""this.value=''"" class='input'>&nbsp;<input type='submit' name='search'  value='搜索' onmouseover=""this.className='boton'"" onmouseout=""this.className='botoff'""></form>" & vbCrLf
end sub

'=================================================
'过程名：displayList_dj
'作  用：带分页功能的歌曲列表
'参  数：popdjnum-热门点击数
'        nn--------------标题长度
'        Hxperpage-------每页显示条数
'        classyes--------是否显示分类，True为是，False为否
'        NewWindows------是否新窗打开，True为是，False为否
'=================================================
sub displayList_dj(nn,Hxperpage,classyes,NewWindows)
Dim CurPage,Url_Add
Url_Add="?"
If Request.QueryString("Page")<>"" Then
   Curpage=Request.QueryString("Page")
   If IsInteger(Curpage)=False Then Curpage=1
Else
   Curpage=1
End If
if request("keyword")<>"" then
  if instr(request("keyword"),"'")>0 then
    Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
    Response.End
  end if
end if
dim mtyid,hx01,hx66010,zj,HX
if request.querystring("djcat_id")<>"" then
   mtyid=int(djcat_id)
   set hx01=conn.execute("select djcat_id,djcat_name,sid from djcat order by djcat_id")
   do while not hx01.eof
   if mtyid=hx01("sid") then
      hx66010=hx66010+" or djcat_id="&hx01("djcat_id") '显示页所需变量dj.asp
   end if
   hx01.movenext
   loop
   hx01.close
   set hx01=nothing
   sql="select * from dj where passed=0 and (djcat_id="&djcat_id&hx66010&") order by istop desc,dj_id DESC"
   Url_Add=Url_Add&"djcat_id="&djcat_id&"&"
elseif request("keyword")<>"" and (request("select")="dj_name" or request("select")="dj_user" or request("select")="review" or request("select")="tjuser") then
   sql="select * from dj where passed=0 and "&request("select")&" like '%"&Jencode(checkspace(request("keyword")))&"%' order by istop desc,dj_id DESC"
   Url_Add=Url_Add&"select="&request("select")&"&keyword="&Server.URLEncode(request("keyword"))&"&"
else
   sql="select * from dj where passed=0 order by istop desc,dj_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Response.Write "<table width='100%' border='1' align='center' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF' bordercolor='#f0f0f0' style='border-collapse: collapse'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height=30 colSpan=7><FONT color=#b70000>&nbsp;<B>·</B></FONT>"
if request("djcat_id")<> "" then
Response.Write "本分类共有"
elseif request("select")<>"" then
Response.Write "共搜索到"
else
Response.Write "当前共有"
end if
Response.Write "<span>"&rs.recordcount&"</span>首音乐</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<form name='form' onsubmit=""javascript:return lbsong();"" target=""lbsong"" action='djplaylist.asp'>"
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<TD width='6%' height='26'>状态</TD><td width='*'>主 题</td><TD width='10%'>歌手</TD><td width='10%'>所属专集</td><TD width='6%'>人气</TD><TD width='6%'>试听</TD><TD width='6%'>连播</TD>" & vbCrLf
Response.Write "</tr>" & vbCrLf
if not rs.eof then
   Dim Hx_Nums,MultiPages,i
   Rs.PageSize=Hxperpage
   Rs.AbsolutePage=CurPage
   Hx_Nums=Rs.RecordCount
   MultiPages="<tr><td colspan=""7"" height='28' align=""center"">"&MultiPage(Hx_Nums,Hxperpage,CurPage,Url_Add)&"</td></tr>"
Do Until Rs.EOF OR i=Hxperpage
sql="select djcat_id,djcat_name from djcat where djcat_id="&rs("djcat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
if rs("istop")="1" then      
folder="<img src=""img/1.gif"" title=固顶音乐>"       
else
folder="<img src=""img/4.gif"" title=普通音乐>"       
end if      
if rs("istop")="0" then      
if rs("isbest")=1 then
folder="<img src=""img/2.gif"" title=推荐音乐>"
elseif rs("dj_count")>=popdjnum then
folder="<img src=""img/3.gif"" title=热门音乐>"       
else
folder="<img src=""img/4.gif"" title=普通音乐>"       
end if      
end if 
if rs("SpecialID")="0" then      
zj="［单曲］"       
else
set HX=conn.execute("select Name from djSpecial where SpecialID=" & rs("SpecialID") & "")
zj=""&HX(0)&""      
end if 
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if     
Response.Write "<TR>" & vbCrLf
Response.Write "<TD align=Center height='26'>"&folder&"</TD><td>"
if classyes=True then Response.Write "<a href='dj.asp?djcat_id="&rs("djcat_id")&"'>『"&gotTopic(rscat("djcat_name"),10)&"』</a>"
Response.Write "<a href='showdj.asp?dj_id=" & rs("dj_id")& "' Title='音乐名称："&rs("dj_name")&"&#13&#10视听次数："&rs("dj_count")&"&#13&#10上传时间："&rs("dj_date")&"' "& nnn &">"&gotTopic(rs("dj_name"),nn)&"</a></TD>"
Response.Write "<TD align=Center><a href='dj.asp?select=dj_user&keyword="&rs("dj_user")&"' title='查找作者["&rs("dj_user")&"]的所有音乐'>"&left(rs("dj_user"),4)&"</a></TD>"
Response.Write "<TD align=Center>"
if rs("SpecialID")="0" then 
Response.Write ""&left(zj,4)&"" 
else 
Response.Write "<a href='Showdj_Special.asp?Specialid="&rs("SpecialID")&"' Title='点击进入此专集'>"&left(zj,4)&"" 
end if
Response.Write "</TD>"
Response.Write "<TD align=Center>"&rs("dj_count")&"</TD>"
Response.Write "<TD align=Center><a href='djplaylist.asp?checked="&rs("dj_id")&"&player=+' onclick=""HxWindow(this.href,'dj','350','260','no','no','center');return false"" Title='点击单首弹窗试听'><img border='0' src='img/play_dj/bt_play.gif' width='14' height='14'></a></TD>"
Response.Write "<TD align=Center><input type='checkbox' name='checked' value='"&rs("dj_id")&"'></TD>"
Response.Write "</TR>" & vbCrLf
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td align=middle height='60' colSpan=7>"
if request("djcat_id")<> "" then
Response.Write "该分类暂时没有音乐"
elseif request("keyword")<>"" then
Response.Write "没有找到包含[<b><font color=red>"&request("keyword")&"</font></b>]的音乐！"
else
Response.Write "没有任何音乐，请管理员到后台添加！"
end if
Response.Write "</td></tr>" & vbCrLf
end if
end if
Response.Write "<TR><TD colspan=7 align=Center height='26'><div align='center'>"
Response.Write "<input type='button' name='chkall' value='' onclick=""CheckAll(this.form)"" title=""选择显示的所有音乐"" style=""width: 62px; height: 23px; background-image: url('img/ly1.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf         
Response.Write "<input type='button' name='chkOthers' value='' onclick=""CheckOthers(this.form)"" title=""反向选择音乐"" style=""width: 62px; height: 23px; background-image: url('img/ly2.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf
Response.Write "<input type='submit' name='player' value='' title=""请先选择你想听的音乐后再点击播放"" style=""width: 62px; height: 23px; background-image: url('img/ly3.gif'); border-style: none; border-width: medium"">" & vbCrLf
Response.Write "</div></TD></TR></form>" & vbCrLf
Response.Write(MultiPages)
Response.Write "</table>" & vbCrLf
rscat.close
set rscat=nothing
rs.close
set rs=nothing
end sub

'=================================================
'过程名：displayListzj_dj
'作  用：带分页功能的专集列表——带图片显示
'参  数：nn-标题长度,Hxperpage-每页显示条数
'        ImgWidth   ----图片宽度
'        ImgHeight  ----图片高度
'        NewWindows-----是否新窗打开，True为是，False为否
'=================================================
sub displayListzj_dj(nn,Hxperpage,ImgWidth,ImgHeight,NewWindows)
Dim CurPage,Url_Add
Url_Add="?"
If Request.QueryString("Page")<>"" Then
   Curpage=Request.QueryString("Page")
   If IsInteger(Curpage)=False Then Curpage=1
Else
   Curpage=1
End If
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""				
end if
if request("keyword")<>"" then
  if instr(request("keyword"),"'")>0 then
    Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
    Response.End
  end if
end if
dim djcat_id,mtyid,hx01,hx66010
if request.querystring("djcat_id")<>"" then
   djcat_id=request.querystring("djcat_id")
   mtyid=int(djcat_id)
   set hx01=conn.execute("select djcat_id,djcat_name,sid from djcat order by djcat_id")
   do while not hx01.eof
   if mtyid=hx01("sid") then
      hx66010=hx66010+" or ClassID="&hx01("djcat_id") 
   end if
      hx01.movenext
      loop
   hx01.close
   set hx01=nothing
   sql="select * from djSpecial where ClassID="&djcat_id&hx66010&" order by istop desc,SpecialID DESC"
   Url_Add=Url_Add&"djcat_id="&djcat_id&"&"
elseif request("keyword")<>"" and (request("select")="name" or request("select")="zjuser") then
   sql="select * from djSpecial where "&request("select")&" like '%"&Jencode(checkspace(request("keyword")))&"%' order by istop desc,SpecialID DESC"
   Url_Add=Url_Add&"select="&request("select")&"&keyword="&Server.URLEncode(request("keyword"))&"&"
else
   sql="select * from djSpecial order by istop desc,SpecialID DESC"
end if
   set rs=server.createobject("adodb.recordset")
   rs.open sql,conn,1,1
Response.Write "<table width='100%' border='1' align='center' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF' bordercolor='#f0f0f0' style='border-collapse: collapse'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td height=30 colSpan=4><FONT color=#b70000>&nbsp;<B>·</B></FONT>"
if request("djcat_id")<> "" then
Response.Write "本分类共有"
elseif request("select")<>"" then
Response.Write "共搜索到"
else
Response.Write "当前共有"
end if
Response.Write "<span>"&rs.recordcount&"</span>张专集</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
if not rs.eof then
   Dim Hx_Nums,MultiPages,i
   Rs.PageSize=Hxperpage
   Rs.AbsolutePage=CurPage
   Hx_Nums=Rs.RecordCount
   MultiPages="<tr><td colspan=""4"" height='28' align=""center"">"&MultiPage(Hx_Nums,Hxperpage,CurPage,Url_Add)&"</td></tr>"
Do Until Rs.EOF OR i=Hxperpage
Response.Write "<TD style='PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px' align=middle width='20%'><a href='Showdj_Special.asp?Specialid="&rs("SpecialID")&"' title='专辑："&rs("name")&"' "& nnn &"><img src='"&rs("pic")&"' width='"&ImgWidth&"' height='"&ImgHeight&"' border=0 alt='专辑："&rs("name")&"'></TD><TD width='30%' align='top'>&nbsp;专集名称："&gotTopic(rs("name"),nn)&"<br>&nbsp;歌手姓名："&rs("zjuser")&"<br>&nbsp;专辑语言："&rs("Yuyan")&"<br>&nbsp;唱片公司："&rs("Gongsi")&"</TD>"
i=i+1
if i mod 2 = 0 then
Response.Write "</tr>"
end if
rs.movenext
loop
else
if rs.eof and rs.bof then
Response.Write "<tr align='center'>" & vbCrLf
Response.Write "<td align=middle height='60' colSpan=4>"
if request("djcat_id")<> "" then
Response.Write "该分类暂时没有专集"
elseif request("keyword")<>"" then
Response.Write "没有找到包含[<b><font color=red>"&request("keyword")&"</font></b>]的专集！"
else
Response.Write "没有任何专集，请管理员到后台添加！"
end if
Response.Write "</td></tr>" & vbCrLf
end if
end if
Response.Write(MultiPages)
Response.Write "</table>" & vbCrLf
rs.close
set rs=nothing
end sub

'=================================================
'过程名：content_dj
'作  用：显示音乐标题、内容
'参  数：无
'=================================================
sub content_dj()
if rs("Grade")="0" then
hx66Grade="游客身份"
elseif rs("Grade")="1" then
hx66Grade="会员身份"       
elseif rs("Grade")="2" then
hx66Grade="VIP身份"       
end if
dim djurl,djpath,dj_path
djpath=rs("path")
If djpath=0 Then
   djurl=rs("dj_url")
else
If djpath="" or IsNull(djpath) Then
    djpath=1
End If
    Select Case djpath
        Case 1
	        dj_path=d_path1
	Case 2
		dj_path=d_path2
	Case 3
		dj_path=d_path3
	Case 4
		dj_path=d_path4
	Case 5
		dj_path=d_path5
	Case else
		dj_path=d_path1
    End Select
djurl=dj_path&rs("dj_url")
End If
Response.Write "<table width=""100%""  border=""1"" align=""center"" cellspacing=""0"" cellpadding=""3"" bgcolor=""#FFFFFF"" bordercolor=""#f0f0f0"" style=""border-collapse: collapse"">"
Response.Write "<span id='size' style=""position:absolute;top: -50px;"">showdj.asp?dj_id="&rs("dj_id")&"</span>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width='100%' colspan=3 align='center' HEIGHT=40><b><font color=ff6600><b>"&rs("dj_name")&"</b></font><b></td>"
Response.Write "</tr>" & vbCrLf 
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='30' align='center' width='15%'>加入时间</td>"
Response.Write "<td width='30%'>&nbsp;"&rs("dj_date")&"</td>"
Response.Write "<td rowspan='15' width='420' align='center'>"
if rs("dj_pic")="flash" then
Response.Write "<div align='center'>"
Response.Write "<a href='"&djurl&"' title='全屏幕欣赏' target=_blank>全屏欣赏</a><BR><BR>"
Response.Write "<OBJECT classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"" WIDTH='400' height='300'><PARAM NAME=movie VALUE='"&djurl&"'><PARAM NAME=quality VALUE=high><EMBED src='"&djurl&"' loop=false menu=false quality=high WIDTH='100%' height='100%' TYPE=""application/x-shockwave-flash"" PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED></OBJECT></div>"
else
Response.Write "<div align='center'>"
Response.Write "<iframe src='djplayer.asp?checked="&rs("dj_id")&"' width='350' height='330' scrollbar='no' scrolling='no' name='Webhxcms' border='0' frameborder='0'></iframe></div>"
Response.Write "<div name=Mtext style=""width:350;height:35px;border:1px solid #879DCA;background-image: url(iMG/dj.gif);""><marquee onmouseover=this.stop() onmouseout=this.start() scrollAmount=1 width=340 height=300 scrollDelay=100 direction='up'>"&formatStr(rs("dj_word"))&"</marquee></div>"
end if
Response.Write "</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center' width='15%'>演唱歌手</td>"
Response.Write "<td width='30%'>&nbsp;"&rs("dj_user")&"</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>视听次数</td>"
Response.Write "<td >&nbsp;<font color=red><b>"&rs("dj_count")&"</b></font></td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>下载次数</td>"
Response.Write "<td>&nbsp;<b>"&rs("dj_dcount")&"</b></td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>音乐类别</td>"
Response.Write "<td >&nbsp;"&rs("dj_pic")&"</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>推荐程度</td>"
Response.Write "<td>&nbsp;"&rs("dj_desc")&"</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>评论次数</td>"
Response.Write "<td>&nbsp;"&rs("reviewcount")&"</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>复制本页</td>"
Response.Write "<td>&nbsp;<a href='#' title='复制本页网址发给你的朋友' onclick='copyUrl(document.all.size)'>复制<a></td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>报告错误</td>"
Response.Write "<td >&nbsp;<a href='showdj.asp?action=djerror&dj_id="&rs("dj_id")&"'>发送</a></td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center' width='15%'>发布会员</td>"
Response.Write "<td>&nbsp;"&rs("tjuser")&"</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>下载权限</td>"
Response.Write "<td>&nbsp;<font color=red>"&hx66Grade&"</font></td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>下载花费</td>"
Response.Write "<td>&nbsp;<font color=red>"&rs("points")&"</font> 兜币</td>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td height='20' align='center'>歌曲下载</td>"
Response.Write "<td>"
if djdown<>"yes" then
Response.Write "<font color=green>『下载功能已关闭』</font>" & vbCrLf
else
if UserLogined<>True then 
    Grade=0
else 
    Grade=Hx66_Grade+1
end if
if Grade>=hxGrade and Hx66_points>=hxpoints then
   Response.Write "<iframe name='Hxcms' style='display:none'></iframe>"
   Response.Write "<form name='form' method='post' action='opendj.asp?dj_id="&rs("dj_id")&"&url=' target='Hxcms'>"
   Response.Write "&nbsp;<input type='submit' name='Submit' value='下载此音乐' class='input'></a>" & vbCrLf
elseif Grade<hxGrade then
   Response.Write "<font color=red>&nbsp;对不起，你的权限不够!</font>" & vbCrLf
elseif Hx66_points<hxpoints then
   Response.Write "<font color=red>&nbsp;对不起，你的点数不足!</font>" & vbCrLf
end if
end if
Response.Write "</td></form>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr><iframe name='Hx66' style=""display:none""></iframe><form name='form' method='post' action='user_addcollect.asp?collect="&rs("dj_id")&"' target='Hx66'>"
Response.Write "<td height='20' align='center' width='15%'>加入收藏</td>"
Response.Write "<td>&nbsp;<input type='submit' name='Submit' value='收藏此音乐' class='input'></td></form>"
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf 
Response.Write "<td colspan=2 height='25'></td>" 
Response.Write "</tr></table>" & vbCrLf
end sub

'=================================================
'过程名：contentzj_dj
'作  用：显示音乐专集标题、内容
'参  数：无
'=================================================
sub contentzj_dj()
dim rshx66
Response.Write "<table width='100%' border='0' cellspacing='0' cellpadding='2' align='center' style=""word-break:break-all;table-layout:fixed;text-align:left"">"
Response.Write "<tr>" 
Response.Write "<TD width='37%' style=""PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px"" align=middle><SCRIPT type=text/javascript>hximg('"&zjpic&"','"&zjpic&"','专集名称："&zjname&"&#13&#10歌手姓名："&zjuser&"&#13&#10试听次数："&zjhits&"');</SCRIPT></TD>"
Response.Write "<td width='63%'>"
Response.Write "<table width='100%' border='0' cellspacing='0' cellpadding='2'>"
Response.Write "<tr><td><strong><font color='#FFA300'>专辑名称：</font></strong>"&zjname&"</td></tr>"
Response.Write "<tr><td><strong><font color='#FFA300'>歌手姓名：</font></strong>"&zjuser&"</td></tr>"
Response.Write "<tr><td><strong><font color='#FFA300'>专辑语言：</font></strong>"&zjYuyan&"</td></tr>"
Response.Write "<tr><td><strong><font color='#FFA300'>唱片公司：</font></strong>"&zjGongsi&"</td></tr>"
Response.Write "<tr><td><strong><font color='#FFA300'>试听人气：</font></strong>"&zjhits&"</td></tr>"
Response.Write "<tr><td><strong><font color='#FFA300'>添加时间：</font></strong>"&zjtime&"</td></tr>"
Response.Write "</table></td>"
Response.Write "</tr>"
Response.Write "<tr><td height='20' colspan=2>&nbsp;&nbsp;<font color=#FF0000>·</font>专辑简介：</td></tr>"
Response.Write "<tr><td valign='top' colspan=2><DIV style=""padding-left:15px;padding-right:15px;padding-top:5px;padding-bottom:20px;"">"&formatStr(autourl(zjintro))&"</DIV></td></tr>"
Response.Write "<tr><td height='20' colspan=2>&nbsp;&nbsp;<font color=#FF0000>·</font>歌曲试听：</td></tr>"
Response.Write "<tr><td valign='top' colspan=2>"
Response.Write "<table width='100%' border='1' align='center' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF' bordercolor='#f0f0f0' style='border-collapse: collapse'>"
Response.Write "<form name='form' onsubmit='javascript:return lbsong();' target='lbsong' action='djplaylist.asp'>"
Response.Write "<TR align=Center>"
Response.Write "<TD width='6%' height='26'>选择</TD><TD width='6%'>序号</TD><TD nowrap width='*'>歌 曲 主 题</TD><TD width='7%'>试听</TD><TD width='7%'>下载</TD><TD width='7%'>收藏</TD><TD width='7%'>歌词</TD><TD width='7%'>铃声</TD><TD width='10%'>人气</TD></TR>"
i=0
set rshx66=conn.execute("SELECT * FROM dj where SpecialID="&Specialid&" order by dj_id Asc") 
if not rshx66.eof then
	do while not rshx66.eof
	i=i+1
Response.Write "<TR>"
Response.Write "<TD align=Center height='26'><input type='checkbox' name='checked' value='"&rshx66("dj_id")&"'></TD>"
Response.Write "<TD align=Center>"&i&"</TD><TD nowrap>&nbsp;<a href='showdj.asp?dj_id="&rshx66("dj_id")&"' Title='点击单首页面试听'>"&rshx66("dj_name")&"</a></TD>"
Response.Write "<TD align=Center><a href='djplaylist.asp?checked="&rshx66("dj_id")&"&player=+' onclick=""HxWindow(this.href,'dj','350','260','no','no','center');return false"" Title='点击单首弹窗试听'><img border='0' src='img/play_dj/bt_play.gif' width='14' height='14'></a></TD>"
Response.Write "<TD align=Center><a title='点击下载' href='opendj.asp?dj_id="&rshx66("dj_id")&"&url='><img border='0' src='img/musicdown.gif' width='12' height='12'></a></TD>"
Response.Write "<TD align=Center><a title='加入音乐盒' href='user_addcollect.asp?collect="&rshx66("dj_id")&"' target='_blank'><img border='0' src='img/music.gif' width='12' height='12'></a></TD>"
Response.Write "<TD align=Center><a title='查看歌词' href='dj_word.asp?id="&rshx66("dj_id")&"&singer="&rshx66("dj_user")&"&musicname="&rshx66("dj_name")&"' onclick=""HxWindow(this.href,'dj','330','280','yes','yes','center');return false""><img border='0' src='img/musicart.gif' width='12' height='12'></a></TD>"
Response.Write "<TD align=Center><a title='和弦铃声' href='#'><img border='0' src='img/musicring.gif' width='12' height='12'></a></TD>"
Response.Write "<TD align=Center>"&rshx66("dj_count")&"</TD>"
Response.Write "</TR>"
        rshx66.movenext
loop
	else
	response.write "<TR><TD colspan=9 align=Center>尚无收录</TD></TR>"
end if
rshx66.close
set rsh=nothing
Response.Write "<TR><TD colspan=9 align=Center height='26'><div align='center'>"
Response.Write "<input type='button' name='chkall' value='' onclick=""CheckAll(this.form)"" title=""选择显示的所有音乐"" style=""width: 62px; height: 23px; background-image: url('img/ly1.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf         
Response.Write "<input type='button' name='chkOthers' value='' onclick=""CheckOthers(this.form)"" title=""反向选择音乐"" style=""width: 62px; height: 23px; background-image: url('img/ly2.gif'); border-style: none; border-width: medium"">&nbsp;" & vbCrLf
Response.Write "<input type='submit' name='player' value='' title=""请先选择你想听的音乐后再点击播放"" style=""width: 62px; height: 23px; background-image: url('img/ly3.gif'); border-style: none; border-width: medium"">" & vbCrLf
Response.Write "</div></TD></TR></form>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
end sub

'=================================================
'过程名：contextual_dj
'作  用：显示音乐上下首(篇)
'参  数：无
'=================================================
sub contextual_dj()
set RelationArt = conn.execute("select top 1 dj_id,dj_name from dj where dj_id<"&request.querystring("dj_id")&" and passed=0 order by dj_date desc")
IF RelationArt.eof and relationArt.bof Then
Response.Write "<font color=red>·上首音乐：</font>已经没有了<BR>"  & vbCrLf   
else
Response.Write "<font color=red>·上首音乐：</font><a href=""showdj.asp?dj_id=" & RelationArt(0) & """>" & relationArt(1) & "</a><BR>" & vbCrLf   
end if   
Set RelationArt=Nothing
set RelationArt = conn.execute("select top 1 dj_id,dj_name from dj where dj_id>"&request.querystring("dj_id")&" and passed=0 order by dj_id")
IF RelationArt.eof and relationArt.bof Then
Response.Write "<font color=red>·下首音乐：</font>已经没有了" & vbCrLf   
else
Response.Write "<font color=red>·下首音乐：</font><a href=""showdj.asp?dj_id=" & RelationArt(0) & """>" & relationArt(1) & "</a></td>" & vbCrLf  
end if  
RelationArt.close
Set RelationArt=Nothing 
end sub

'=================================================
'过程名：review_dj
'作  用：显示相关音乐评论
'参  数：n-显示条数；point_dj-评论开关,1-开启，0-关闭
'=================================================
sub review_dj(n)
dim temp,i,j
if point_dj="1" then
Response.Write "<table align=""center"" width=""98%"" cellspacing=""0"" cellpadding=""0"" style=""word-break:break-all;table-layout:fixed;text-align:left"">"
if rs("review")<>"" then
temp=split(Trim(rs("review")),"|")
if n>=ubound(temp) then
j=ubound(temp)
else
j=n
end if
for i=1 to j
Response.Write "<tr><td style=""display:block;padding:0px 10px;LINE-HEIGHT: 180%"">"& temp(i) &"</td></tr>"
next
else
Response.Write "<tr><td style=""display:block;padding:0px 10px;LINE-HEIGHT: 180%"">当前没有评论</td></tr>"
end if
Response.Write "<tr><td align=""right"">相关评论<font color=#CC0000> "&rs("reviewcount")&" </font>篇，当前显示最新的<font color=#CC0000> "&n&" </font>篇。&nbsp;&nbsp;<a href=""view.asp?action=dj&dj_id="&rs("dj_id")&"""> [查看更多评论] [发表我的评论]</a>&nbsp;&nbsp;</td></tr>"
Response.Write "</table>"
elseif point_dj="0" then
Response.Write "<table width=""100%"" cellpadding=""5"" cellspacing=""0"" border=""0"">"
Response.Write "<tr><td  align=""center"">【音乐评论已关闭】"
Response.Write "</td></tr>"
Response.Write "</table>"
End If
rs.close
set rs=nothing
end sub
%>

