<!-- #Include File="Skin.asp" -->
<!-- #Include File="Cls_Class.asp" -->
<!-- #Include File="Cls_Public.asp" -->
<!-- #Include File="Inc_Post.asp" -->
<!-- #include file="Inc_convert.asp" -->
<!-- #Include File="../Music/Common.asp" -->
<%
'=======================================================
' 欢迎使用《阿赛大型门户网站系统V3.0》，简称“AsaiMHV3”
' 技术支持、商业版咨询、官方唯一指定联系QQ“4941172”
' 官方网站：http://77ya.com      程序负责人：阿赛
'=======================================================

Call Channel_Loader()
Dim ViewData,temp1,n_topic		'浏览数据数组
Dim iSpecialID
Dim types,t_name,t_type,sql_add
iSpecialID = Cls.Code_ID("ID")

'//* 载入分类数组 *//
Public Sub Channel_Load(LoadType)
    Call Channel_Loader()
	Call Cid_Load()
	Call Class_Load()
	If LoadType = 0 Then
	   Call DoWebHead(0,0)
	ElseIf LoadType = 1 Then
	   Call DoWebHead(2,1)
	End If
End Sub

'//* 释放频道数据分类 *//
Public Sub Channel_End(Endtype)
	If IsArray(ViewData) Then Erase ViewData
	Call Class_End()
	If Endtype=0 Then Call DoWebEnd()
End Sub

'//* 频道数据分类并跳转网页 *//
Public Sub Channel_Redirect(frvar)
	Call Channel_End(0)
	Call Format_Redirect(frvar)
End Sub

Dim is_Download,v_id,v_username,v_name,v_tcolor,v_genre,v_power,v_emoney,v_url,v_pic,v_remark,v_tim,v_counter,v_keyes,v_types,v_cod,tmp_err,tmp_commend,v_file
Dim v_whe,v_role,v_star,v_lang,v_viewtype,p_url,d_url,v_Music,numusic_perent
Dim iSpecialTopic, iSpecialRemark, iSpecialTim,tmp_xml
Dim StrDownLoadUrl,DownLoadUrl,UrlID
Dim Web_Music,Music_config,Music_freename,Music_freegroup,Music_freeip,Music_Month,Music_Quarter,Music_Year,Music_Letter,Music_Sex,Music_Company,Music_Language,Music_Favnum,Music_Mailnum
Web_Music=split(Cls.ChannelOption,"|")
Music_config=split(Web_Music(0),",")
Music_freename=Web_Music(1)
Music_freegroup=Web_Music(2)
Music_freeip=Web_Music(3)
Music_Month=Web_Music(4)
Music_Quarter=Web_Music(5)
Music_Year=Web_Music(6)
Music_Letter=Web_Music(7)
Music_Sex=Web_Music(8)
Music_Company=Web_Music(9)
Music_Language=Web_Music(10)
Music_Favnum=Web_Music(11)
Music_Mailnum=Web_Music(12)

Public Function ShowChannelIndex(IsHtml)
        Tit=Cls.ChannelName:tit_fir=""
		Tit_Dir = "频道首页"
        HtmlContent = Cls.ReadTemplate(0)
        Call LoadChannelMainList(0)
		Call LoadChannelSort(0,0)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
		HtmlContent = Html.ReadMusicList(HtmlContent)
		HtmlContent = Html.ReadMusicPic(HtmlContent)
		HtmlContent = Html.ReadFlashPic(HtmlContent)
		HtmlContent = Html.ReadCast(HtmlContent)
		HtmlContent = Html.ReadVote(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)
		If IsHtml=True Then
		ShowChannelIndex = HtmlContent
		Else
		Response.Write HtmlContent
		End If
End Function

Public Function ShowChannelLists(IsHtml,ClsID)
		tit=Cls.ChannelTit&"列表"
	    Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
	    tit_fir=Cls.ChannelName
		IndexUrl=Cls.Web_Dir & Cls.ChannelDir
		HtmlContent = Cls.ReadTemplate(2)
        Call LoadChannelMainList(ClsID)
		Call LoadChannelSort(ClsID,0)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()		
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
    	HtmlContent = Html.ReadMusicList(HtmlContent)
		HtmlContent = Html.ReadMusicPic(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
 		If IsHtml=True Then
		ShowChannelLists = HtmlContent
		Else
		Response.Write HtmlContent
		End If	
End Function

Public Function ShowChannelList(IsHtml,ClsID,PgID,ListAction)
	    Select Case ListAction
	    Case "pic"
	    	tit="图片"&Cls.ChannelTit
	        tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    Case "focus"
	    	tit="焦点"&Cls.ChannelTit
    	    tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
        Case "good"
   	    	tit="推荐"&Cls.ChannelTit
   	        tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    Case "hot"
	     	tit="热门"&Cls.ChannelTit
	        tit_fir=Cls.ChannelName
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    Case "search"
	    	tit=Cls.ChannelTit&"搜索"
	    	tit_fir=Cls.ChannelName
			Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
		Case "special"
	    	tit=Cls.ChannelTit&"专题"
	    	tit_fir=Cls.ChannelName	
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(4)
            HtmlContent = Replace(HtmlContent, "{$SpecialID}", iSpecialID)
			HtmlContent = Replace(HtmlContent, "{$s_name}", iSpecialTopic)
			HtmlContent = Replace(HtmlContent, "{$s_remark}", iSpecialRemark)
			HtmlContent = Replace(HtmlContent, "{$s_tim}", iSpecialTim)
		Case Else
		    tit=Cls.ChannelTit&"列表"
			tit_fir=Cls.ChannelName
	    	Tit_Dir = Class_Grade(ClsID,Cls.ClassDepth) & Tit
			IndexUrl=Cls.Web_Dir & Cls.ChannelDir
			HtmlContent = Cls.ReadTemplate(1)
	    End Select
  Dim taxis
  Dim ListContent,ListContents,HtmlUrl
  Dim Mhead,obj_search,obj_page
  Dim Tempstr, PageCt
  Dim SQL, i, foundstr, ListStyle
  Dim sDot,sTitle, sTopic, BestCode, BestString, mTypes, ImageUrl
  Dim ArticleTopic, ClassName, HtmlFileUrl, WriteTime, LinkTarget, HtmlFileName
  Dim tmp_sql,tmp_sql_order,tmp_url,tmp_keyword
  taxis=Cls.Code_Query("taxis")
  Mhead="":tmp_url=""
  Select Case ListAction
  Case "hot"
      mhead=tit
      tmp_sql="A.hot>20"
      tmp_sql_order="A.hot desc"

  Case "good"
      mhead=tit
      tmp_sql="A.isgood=1"
  Case "focus"
      mhead=tit
      tmp_sql="A.isfocus=1"
  Case "pic"
      mhead=tit
      tmp_sql="A.ispic=1"
  Case "search"
  	  if int(ClsID)>0 then
	  tmp_sql="A.ClassID in ("&Class_Cid_Get(Clsid)&")"
	  else
	  tmp_sql=""
	  end if
      set obj_search=New Cls_Search
      obj_search.inc_url="?c_id="&ClsID&"action=Search&"
      obj_search.inc_sql=tmp_sql
      call obj_search.format_search("A.Name","A.Name,A.keyes,A.username",2,1,0)
      tmp_url=obj_search.inc_url
      tmp_sql=obj_search.inc_sql
      tmp_keyword=obj_search.keyword
      mhead=mhead&"（"&Cls.code_html(obj_search.keyword,1,0)&"）"
      set obj_search=nothing
  Case "special"
	 tmp_url="?ID="&iSpecialID&"&"
	 tmp_sql="A.SpecialID="&iSpecialID
	 mhead=tit
  Case Else
	  if int(ClsID)>0 then tmp_sql="A.ClassID="&ClsID
	  mhead=tit
  End Select
  if tmp_sql="" then
    tmp_sql="A.hidden=1"
  else
    tmp_sql="A.hidden=1 and "&tmp_sql
  End if
  Select Case taxis
  Case "tim"
    tmp_sql_order="A.tim Desc"
  Case "counter"
    tmp_sql_order="A.hot Desc"
  Case Else
    tmp_sql_order=""
  End Select  
  if tmp_sql_order="" then
    tmp_sql_order="A.istop desc,A.id desc"
  else
    tmp_sql_order=tmp_sql_order&",A.istop desc,A.id desc"
  End if
  set obj_page=New Cls_PageCute
  obj_page.nummer=Cls.ChannelListNum
  obj_page.page_tit=Cls.ChannelTit
  obj_page.page_unit=Cls.ChannelUnit
  obj_page.v_id="A.id"
  if action="hot" then obj_page.v_id="A.hot"
  tmp_sql=tmp_sql&" And A.ChannelIDs="&ChannelIDs
  call obj_page.p_init("","[AsaiMHMusicDisk] A INNER JOIn [AsaiMHClass] C ON A.ClassID=C.C_ID",tmp_sql,"")
  sql=obj_page.sql_count
  set rs=Cls.exec(sql,1)
  obj_page.rssum=rs(0)
  rs.close
	    If Instr(HtmlContent,"[ShowList]") > 0 Then
	        ListContents=""
            ListContent = Cls.CutFixContent(HtmlContent, "[ShowList]" , "[/ShowList]", 0)
			'检查分页数据
			If PgID<>"" then obj_page.setpage=PgID
			Call obj_page.p_main(" A.ID,A.ClassID,A.TColor,A.Name,A.hits,A.Tim,A.isgood,A.isfocus,A.istop,A.hot,A.Pic,A.lang,A.words,A.HtmlFileDate,C.ClassName,C.HtmlFileDir","[AsaiMHMusicDisk] A INNER JOIn [AsaiMHClass] C ON A.ClassID=C.C_ID",tmp_sql,tmp_sql_order)
			'循还读数据
            For i=1 to obj_page.page_num
                If rs.eof Then exit for
				If (i Mod 2) = 0 Then
					ListStyle = "ll" & 1
				Else
					ListStyle = "ll" & 2
				End If
				If Rs("isgood") <> 0 Then
					BestCode = 2
					BestString = "<font color='red'>推荐</font>"
				Else
					BestCode = 1
					BestString = ""
				End If
				If rs("Pic")="" then
					   ImageUrl = Cls.Web_Dir&"Skin/no_pic.gif"
				else
					   ImageUrl = rs("Pic")
				end if	
				ImageUrl = "<img src='"&ImageUrl&"' width=" & Cls.ChannelPicWidth & " height=" & Cls.ChannelPicHeight & " border=0>"												
				'前标
				sDot=Cls.GetDot(rs("istop"),rs("isfocus"),rs("isgood"))
				'sTopic = Cls.GetIncInfo(Rs("IncludeInfo"))
				sTitle = Cls.Cuted(Rs("name"), Cls.ChannelCuteNum)
				sTitle = Cls.GetTcolor(sTitle,rs("tcolor"),False)
				'-------------搜索关键字显亮 
				sTitle = Cls.Channel_Search(sTitle)
				ClassName = Rs("ClassName")
				If CInt(Cls.ChannelIsCreatHtml) <> 0  Then
					HtmlFileName = Cls.ReadFileName(Rs("HtmlFileDate"), Rs("ID"), Cls.ChannelHtmlExtName, Cls.ChannelHtmlPrefix, Cls.ChannelHtmlForm, "")
					HtmlFileUrl = Cls.Web_Dir& Cls.ChannelDir & "/" & Rs("HtmlFileDir") & Cls.ShowDatePath(Rs("HtmlFileDate"), Cls.ChannelHtmlPath) & HtmlFileName
					ClassName = "<a href='" & Cls.ChannelPath & Rs("HtmlFileDir") & "Index_1" & Cls.ChannelHtmlExtName & "'>" & ClassName & "</a>"
				Else
					HtmlFileUrl = Cls.ChannelPath & "View.asp?id=" & Rs("ID")
					ClassName = "<a href='" & Cls.ChannelPath & "List.asp?c_id=" & Rs("ClassID") & "'>" & ClassName & "</a>"
				End If
				WriteTime = Cls.ShowDateTime(Rs("tim"),6)
				If Cls.ChannelIsNewWindow <> 0 Then
					LinkTarget = " target=""_blank"""
				Else
					LinkTarget = ""
				End If
				ArticleTopic = "<a href='" & HtmlFileUrl & "'" & LinkTarget & " title='" & Cls.ChannelModule & "标题：" & Rs("name") & "&#13;&#10;发布时间：" & Rs("tim") & "&#13;&#10;下载次数：" & Rs("hits") & "'>" & sTitle & "</a>"
				Tempstr = ListContent
				Tempstr = Replace(Tempstr, "{$MusicTopic}", ArticleTopic)
				Tempstr = Replace(Tempstr, "{$MusicID}", Rs("ID"))
				Tempstr = Replace(Tempstr, "{$MusicTitle}", sTitle)
				Tempstr = Replace(Tempstr, "{$BriefTopic}", "")
				Tempstr = Replace(Tempstr, "{$Title}", Rs("name"))
				Tempstr = Replace(Tempstr, "{$WriteTime}", WriteTime)
				Tempstr = Replace(Tempstr, "{$Dot}", sDot)
				Tempstr = Replace(Tempstr, "{$HtmlFileUrl}", HtmlFileUrl)
				Tempstr = Replace(Tempstr, "{$ClassName}", ClassName)
				Tempstr = Replace(Tempstr, "[]", "")
				Tempstr = Replace(Tempstr, "{$Target}", LinkTarget)
				Tempstr = Replace(Tempstr, "{$Time}", WriteTime)
				Tempstr = Replace(Tempstr, "{$MusicHits}", Rs("hits"))
				Tempstr = Replace(Tempstr, "{$ListStyle}", ListStyle)
				Tempstr = Replace(Tempstr, "{$BestCode}", BestCode)
				Tempstr = Replace(Tempstr, "{$BestString}", BestString)
				'Tempstr = Replace(Tempstr, "{$MusicRoles}", rs("role"))
				Tempstr = Replace(Tempstr, "{$MusicTypes}", mTypes)
				Tempstr = Replace(Tempstr, "{$MusicLang}", rs("lang"))
				Tempstr = Replace(Tempstr, "{$MusicPic}", ImageUrl)
				Tempstr = Replace(Tempstr, "{$MusicRemark}", Cls.Code_Cut(rs("words"),100))
				ListContents=ListContents&Tempstr
                rs.movenext
            Next	
  rs.close
  If Cls.ChannelIsCreatHtml = True And ListAction<>"search" then
  obj_page.pageurl="index_"
  obj_page.pagevar=""
  obj_page.pagefirvar="index_1"&Cls.ChannelHtmlExtName
  obj_page.pageext=Cls.ChannelHtmlExtName
  Else
	  if ListAction="search" then
	    obj_page.pageurl = tmp_url
	  elseif  ListAction<>"" and ListAction<>"List" then
        obj_page.pageurl=obj_page.pageurl&"ID="&iSpecialID&"&Action="&ListAction&"&"
	  else
	    obj_page.pageurl="?c_id="&ClsID&"&"
	  end if
  End if
        '内容载入替换，并输出或返回 
		HtmlContent = Replace(HtmlContent,"[ShowList]" & ListContent&"[/ShowList]",ListContents)
		HtmlContent = Replace(HtmlContent,"{$tit}", Tit)
		HtmlContent = Replace(HtmlContent,"{$AsaiMHXml}", "")
		HtmlContent = Replace(HtmlContent,"{$mhead}", mhead)
				PageCt="" & _
				vbcrlf&"<div style='text-align:right;padding-top:8px;'><script language=javascript>" & _
               vbcrlf&"function SelectTo(tvar)" & _
               vbcrlf&"{" & _
               vbcrlf&"  if (tvar=="""" || tvar==null) {return;}" & _
               vbcrlf&"  location.href='"&Cls.Web_Dir&Cls.ChannelDir&"/List.asp?c_id="&Clsid&"&Action="&ListAction&"&taxis='+tvar;" & _
               vbcrlf&"}" & _
               vbcrlf&"</script>" & _
               vbcrlf&"<select name=ListAction size=1 onchange=""javascript:SelectTo(this.options[this.selectedIndex].value);"">" & _
               vbcrlf&"<option value=''>－请选择显示方式－</option>" & _
               vbcrlf&"<option value='tim'"
           if taxis="tim" then PageCt=PageCt&" selected"
           PageCt=PageCt&">按时间排序</option>" & _
               vbcrlf&"<option value='counter'"
           if taxis="counter" then PageCt=PageCt&" selected"
           PageCt=PageCt&">按人气排序</option>" & _
               vbcrlf&"</select>&nbsp;</div>"
           PageCt=PageCt&"<div id='asaipage'>"&obj_page.page_var&" "&obj_page.page_cute&" "&obj_page.page_shortcut&"</div>"
		HtmlContent = Replace(HtmlContent,"{$PageCute}",PageCt)
		Call LoadChannelSort(ClsID,1)
		Call LoadChannelSearch()
		Call LoadChannelSpecial()
		Call Html.LoadReplaced()
		HtmlContent=Replace(HtmlContent,"{$ClassID}",ClsID)
 		HtmlContent = Html.ReadWebHead(HtmlContent)
		HtmlContent = Html.ReadWebEnd(HtmlContent)
		HtmlContent = Html.ReadUserLogin(HtmlContent)
		HtmlContent = Html.ReadMusicList(HtmlContent)
		HtmlContent = Html.ReadMusicPic(HtmlContent)
		HtmlContent = Html.ReadChannelMenu(HtmlContent)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
 		If IsHtml=True Then
		    ShowChannelList = HtmlContent
		Else
		    Response.Write HtmlContent
		End If
	    set obj_page=nothing 	
  End If
End Function

Sub ShowChannelMusicload(vid)
dim furl,vserver,urltype
  '检测
  if not Cls.post_chk() then
		Call Cls.Out_Msg("请勿非法盗链或下载本站"&Cls.ChannelTit&"！\n\n请不要使用WebZip、Teleport这类软件下载本站"&Cls.ChannelTit&"！\n\n也不要使用Googlebot这类浏览器浏览本站！\n\n请停止非法操作或更改浏览器，谢谢合作！","")
    call web_clear(1)
  end If
  '载入
  If Cls.Is_Null(vid)="" Then vid=Cls.Code_ID("id")
  v_id=vid
  UrlID=Cls.Code_ID("UrlID")
	SQL="Select Top 1 * From "&Cls.ChannelTable&" Where hidden=1 And ChannelIDs="&ChannelIDs&" And id="&v_id
	Set Rs=Cls.Exec(SQL,1)
	If Rs.Eof Then
	   Rs.Close
		Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
	End If
	furl=rs("url")
    vserver=rs("server_id")
    urltype=rs("urltype")
	v_power=rs("power")
	v_emoney=rs("emoney")
	Rs.Close
	'权限
   Dim chkpower,chkemoney,ChkMsg
   	   chkpower=true
	   chkemoney=true
       Call DoWebHead(0,0)
   	   chkpower=chk_power(v_power,ChannelIDs)
	   chkemoney=chk_emoney(v_emoney,"Music",v_id,ChannelIDs)
   If login_mode<>"" Then
      if not chkemoney then 
	      If int(login_emoney) >= int(v_emoney) then
	           ChkMsg="<p align=center><br /><br />下载本"&Cls.ChannelTit&"需要扣除<b><font color=red>"&v_emoney&"</font></b>"&Cls.Web_Unit&",你目前尚有<b><font color=blue>"&login_emoney&"</font></b>"&Cls.Web_Unit&"可用<br /><br />你确实愿意支付<b><font color=red>"&v_emoney&"</font></b>"&Cls.Web_Unit&"来下载此"&Cls.ChannelTit&"吗？<br /><br /><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/View.asp?Action=Download&id="&v_id&"&UrlID="&UrlID&"&pay=yes'>我愿意</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='"&Cls.Web_Dir&Cls.ChannelDir&"'>我不愿意</a></p>"
          else
	           ChkMsg="<p align=center><br /><br />对不起，下载本"&Cls.ChannelTit&"需要扣除<b><font color=red>"&v_emoney&"</font></b>"&Cls.Web_Unit&",你目前只有<b><font color=blue>"&login_emoney&"</font></b>"&Cls.Web_Unit&"可用<br /><br />你的"&Cls.Web_Unit&"不足，无法下载此"&Cls.ChannelTit&"，请联系管理员进行充值！</p>"
		  end if
	  end if
	  if not chkpower then ChkMsg="<p align=center><br /><br />对不起，你没有下载此"&Cls.ChannelTit&"的权限！</p>"
   else
	  if not(chkpower and chkemoney) then ChkMsg="<br />&nbsp;&nbsp;&nbsp;&nbsp;你还没注册？或者没有登录？此"&Cls.ChannelTit&"要求至少是本站的注册用户才能下载！<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;如果你还没注册，请赶紧<a href='"&Cls.Web_Dir&"User/Register.asp'><font color=red>点此注册</font></a>吧！<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;如果你已经注册但还没登录，请赶紧<a href='"&Cls.Web_Dir&"User/Login.asp?old_url=back'><font color=red>点此登录</font></a>吧！<br /><br />"
   end if
   if not(chkpower and chkemoney) then 
   Response.Write ChkMsg
   Response.End
   end if
if urltype<>0 then
  DownLoadUrl=Cls.Server_Url(Channelids,vserver,Cls.code_html(furl,1,0))
  else
  DownLoadUrl=furl
  end if
	if DownLoadUrl="" or DownloadUrl="http://" then
		Call Cls.Out_Msg("找不到有效下载地址，请点确定返回，然后点击其它下载地址！","javascript:window.close()")
  end if
  Call Cls.Exec("update "&Cls.ChannelTable&" set counter=counter+1 where id="&v_id,0)
  DownLoadUrl=Cls.ReHtml(DownLoadUrl,1)
  Call web_clear(0)
  Response.Clear
  'Response.write("noDownload")
  Response.Redirect DownLoadUrl
  Response.End
End Sub

'//* 音乐浏览 *//
Public Function ShowChannelView(Vid,IsHtml)
  dim disk_words,Music_HtmlContent,Music_Music_Disk
    '初始载入
	tit=Cls.ChannelTit&"浏览"
   If Cls.Is_Null(vid)="" Then vid=Cls.Code_ID("id")
   v_id=vid
	SQL="Select Top 1 * From AsaiMHMusicDisk Where hidden=1 And ChannelIDs="&ChannelIDs&" And id="&v_id
     rs.open sql,conn,1,3
      if rs.EOF then
	  Rs.Close
	  Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
     else
    rs("hits")=rs("hits")+1
    disk_words=rs("words")
    n_topic=rs("name")
    cid=rs("ClassID")
    v_file=Rs("HtmlFileDate")
    disk_words=Ubb.UbbCode(disk_words)
    rs.update
      Music_HtmlContent=Music_HtmlContent &Cls.ReadTemplate(8)  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_pic}",pic_show(""&rs("pic")&"",2,""""))  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_name}",rs("name"))
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_singerUrl}","<a href='/Music/Music_Singer_View.asp?c_id="&rs("ClassID")&"&n_id="&rs("n_ID")&"'>")   
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_singer}",rs("singer"))  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_pcom}",rs("pcom"))  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_ptim}",rs("ptim"))  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_lang}",rs("lang"))  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_tim}",rs("tim"))  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_S}","<a href='javascript:;' onclick=""javascript:open_view('/Music/Fav.asp?action=add&types=disk&id="&rs("ID")&"',1);"">")  
   end if
   rs.close
   Music_Music_Disk=Music_HtmlContent
	'头部信息
	If Int(Web_Dim(15)) = 0 Then
	   tit=tit&"--"&n_topic
        Else
	   tit=n_topic&"--"&tit
	End if
	Tit_Dir = Class_Grade(Cid,Cls.ClassDepth) & Cls.ChannelTit&"浏览" &":"& Tit
	tit_fir=Cls.ChannelName
	IndexUrl=Cls.Web_Dir & Cls.ChannelDir
   '信息处理
  '//* 前台表格设置 *//
  HtmlContent=Cls.ReadTemplate(3)  
  HtmlContent=Replace(HtmlContent,"{$name}",v_name) 
  HtmlContent=Replace(HtmlContent,"{$Music_Disk}",Music_Music_Disk)
  HtmlContent=Replace(HtmlContent,"{$Music_List}",Music_Music_List)
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)
  HtmlContent=Replace(HtmlContent,"{$tit}",tit)
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)
  If Cls.ChannelIsCreatHtml = True then
        If Cls.ReviewTrue Then HtmlContent=Replace(HtmlContent,"{$review}","<script language=""JavaScript"" src="""&Cls.Web_Dir&"Include/ReView.asp?c_id="&ChannelIDs&"&id="&v_id&"""></script>")
	    HtmlContent=Replace(HtmlContent,"{$counter}","<script language=""JavaScript"" src="""&Cls.Web_Dir&"Include/GetHits.asp?c_id="&ChannelIDs&"&id="&v_id&"""></script>")
  Else
        If Cls.ReviewTrue Then HtmlContent=Replace(HtmlContent,"{$review}",review_type(ChannelIDs,v_id,Cls.Web_Dir&Cls.ChannelDir&"/View.asp?id="&v_id,1,v_username,""))
	    HtmlContent=Replace(HtmlContent,"{$counter}",v_counter)
  End If
  '载入模板函数
  Call LoadChannelSort(Cid,1)
  Call LoadChannelSearch()
  Call LoadChannelSpecial()
  Call Html.LoadReplaced()
  HtmlContent = Replace(HtmlContent,"{$ClassID}",cid)
  HtmlContent = Html.ReadWebHead(HtmlContent)
  HtmlContent = Html.ReadWebEnd(HtmlContent)
  HtmlContent = Html.ReadUserLogin(HtmlContent)
  HtmlContent = Html.ReadMusicList(HtmlContent)
  HtmlContent = Html.ReadMusicPic(HtmlContent)
  HtmlContent = Html.ReadRelateList(HtmlContent,ChannelIDs,v_id,v_keyes,Cls.ChannelIsCreatHtml)  
  HtmlContent = Html.ReadChannelMenu(HtmlContent)
  '判断输出
  Dim CFS,obj_page
  Dim tmp_err,tmp_commend,tmp_topic,v_jt,HtmlUrl,FilePath,vClassPath,ilepaths,Filepaths,Filepathes,ii,j,HtmlFileName
        If int(v_cod)=0 then
        v_remark=Ubb.UbbCode(v_remark)
        Else
        v_remark=Cls.Code_Read(v_remark)
        End if
        v_remark = KeyWord_Url(v_remark) '关键字显亮＋链接
        HtmlContent = Replace(HtmlContent,"{$remark}",v_remark)
		HtmlContent = Cls.ReHtml(HtmlContent,0)	
		If Cls.ChannelIsCreatHtml = True  and IsHtml=True then
		  Set Cfs=New Cls_FileSystem
		   '开始生成文件所在目录
		   vClassPath = Class_Path_Get(cid)
		   FilePath =  vClassPath & Cls.ShowDatePath(v_file, Cls.ChannelHtmlPath)
		   HtmlFileName = Cls.ReadFileName(v_file, v_id, Cls.ChannelHtmlExtName, Cls.ChannelHtmlPrefix, Cls.ChannelHtmlForm, 0)
		   CfS.CreateHtmlFile Cls.Web_Dir&Cls.ChannelDir,FilePath,HtmlFileName,HtmlContent
		   'Response.Write Cls.Web_Dir&Cls.ChannelDir&FilePath&HtmlFileName
                     'Response.End
                   set Cfs=nothing
		Else
		    If IsHtml=True Then
			    ShowChannelView = HtmlContent
	        Else
		        Response.Write HtmlContent
		   End If	
		End If
End Function

'//* 列表初始 *//
Public Sub LoadListFirst()
	Select Case action
	Case "pic"
		Call ShowChannelList(False,Cid,"","pic")
	Case "focus"
		Call ShowChannelList(False,Cid,"","focus")		
	Case "good"
		Call ShowChannelList(False,Cid,"","good")
	Case "hot"
		Call ShowChannelList(False,Cid,"","hot")
	Case "search"
		Call ShowChannelList(False,Cid,"","search")
	Case Else
		if int(cid)<1 then Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
		If Class_Child_Get(Cid)=0 Then
		Call ShowChannelList(False,Cid,"","List")
		Else
		Call ShowChannelLists(False,Cid)
		End If
	End Select
End Sub

Sub LoadChannelMainList(ListCid)
    Dim ListContent,ListContents
    Dim tmp1,ncid,ncname,mores
    Dim isdb,lablez,si,ji
	ListContents=""
	If Instr(HtmlContent,"[Repeat=1]") > 0 Then
	   isdb = False
	   lablez = "[Repeat=1]"
	ElseIf Instr(HtmlContent,"[Repeat=2]") > 0 Then
	   isdb =True
	   lablez = "[Repeat=2]"
	Else
	   Exit Sub
	End If
    ListContent = Cls.CutFixContent(HtmlContent, lablez , "[/Repeat]", 0)
	If ClassTrue Then
	ji=2
	
	for si=0 to ClassNum
		if int(ClassArr(2,si))=ListCid then
			ncid=Int(ClassArr(0,si))
			ncname=ClassArr(1,si)
			tmp1=""
			If Cls.ChannelIsCreatHtml = True then
			mores=Cls.Web_Dir & Cls.ChannelDir & "/"&ClassArr(8,si)&"index_1"&Cls.ChannelHtmlExtName
			Else
			mores="List.asp?c_id="&ncid
			End If
			
            ListContents=ListContents&ListContent 
			ListContents=Replace(ListContents,"{$ClassID}",ncid)
			ListContents=Replace(ListContents,"{$ClassName}",ncname)
			ListContents=Replace(ListContents,"{$more}",mores)
			ListContents=Replace(ListContents,"{$AsaiMHXml}",tmp_xml)
    		
    		
			
			ji=ji+1
		End If
    next
	
	Else
	ListContents="请先添加分类"
	End If
	HtmlContent=Replace(HtmlContent,lablez & ListContent&"[/Repeat]",ListContents)
	HtmlContent=Replace(HtmlContent,"{$ClassID}",ListCid)
    Call Html.LoadReplaced()
End Sub

'//* 音乐搜索 *//
Public Function LoadChannelSearch()
   If Instr(HtmlContent,"{$Search}")>0 then
   HtmlContent=Replace(HtmlContent,"{$Search}",format_nsort_sea(ChannelSort,img_skin("search"),Class_Select_Type(Cls.ChannelTit,Cls.ClassDepth,0),Cls.ChannelTit))
   End If
End Function

'//* 音乐导航 *//
Public Sub LoadChannelSort(tCid,tCtype)
	Dim TmpStr, TmpImg ,Tmpur1,tmpurl
	If Instr(HtmlContent,"{$SortList}")>0 then
		TmpImg="sort_c1"
		TmpStr="<li>"&VbCrlf
	    if action="pic" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/PicMusic/Index_1"&Cls.ChannelHtmlExtName
    	Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=pic"
	    End if	
		TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>图片"&Cls.ChannelTit&"</a></div>" & _
		VbCrlf&""
	    TmpImg="sort_c1"
    	if action="focus" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/FocusMusic/Index_1"&Cls.ChannelHtmlExtName
	    Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=focus"
        End if	
		TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>焦点"&Cls.ChannelTit&"</a></div>"&VbCrlf&"</li>" & _
		VbCrlf&"<li>"&VbCrlf
    	TmpImg="sort_c1"
	    if action="good" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/GoodMusic/Index_1"&Cls.ChannelHtmlExtName
	    Else
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=good"
	    End if	
		TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>推荐"&Cls.ChannelTit&"</a></div>" & _
		VbCrlf&""
	    TmpImg="sort_c1"
	    if action="hot" then TmpImg="sort_c2"
	    If Cls.ChannelIsCreatHtml = True then
	          Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/HotMusic/Index_1"&Cls.ChannelHtmlExtName
        Else
    	      Tmpurl=Cls.Web_Dir&Cls.ChannelDir&"/List.asp?Action=hot"
    	End if	
	    TmpStr=TmpStr&"<div class=slis>"&img_skin(TmpImg)&"<a href='"&Tmpurl&"'>热门"&Cls.ChannelTit&"</a></div>"&VbCrlf&"</li>"
		TmpStr=TmpStr&vbcrlf&LoadClass(tCid,tCtype,Cls.ChannelIsCreatHtml)
    	HtmlContent=Replace(HtmlContent,"{$SortList}","<ul>"&VbCrlf&Tmpstr&VbCrlf&"</ul>")
   End If
End Sub

'//* 频道专题列表 *//
Public Sub LoadChannelSpecial()
   If Instr(HtmlContent,"{$SpecialList}")>0 then
   	If Not Cls.SpecialTrue Then 
	HtmlContent=Replace(HtmlContent,"{$SpecialList}","没有专题")
	Exit Sub
	End If
	Dim Tmpstr, Sii
	Tmpstr = "<ul>"
	For Sii = 0 To Ubound(Cls.ChannelSpecial,2)
		Tmpstr = Tmpstr & "<li>"&img_skin("sort_c2")&"<a href='Special.asp?ID="&Cls.ChannelSpecial(0,Sii)&"'"
		If iSpecialID = Cls.ChannelSpecial(0,Sii) Then Tmpstr = Tmpstr & " class=red"
		Tmpstr = Tmpstr & ">"&Cls.ChannelSpecial(1,Sii)&"</a></li>"
	Next
	Tmpstr = Tmpstr & "</ul>"
   HtmlContent=Replace(HtmlContent,"{$SpecialList}",Tmpstr)
   End If
End Sub

'//* 专题初始 *//
Public Sub LoadSpecialFirst()
   SQL = "Select Top 1 * From [AsaiMHSpecial] Where ID="&iSpecialID
   Set Rs=Cls.Exec(SQL,1)
   If Rs.Eof Then
	  Rs.Close
	  Call Channel_Redirect(Cls.Web_Dir&Cls.ChannelDir)
   End If
   iSpecialTopic = Cls.Code_Html(Rs("topic"),1,0)
   iSpecialRemark = Rs("Remark")
   iSpecialTim = Cls.Time_Type(Rs("Tim"),1)
   Rs.Close
   Call ShowChannelList(False,Cid,"","special")
End Sub

'===============================================================
Function Music_List(i,b_id,b_cid,b_nid,b_top,b_sin,b_type)
  dim temp1
  temp1=temp1&vbcrlf&"<tr class=mbg_td align=center>" & _
             vbcrlf&"<td class=tims>"&i&"</td>" & _
             vbcrlf&"<td align=left>&nbsp;<img src='"&Cls.web_dir&"images/music/small_mp3_s.gif' border=0 align=absMiddle>&nbsp;<a alt='"&Cls.code_html(b_top,1,0)&"'>"&Cls.code_html(b_top,1,12)&"</a></td>" & _
             vbcrlf&"<td><a href='javascript:;' onclick=""javascript:open_view('/Music/Music_Singer_View.asp?c_id="&b_id&"',1);"">"&Cls.code_html(b_sin,1,0)&"</a></td>" & _
             vbcrlf&"<td><a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&Cls.ChannelDir&"/Play.asp?sid="&b_id&"','video_player',400,220,'no');""><img src='"&Cls.web_dir&"images/music/play.gif' border=0 alt='试听'></a></td>" & _
             vbcrlf&"<td><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/View.asp?action=Download&id="&b_id&"' target=_blank><img src='"&Cls.web_dir&"images/music/download.gif' border=0 alt='下载'></a></td>" & _
             vbcrlf&"<td><a href='javascript:;' onclick=""javascript:open_view('http://bf.sina.com.cn/cgi-bin/sms/srchring.cgi?key="&b_top&"',1);""><img src='"&Cls.web_dir&"images/music/Send.gif' border=0 width=16 height=16 alt='铃声'></a></td>" & _
             vbcrlf&"<td><a href='javascript:;' onclick=""javascript:open_view('http://mp3search.baidu.com/wstsearch?tn=baidump3lyric&ct=150994944&rn=10&word="&b_top&"');""><img src='"&Cls.web_dir&"images/music/book.gif' border=0 alt='歌词'></a></td>"
  if (b_type<>"msg") then temp1=temp1&"<td><a href='javascript:;' onclick=""javascript:open_win('/Music/Music_Send.asp?id="&b_id&"','music_send_win',640,430,'no');""><img src='"&Cls.web_dir&"images/music/smusic.gif' border=0 alt='点歌'></a></td>"
  if (b_type<>"fav") then temp1=temp1&"<td><a href='javascript:;' onclick=""javascript:open_view('/Music/Fav.asp?action=add&types=song&id="&b_id&"',1);""><img src='"&Cls.web_dir&"images/music/favadd.gif' border=0 alt='收藏'></a></td>"
       temp1=temp1&"<td><input type='checkbox' name=sid value='"&b_id&"'></td>" & _
             vbcrlf&"</tr>"
  music_list=temp1
End Function

Function Music_List_Top(iname,ttype,b_type)
  dim tablet,temp1
  select case ttype
    case 1
    tablet="class=mtb"
    case 0
    tablet="width=177"
  end select
  temp1=temp1&vbcrlf&"<table border=0 "&tablet&" cellspacing=0 cellpadding=0 align=center width='100%'>" & _
             vbcrlf&"<tr><td><img src='"&Cls.web_dir&"Skin/AsaiMH/sys/"&iname&".gif' border=0></td></tr>" & _
             vbcrlf&"<tr><td><table border=0 width='100%' cellspacing=1 cellpadding=3 class=mtable>" & _
             vbcrlf&"<form name=singer_listtype_frm action='/Music/Play.asp' target='music_play_win'>" & _
             vbcrlf&"<tr height=22 align=center>" & _
             vbcrlf&"<td width='7%' class=mtd>序号</td>" & _
             vbcrlf&"<td width='28%' class=mtd>歌曲名称</td>" & _
             vbcrlf&"<td width='16%' class=mtd>歌手</td>" & _
             vbcrlf&"<td width='7%' class=mtd>试听</td>" & _
             vbcrlf&"<td width='7%' class=mtd>下载</td>" & _
             vbcrlf&"<td width='7%' class=mtd>铃声</td>" & _
             vbcrlf&"<td width='7%' class=mtd>歌词</td>"
   if (b_type<>"msg") then temp1=temp1&"<td width='7%' class=mtd>点歌</td>"
   if (b_type<>"fav") then temp1=temp1&"<td width='7%' class=mtd>收藏</td>"
   temp1=temp1&"<td width='7%' class=mtd>选择</td></tr>"
  music_list_top=temp1
End Function

Function Music_List_End()
dim temp1
  temp1=temp1&vbcrlf&"<tr class=mbg_tds height=30 align=center><td colspan=10>" & _
             vbcrlf&"<input type=button name=chkall class=btn value=全部选择 onClick=""javascript:music_check_all(this.form);"" title=选择显示的所有歌曲>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & _
             vbcrlf&"<input type=button name=chkOthers class=btn value=反向选择 onClick=""javascript:music_check_other(this.form);"" title=反向选择歌曲>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" & _
             vbcrlf&"<input type=submit value=播放所选 title=请先选择你想听的歌曲后再点击连播 class=btn onClick=""javascript:music_check_play(this.form,'yes');"">" & _
             vbcrlf&"</td></tr>" & _
             vbcrlf&"</form>" & _
             vbcrlf&"</table></td></tr>" & _
             vbcrlf&"<tr><td background='"&Cls.web_dir&"Skin/AsaiMH/sys/center_song_end.gif' height=4></td></tr>" & _
             vbcrlf&"<tr><td height=5></td></tr>" & _
             vbcrlf&"</table>"
  music_list_end=temp1
End Function

Sub Music_Error(errs)
  if errs="" then
    response.write Cls.js_put("alert(""错误的ID参数：\n\n您勿向本站提交非法信息！"");window.close();",1)
  else
    response.write Cls.js_put("alert("""&errs&""");window.close();",1)
  end if
  session.Contents.Remove(Cls.web_cookies&"_music")
  call web_clear(1)
End Sub
'==============音乐专集列表函数======================
'                  List
'====================================================
Function Music_Music_List()
  dim Music_HtmlContent,Music_temp,i,obj_page,tmp_more
  i=0
  	Set obj_page=new Cls_PageCute 
	obj_page.pageurl="View.asp?id="&v_id&"&"			'链接
	obj_page.nummer=8					'调用个数
	obj_page.page_t=1									'两种样式
	obj_page.page_p=5									'翻页显示的个数
	obj_page.page_unit="首"
	obj_page.page_tit="歌曲"
	obj_page.v_id="id"
	Call obj_page.p_init("id,name,ClassID,n_id,singer,hits","AsaiMHMusicSong","d_id="&v_id&" and hidden=1 And ChannelIDs="&ChannelIDs&"","hits desc,id")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("id,name,ClassID,n_id,singer,hits","AsaiMHMusicSong","d_id="&v_id&" and hidden=1 And ChannelIDs="&ChannelIDs&"","hits desc,id")
	For i=1 To obj_page.page_num
	 Music_temp=Music_temp&music_list(i,rs("id"),rs("ClassID"),rs("n_id"),rs("name"),rs("singer"),"list")
		Rs.Movenext
	Next
	Rs.Close
  tmp_more="<table border=0 cellspacing=0 cellpadding=1 width='100%'><tr><td id=asaipage>"&obj_page.page_var&" "&obj_page.page_cute&""&obj_page.page_shortcut&"</td></tr></table>"
  Music_HtmlContent=Music_HtmlContent &Cls.ReadTemplate(9) 
  Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_music_list_top}",music_list_top("center_song_disk",1,"new"))
  Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_music_list}",Music_temp)
  Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_tmp_more}",tmp_more)
  Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_music_list_end()}",music_list_end())
  Music_Music_List=Music_HtmlContent
  End Function
'---------------------------------------添加收藏夹------------------------------------
  Sub Music_add_fav()
  if login_username="" then   response.write Cls.js_put("alert(""错误提示：您还没有登陆,不能收藏！"");window.opener=null;window.close();",1)
  Dim f_num,max_num,favname,singer,c_id,n_id,favpic,favtim,favcom,favlang
  sql="select * from AsaiMHMusicFav where username='"&login_username&"' and f_id="&iSpecialID
  set rs=Cls.exec(sql,1)
  if not rs.eof then
    response.clear
    response.write Cls.js_put("alert(""错误提示：您已经收藏过此"&t_name&"！"");window.opener=null;window.close();",1)
  else
    rs.close
    sql="select count(id) from AsaiMHMusicFav where username='"&login_username&"'"
    set rs=Cls.exec(sql,1)
    f_num=rs(0)
    rs.close
    max_num=Music_Favnum
    call convert_load(login_mode)
    max_num=format_convert(max_num,"+")
    if f_num >= max_num then 
      response.clear
      response.write Cls.js_put("alert(""错误提示：很抱歉的通知您，您的"&t_name&"收藏夹已满，不能再收藏"&t_name&"。"");window.opener=null;window.close();",1)
      response.end
    end if
    sql="select * from "&sql_add&" where id="&iSpecialID
    set rs=Cls.exec(sql,1)
    if (rs.EOF and rs.BOF) then
      response.clear
      response.write Cls.js_put("alert(""错误提示：请正确选择"&t_name&"！"");window.opener=null;window.close();",1)
    else
      favname=rs("name")
      singer=rs("Singer")
      c_id=rs("ClassID")
      n_id=rs("n_id")
	  if t_type="disk" then
      favpic=rs("pic")
      favtim=rs("ptim")
      favcom=rs("pcom")
      favlang=rs("lang")
      end if
    end if
    rs.close
    sql="select * from AsaiMHMusicFav"
    call Cls.exec(sql,-1)
    rs.open sql,conn,1,3
    rs.AddNew
    rs("userName")=login_username
    rs("f_id")=iSpecialID
    rs("name")=favname
    rs("singer")=singer
    rs("ClassID")=c_id
    rs("n_id")=n_id
    rs("f_type")=t_type
	if t_type="disk" then
    rs("pic")=favpic
    rs("tim")=favtim
    rs("Company")=favcom
    rs("lang")=favlang
    end if
    rs.Update
    response.clear
    response.write Cls.js_put("alert(""恭喜您，已成功收藏"&t_name&"！"");window.opener=null;window.close();",1)
  end if
  rs.Close
  response.end
End Sub

'---------------------------------------删除收藏夹------------------------------------
Sub Music_del_fav()
  dim sel_id,sdim,snum,del_type
    sel_id=trim(request.form("sel_id"))
    sel_id=replace(sel_id," ","")
    if sel_id="" then
      call web_js_msg(1,"收藏夹中没有可删除的收藏！","?action=mana&types="&types)
    end if
  sdim=split(sel_id,",")
  snum=ubound(sdim)
  for i=0 to snum
    if isnumeric(sdim(i)) then
      sql="delete from AsaiMHMusicFav where id="&sdim(i)
      call Cls.exec(sql,0)
    end if
  next
  erase sdim
  call web_js_msg(1,"已从收藏夹中成功删除"&(snum+1)&"条收藏！","?action=mana&types="&types)
End Sub

Public Function Music_Fav_View(Vid,IsHtml)
dim Music_HtmlContent
types=Request.QueryString ("types")
HtmlContent=HtmlContent &Cls.ReadTemplate(11)
HtmlContent=Replace(HtmlContent,"{$music_fav_csy}",music_fav_csy) 
    select case action
    case "song"
      sql_add=" f_type='song' and username='"&login_username&"'"
      t_name="歌曲"
      HtmlContent=Replace(HtmlContent,"{$Music_Music}",music_fav_list) 
      HtmlContent=Replace(HtmlContent,"{$Music_Music_Disk}","") 
      HtmlContent=Replace(HtmlContent,"{$Music_Music_Song}","") 
    case "disk"
      sql_add="  f_type='disk' and username='"&login_username&"'"
      t_name="专辑"
      HtmlContent=Replace(HtmlContent,"{$Music_Music}",music_fav_list) 
      HtmlContent=Replace(HtmlContent,"{$Music_Music_Disk}","") 
      HtmlContent=Replace(HtmlContent,"{$Music_Music_Song}","") 
    case "add"
      if types="song" then
        t_name="歌曲"
        t_type="song"
        sql_add="AsaiMHMusicDisk"
      else
        t_name="专辑"
        t_type="disk"
        sql_add="AsaiMHMusicDisk"
      end if
      'HtmlContent=Replace(HtmlContent,"{$Music_Music}",music_add_fav) 
      call music_add_fav()
    case "delete"
      'HtmlContent=Replace(HtmlContent,"{$Music_Music}",music_del_fav) 
     call music_del_fav()
    case "mana"
      if types="song" then
        t_name="歌曲"
        t_type="song"
        sql_add="  f_type='song' and username='"&login_username&"'"
      else
        t_name="专辑"
        t_type="disk"
        sql_add=" f_type='disk' and username='"&login_username&"'"
      end if
        HtmlContent=Replace(HtmlContent,"{$Music_Music}",music_mana_fav)
        HtmlContent=Replace(HtmlContent,"{$Music_Music_Disk}","") 
        HtmlContent=Replace(HtmlContent,"{$Music_Music_Song}","") 
    case else
        HtmlContent=Replace(HtmlContent,"{$Music_Music_Disk}",music_fav_disk) 
        HtmlContent=Replace(HtmlContent,"{$Music_Music_Song}",music_fav_song)
        HtmlContent=Replace(HtmlContent,"{$Music_Music}","")  
    end select
  '载入模板函数
    '载入模板函数
  Call LoadChannelSort(Cid,1)
  Call LoadChannelSearch()
  Call LoadChannelSpecial()
  Call Html.LoadReplaced()
  HtmlContent = Replace(HtmlContent,"{$ClassID}",cid)
  HtmlContent = Html.ReadWebHead(HtmlContent)
  HtmlContent = Html.ReadWebEnd(HtmlContent)
  HtmlContent = Html.ReadUserLogin(HtmlContent)
  HtmlContent = Html.ReadMusicList(HtmlContent)
  HtmlContent = Html.ReadMusicPic(HtmlContent)
  HtmlContent = Html.ReadRelateList(HtmlContent,ChannelIDs,v_id,v_keyes,Cls.ChannelIsCreatHtml)  
  HtmlContent = Html.ReadChannelMenu(HtmlContent)
  HtmlContent = Html.ReadCast(HtmlContent)
  HtmlContent = Cls.ReHtml(HtmlContent,0)	
  response.write HtmlContent
End Function

Function Music_bar_top(iname,ttype)
  dim tablet,tabled,tablel,temp1
  select case ttype
    case 1
    tablet="class=mtb"
	tabled=" "
	tablel="cellspacing=0 cellpadding=0"
    case 0
    tablet="width=177"
	tabled="<tr><td height=5></td></tr>"
	tablel="cellspacing=1 cellpadding=2"
  end select
  temp1=temp1&vbcrlf&"<table border=0 "&tablet&" cellspacing=0 cellpadding=0 align=center>" & _
             vbcrlf&"<tr><td><img src='"&Cls.web_dir&"images/music/"&iname&".gif' border=0></td></tr>" & _
             vbcrlf&""&tabled&"" & _
             vbcrlf&"<tr><td>" & _
             vbcrlf&"<table border=0 width='100%' "&tablel&">"
  music_bar_top=temp1
End Function

'--------------------------------------管理收藏夹------------------------------------
Function Music_Mana_Fav()
Dim obj_page,Music_tmp1,Music_Top,Music_End,Music_Form,Music_HtmlContent,Types,sql_add,Music_More
  Music_Form="<form name=del_form action='?action=delete&types="&types&"' method=post>"  
  	Set obj_page=new Cls_PageCute 
	obj_page.pageurl="?"			'链接
	obj_page.nummer=8					'调用个数
	obj_page.page_t=1									'两种样式
	obj_page.page_p=5									'翻页显示的个数
	obj_page.page_unit="首"
	obj_page.page_tit="歌曲"
	obj_page.v_id="id"
	Call obj_page.p_init("id,name,singer","AsaiMHMusicFav",""&sql_add&"","id desc,id")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	Call obj_page.p_main("id,name,singer","AsaiMHMusicFav",""&sql_add&"","id desc,id")
	For i=1 To obj_page.page_num
    n_topic=rs("name")
    n_topic=Cls.code_js(n_topic,1)
    Music_tmp1=Music_tmp1&vbcrlf&"<tr height=24 align=center class=tr>" & _
                          vbcrlf&"<td class=tims>"&i&"</td>" & _
                          vbcrlf&"<td align=left>"&n_topic&"</td>" & _
                          vbcrlf&"<td>"&rs("singer")&"</td>" & _
                          vbcrlf&"<td colspan=2><input type=checkbox name=sel_id value='"&rs("id")&"'></td>" & _
                          vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
  set rs=nothing
   Music_More=vbcrlf&"<tr class=bg_tds height=30>" & _
             vbcrlf&"<td colspan=2>"&obj_page.page_var&"分页："&obj_page.page_cute&" "&obj_page.page_shortcut&"" & _
             vbcrlf&"<td align=center><input type=checkbox name=sel_all value='yes' onclick='javascript:select_all(this.form);' class=bg_tds>所有<input type=submit  class=btn value='删除所选' onclick=\""return sel_click(this.form);\""></td>" & _
             vbcrlf&"</tr>"
      Music_HtmlContent=Music_HtmlContent &Cls.ReadTemplate(10)
      Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_top}",music_bar_top("center_disk_fav",1))  
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_Form}",Music_Form) 
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_tmp1}",Music_tmp1) 
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_More}",Music_More) 
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_End}",music_bar_end) 
      Music_Mana_Fav=Music_HtmlContent
End Function

Function Music_bar_end()
  dim temp1
  temp1=temp1&vbcrlf&"</table>" & _
             vbcrlf&"</td></tr>" & _
             vbcrlf&"<tr><td height=3></td></tr>" & _
             vbcrlf&"</table>"
  music_bar_end=temp1
End Function

Function Music_fav_disk()
Dim Music_HtmlContent,li,tmp,n_id,n_pic,n_topic2
  sql="select top 6 * from AsaiMHMusicFav where f_type='disk' and username='"&login_username&"' order by id desc"
  set rs=Cls.exec(sql,1)
  do while not rs.eof
    if (li mod 2)=0 then tmp=tmp&"<tr valign=top>"
    n_id=rs("id")
	n_pic=rs("pic")
    n_topic=rs("Name")
    n_topic=Cls.code_js(n_topic,1)
    n_topic2=rs("singer")
    n_topic2=Cls.code_js(n_topic2,1)
	tmp=tmp&"<td width='50%'>"&music_disk_list(n_pic,n_id,rs("ClassID"),rs("n_id"),n_topic,n_topic2,rs("Company"),rs("lang"),rs("tim"))&"</td>"
     if (li mod 2)>0 then tmp=tmp&"</tr>"
  rs.movenext
  li=li+1
  loop
  rs.close
  tmp=tmp&"<td width='50%'></td></tr>"
      Music_HtmlContent=Music_HtmlContent &Cls.ReadTemplate(12)
      Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_top}",music_bar_top("center_disk_fav",1))
      Music_HtmlContent=Replace(Music_HtmlContent,"{$tmp}",tmp)
      Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_end}",music_bar_end)
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_bar_end}","")
music_fav_disk=Music_HtmlContent
End Function

Function Music_disk_list(b_pic,b_id,b_cid,b_nid,b_top,b_sin,b_can,b_lan,b_tim)
  dim temp1
  temp1=temp1&vbcrlf&"<table border=0>" & _
             vbcrlf&"<tr>" & _
             vbcrlf&"<td width='35%' align=center>"&pic_fk(b_pic,1,Cls.web_dir&"/Music/Music_Disk_View.asp?id="&b_id)&"</td>" & _
             vbcrlf&"<td width='65%'><table border=0>" & _
             vbcrlf&"<tr><td>名称：<a href='javascript:;' onclick=""javascript:open_view('Music_Disk_View.asp?id="&b_id&"',1);"" alt='"&Cls.code_html(b_top,1,0)&"'>"&Cls.code_html(b_top,1,8)&"</a></td></tr>" & _
             vbcrlf&"<tr><td>歌手：<a href='javascript:;' onclick=""javascript:open_view('Music_Singer_View.asp?c_id="&b_cid&"&n_id="&b_nid&"',1);"">"&Cls.code_html(b_sin,1,0)&"</a></td></tr>" & _
             vbcrlf&"<tr><td>公司："&b_can&"</td></tr>" & _
             vbcrlf&"<tr><td>语言："&b_lan&"</td></tr>" & _
             vbcrlf&"<tr><td>发行：<font class=tims>"&b_tim&"</font></td></tr>" & _
             vbcrlf&"</table></td>" & _
             vbcrlf&"</tr>" & _
             vbcrlf&"</table>"
  music_disk_list=temp1
End Function

Function Music_fav_song()
Dim Tmp,Music_HtmlContent
  i=0
  sql="select top 10 * from AsaiMHMusicFav where f_type='song' and username='"&login_username&"' order by id desc"
  set rs=Cls.exec(sql,1)
  do while not rs.eof
  i=i+1
	Tmp=Tmp&music_list(i,rs("f_id"),rs("ClassID"),rs("n_id"),rs("Name"),rs("singer"),"fav")
  rs.movenext
  loop
  rs.close 
      Music_HtmlContent=Music_HtmlContent &Cls.ReadTemplate(12)
      Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_top}",music_list_top("center_song_fav",1,"fav"))
      Music_HtmlContent=Replace(Music_HtmlContent,"{$tmp}",tmp)
      Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_end}",music_list_end)
      Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_bar_end}","")
      music_fav_song=Music_HtmlContent
End Function

Function Music_fav_csy()
 dim temp1 
  temp1=temp1&vbcrlf&"<table border=0 width=177 cellspacing=0 cellpadding=0 align=center>" & _
             vbcrlf&"<tr><td><img src='"&Cls.web_dir&"images/music/left_fav.gif' border=0></td></tr>" & _
             vbcrlf&"<tr><td height=5></td></tr><tr><td>" & _
             vbcrlf&"<table border=0 width='80%' align=center>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Fav.asp?'>我的收藏夹</a>&nbsp;<font class=Gys>首页</font></td></tr>" & _
             vbcrlf&"<tr><td height=5></td></tr>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Fav.asp?action=song'>我收藏的音乐</a>&nbsp;<a href='Fav.asp?action=mana&types=song' title='管理我收藏的音乐' class=Gys>管理</a></td></tr>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Fav.asp?action=disk'>我收藏的专辑</a>&nbsp;<a href='Fav.asp?action=mana&types=disk' title='管理我收藏的专辑' class=Gys>管理</a></td></tr>" & _
             vbcrlf&"</table></td></tr><tr><td height=3></td></tr></table>"
  music_fav_csy=temp1
End Function

Function Music_mail_csy()
 dim temp1 
  temp1=temp1&vbcrlf&"<table border=0 width=177 cellspacing=0 cellpadding=0 align=center>" & _
             vbcrlf&"<tr><td><img src='"&Cls.web_dir&"images/music/left_mail.gif' border=0></td></tr>" & _
             vbcrlf&"<tr><td height=5></td></tr><tr><td>" & _
             vbcrlf&"<table border=0 width='80%' align=center>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Music_Mail.asp'>我的点歌机</a>&nbsp;<font class=Gys>首页</font></td></tr>" & _
             vbcrlf&"<tr><td height=5></td></tr>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Music_Mail.asp?action=send_in'>我收到的歌曲</a></td></tr>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Music_Mail.asp?action=send_out'>我送出的歌曲</a></td></tr>" & _
             vbcrlf&"</table></td></tr><tr><td height=3></td></tr></table>"
  music_mail_csy=temp1
End Function

'------------------------------------------收藏夹列表------------------------------------
Function Music_fav_list()   
Dim li,obj_page,Tmp,Music_HtmlContent
  	Set obj_page=new Cls_PageCute 
	obj_page.pageurl="?"			'链接
	obj_page.nummer=8					'调用个数
	obj_page.page_t=1									'两种样式
	obj_page.page_p=5									'翻页显示的个数
	obj_page.page_unit="首"
	obj_page.page_tit="歌曲"
	obj_page.v_id="id"
	Call obj_page.p_init("id,name,singer,f_id,n_id,ClassID,pic,Company,tim,lang","AsaiMHMusicFav",""&sql_add&"","id desc,id")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	numusic_perent=formatpercent(obj_page.rssum/Music_Favnum,1)
	Call obj_page.p_main("id,name,singer,f_id,n_id,ClassID,pic,Company,tim,lang","AsaiMHMusicFav",""&sql_add&"","id desc,id")
	For i=1 To obj_page.page_num
    if t_name="歌曲" then
    tmp=tmp&music_list(i,rs("f_id"),rs("ClassID"),rs("n_id"),rs("name"),rs("singer"),"fav")
    else
    if (li mod 2)=0 then tmp=tmp&"<tr valign=top>"
	tmp=tmp&"<td width='50%'>"&music_disk_list(rs("pic"),rs("id"),rs("ClassID"),rs("n_id"),rs("name"),rs("singer"),rs("Company"),rs("lang"),rs("tim"))&"</td>"
    if (li mod 2)>0 then tmp=tmp&"</tr>"
    end if
    rs.movenext
	li=li+1
  next
  rs.close
  set rs=nothing  
      Music_HtmlContent=Music_HtmlContent &Cls.ReadTemplate(12)
  if t_name="专辑" then tmp=tmp&"<td width='50%'></td></tr>" 
  if t_name="歌曲" then 
   Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_top}",music_list_top("center_song_fav",1,"fav"))
   Music_HtmlContent=Replace(Music_HtmlContent,"{$tmp}",tmp)
   Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_end}",music_list_end)
   else
   Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_top}",music_bar_top("center_disk_fav",1))
   Music_HtmlContent=Replace(Music_HtmlContent,"{$tmp}",tmp)
   Music_HtmlContent=Replace(Music_HtmlContent,"{$music_bar_end}",music_bar_end)
  end if
  Music_HtmlContent=Replace(Music_HtmlContent,"{$Music_bar_end}",music_fav_end(obj_page.rssum,numusic_perent,obj_page.page_var,obj_page.page_cute))
music_fav_list=Music_HtmlContent
End Function

Function Music_fav_end(rssum,perent,page_var,page_cute)
Dim tmp1
        tmp1=vbcrlf&"<table><tr height=30><td colspan=5 align=center>" & _
             vbcrlf&"<table cellpadding=0 border=0 cellspacing=0><tr>" & _
             vbcrlf&"<td><font color=red><b>[注]：</b></font>您可以收藏的"&t_name&"数为&nbsp;<font color=red>"&Music_Favnum&"</font>&nbsp;，目前已有&nbsp;<font color=red>"&rssum&"</font>&nbsp;条，占<font color=red>"&perent&"</font>：</td>" & _
             vbcrlf&"<td><table cellpadding=0 border=0 cellspacing=0 style='background-color:white; border: #104a7b 1px solid; padding-right: 0px; padding-left: 0px; padding-bottom: 2px; padding-top: 2px;'>" & _
             vbcrlf&"<tr><td width=120><div style='height:5px; width:"&perent&"; font-size:1px; background-color:#76D769'></div></td></tr>" & _
             vbcrlf&"</table></td>" & _
             vbcrlf&"</tr></table>" & _
             vbcrlf&"</td></tr></table>" & _
             vbcrlf&"<table class=mtb>" & _
             vbcrlf&"<tr>" & _
             vbcrlf&"<td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<font class=blue><b>音乐收藏夹</b></font>&nbsp;&nbsp;&nbsp;"&page_var&"分页："&page_cute&"</td>" & _
             vbcrlf&"</tr>" & _
             vbcrlf&"</table>"
    music_fav_end=tmp1         
End Function

Public Function Music_Mail_View(Vid,IsHtml)
dim Music_HtmlContent,actions,action_temp2
actions=trim(request.querystring("actions"))
HtmlContent=HtmlContent &Cls.ReadTemplate(13)
if action="send_out" then 
HtmlContent=Replace(HtmlContent,"{$Music_Mail_Bar}",music_bar_top("center_mail_out",1)) 
else
HtmlContent=Replace(HtmlContent,"{$Music_Mail_Bar}",music_bar_top("center_mail_in",1)) 
end if
select case actions
  case "clear"
    call music_mail_clear()
  case "del"
    call music_mail_delete(1)
  case "delete"
    call music_mail_delete(0)
  case else
    select case action
      case "send_in"
        action_temp2="来自"
        HtmlContent=Replace(HtmlContent,"{$Music_Mail_Box}",music_mail_box) 
      case "send_out"
        action_temp2="送给"
       HtmlContent=Replace(HtmlContent,"{$Music_Mail_Box}",music_mail_box)
      case "msg_view"
       HtmlContent=Replace(HtmlContent,"{$Music_Mail_Box}",Music_Msg_View)
      case else
        action="send_in"
        action_temp2="来自"
        HtmlContent=Replace(HtmlContent,"{$Music_Mail_Box}",music_mail_box)
    end select
end select
  '载入模板函数
    '载入模板函数
  Call LoadChannelSort(Cid,1)
  Call LoadChannelSearch()
  Call LoadChannelSpecial()
  Call Html.LoadReplaced()
  HtmlContent = Replace(HtmlContent,"{$ClassID}",cid)
  HtmlContent = Replace(HtmlContent,"{$music_mail_csy}",music_mail_csy)
  HtmlContent = Html.ReadWebHead(HtmlContent)
  HtmlContent = Html.ReadWebEnd(HtmlContent)
  HtmlContent = Html.ReadUserLogin(HtmlContent)
  HtmlContent = Html.ReadMusicList(HtmlContent)
  HtmlContent = Html.ReadMusicPic(HtmlContent)
  HtmlContent = Html.ReadRelateList(HtmlContent,ChannelIDs,v_id,v_keyes,Cls.ChannelIsCreatHtml)  
  HtmlContent = Html.ReadChannelMenu(HtmlContent)
  HtmlContent = Html.ReadCast(HtmlContent)
  HtmlContent = Cls.ReHtml(HtmlContent,0)	
  response.write HtmlContent
End Function

'---------------------------------点歌单-------------------------------
Function Music_mail_box()
Dim obj_page,numusic_perent,isread,action_temp2,name_temp,read_pic,action_temp
'============================
if not isnumeric(iSpecialID) then iSpecialID=0
if action="send_in" or action="msg_view" or action="" then
  sql_add=" r_user='"&login_username&"'"
  action_temp="收歌箱"
end if
if action="send_out" then
  sql_add=" s_user='"&login_username&"'"
  action_temp="点歌箱"
end if
  	Set obj_page=new Cls_PageCute 
	obj_page.pageurl="?action="&action&"&"			'链接
	obj_page.nummer=8					'调用个数
	obj_page.page_t=1									'两种样式
	obj_page.page_p=5									'翻页显示的个数
	obj_page.page_unit="首"
	obj_page.page_tit="歌曲"
	obj_page.v_id="id"
	Call obj_page.p_init("id","AsaiMHMusicMail",""&sql_add&"","id desc,id")
	SQL = obj_page.sql_count
	Set rs=Cls.Exec(SQL,1)
	obj_page.rssum=rs(0)
	Rs.Close
	numusic_perent=formatpercent(obj_page.rssum/Music_Mailnum,1)
  temp1=temp1&"<table width='100%'><tr><td height=0><table border=0 cellspacing=1 cellpadding=1 class=mtable width='100%'>" & _
             vbcrlf&"<form name=del_form action='?actions=delete&action="&action&"' method=post>" & _
             vbcrlf&"<tr height=24 class=bg_tds align=center>" & _
             vbcrlf&"<td width='6%' background='"&Cls.web_dir&"images/music/bg_td.gif'>状态</td>" & _
             vbcrlf&"<td width='16%' background='"&Cls.web_dir&"images/music/bg_td.gif'>"&action_temp2&"</td>" & _
             vbcrlf&"<td width='58%' background='"&Cls.web_dir&"images/music/bg_td.gif'>歌曲名称</td>" & _
             vbcrlf&"<td width='14%' background='"&Cls.web_dir&"images/music/bg_td.gif'>发送日期</td>" & _
             vbcrlf&"<td width='6%' background='"&Cls.web_dir&"images/music/bg_td.gif'>操作</td>" & _
             vbcrlf&"</tr>"
  Call obj_page.p_main("id,s_user,r_user,isread,m_name,tim","AsaiMHMusicMail",""&sql_add&"","id desc,id")
  For i=1 To obj_page.page_num
      if action="send_in" then
        name_temp=rs("s_user")
      elseif action="send_out" then
        name_temp=rs("r_user")
      end if
      isread=rs("isread")
      if isread=true then
        read_pic="state_old"
      else
        read_pic="state_new"
      end if
    temp1=temp1&"<tr height=24 align=center class=mbg_td>" & _
             vbcrlf&"<td><img src=/Skin/Skin_1/mail/"&read_pic&".gif border=0></td>" & _
             vbcrlf&"<td><a href=/User/View.asp?username="&name_temp&">"&name_temp&"</a></td>" & _
             vbcrlf&"<td><a href='javascript:;' onclick=javascript:open_view('?action=msg_view&id="&rs("id")&"',1);>"&rs("m_name")&"</a></td>" & _
             vbcrlf&"<td><font class=tims>"&Cls.time_type(rs("tim"),3)&"</font></a></td>" & _
             vbcrlf&"<td><input type=checkbox name=sel_id value='"&rs("id")&"'></td>" & _
             vbcrlf&"</tr>"
    rs.movenext
  next
  rs.close
  set rs=nothing
 temp1=temp1&"<tr class=bg_tds height=30>" & _
             vbcrlf&"<td colspan=5 align=center>" & _
             vbcrlf&"<table border=0 cellspacing=0 cellpadding=2>" & _
             vbcrlf&"<tr>" & _
             vbcrlf&"<td><font class=Gys>（请删除无用信息以节省空间）</font></td>" & _
             vbcrlf&"<td><input type=checkbox name=sel_all value='yes' onclick=""javascript:select_all(this.form);"" class=bg_tds>所有</td><td><input type=submit value='删除所选' onclick=""return sel_click(this.form);""></td>" & _
             vbcrlf&"<td><input type=button onclick=""javascript:mail_clear();"" value='清空"&action_temp&"'></td>" & _
             vbcrlf&"</tr>" & _
             vbcrlf&"</table>" & _
             vbcrlf&"</td>" & _
             vbcrlf&"</tr>" & _
             vbcrlf&"</form>" & _
             vbcrlf&"</table></td></tr>" 
 temp1=temp1&"<tr height=30><td colspan=5 align=center>" & _
             vbcrlf&"<table cellpadding=0 border=0 cellspacing=0>" & _
             vbcrlf&"<tr>" & _
             vbcrlf&"<td><font color=red><b>[注]：</b></font>您的"&action_temp&"可以存储&nbsp;<font color=red>"&Music_Mailnum&"</font>&nbsp;条点歌信息，目前已有&nbsp;<font color=red>"&obj_page.rssum&"</font>&nbsp;条，占<font color=red>"&numusic_perent&"</font>：</td>" & _
             vbcrlf&"<td>" & _
             vbcrlf&"<table cellpadding=0 border=0 cellspacing=0 style='background-color:white; border: #104a7b 1px solid; padding-right: 0px; padding-left: 0px; padding-bottom: 2px; padding-top: 2px;'>" & _
             vbcrlf&"<tr><td width=120><div style='height:5px; width:"&numusic_perent&"; font-size:1px; background-color:#76D769'></div></td></tr>" & _
             vbcrlf&"</table>" & _
             vbcrlf&"</td>" & _
             vbcrlf&"</tr>" & _
             vbcrlf&"</table>" & _
             vbcrlf&"</td></tr>" & _
             vbcrlf&"<tr height=30>" & _
             vbcrlf&"<td colspan=5>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<font class=blue><b>音乐点歌机</b></font>&nbsp;&nbsp;&nbsp;"&obj_page.page_var&"分页："&obj_page.page_cute&"</td>" & _
             vbcrlf&"</tr>"
  music_mail_box=temp1
End Function

Function Music_mail_csy()
 dim temp1 
  temp1=temp1&vbcrlf&"<table border=0 width=177 cellspacing=0 cellpadding=0 align=center>" & _
             vbcrlf&"<tr><td><img src='"&Cls.web_dir&"images/music/left_mail.gif' border=0></td></tr>" & _
             vbcrlf&"<tr><td height=5></td></tr><tr><td>" & _
             vbcrlf&"<table border=0 width='80%' align=center>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Mail.asp'>我的点歌机</a>&nbsp;<font class=Gys>首页</font></td></tr>" & _
             vbcrlf&"<tr><td height=5></td></tr>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Mail.asp?action=send_in'>我收到的歌曲</a></td></tr>" & _
             vbcrlf&"<tr><td>&nbsp;<img src='"&Cls.web_dir&"images/music/s_fav_left.gif' align=absMiddle border=0>&nbsp;<a href='Mail.asp?action=send_out'>我送出的歌曲</a></td></tr>" & _
             vbcrlf&"</table></td></tr><tr><td height=3></td></tr></table>"
  music_mail_csy=temp1
End Function

Function Music_Msg_View()
Dim word
    sql="select * from AsaiMHMusicMail where id="&iSpecialID
    set rs=Cls.exec(sql,1)
    if rs.eof or rs.bof then
    response.write Cls.js_put("alert(""错误的ID参数：\n\n数据库中没有这首点歌！"");window.opener=null;window.close();",1)
    Response.end
    else
      if rs("s_user")<>login_username and rs("r_user")<>login_username then
        response.write Cls.js_put("alert(""错误的ID参数：\n\n这首歌好象与您无关哦！"");window.opener=null;window.close();",1)
        Response.end
      end if
    end if
    rs.close
    sql="select * from AsaiMHMusicMail where id="&iSpecialID
    call Cls.exec(sql,-1)     
    rs.Open sql,conn,1,3
    word=Cls.code_html(rs("words"),2,0)
    word=Ubb.UbbCode(word)
    temp1=temp1&"<table><tr><td height=0><table border=0 cellspacing=1 cellpadding=1 class=mtable>" & _
             vbcrlf&"<form name=music_frm action='Music_Pass.asp?id="&rs("m_id")&"' method=post target=hiddenframe><input type=hidden name='send_user' value='"&rs("s_user")&"'><input type=hidden name='pay_num' value='"&int(rs("paynum")*100)&"'>" & _
             vbcrlf&"<tr class=bg_td height=24><td align=center><b>歌曲名称：<font class=red2>"&rs("m_name")&"</font></b></td></tr>" & _
             vbcrlf&"<tr class=bg_td height=100><td align=center>" & _
             vbcrlf&"<table border=0 width='96%' class=tf>" & _
             vbcrlf&"<tr><td class=bw>"&word&"</td></tr>" & _
             vbcrlf&"</table>" & _
             vbcrlf&"</td></tr>" & _
             vbcrlf&"<tr class=bg_td height=24><td>&nbsp;&nbsp;收听这首歌曲需要&nbsp;<font color=red>"&rs("emoney")&"</font>&nbsp;"& Cls.web_unit&"&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:;' onclick=javascript:music_play('0','"&rs("power")&"');><font color=red>我要收听</font></a></td></tr>" & _
             vbcrlf&"<tr height=24 class=bg_tds><td align=center>以上是&nbsp;[&nbsp;"&rs("s_user")&"&nbsp;]&nbsp;于&nbsp;<font class=blue>"&rs("tim")&"</font>&nbsp;给您点的歌曲信息</td></tr>" & _
             vbcrlf&"</form>" & _
             vbcrlf&"</table></td></tr>" 
    rs("isread")=1
    rs.update
    rs.close
   Music_Msg_View=temp1
End Function
%>
