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

Dim ViewData			'浏览数据数组
Dim iSpecialID,ShowChannelDownload
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_rekoe
Dim iSpecialTopic, iSpecialRemark, iSpecialTim
Dim StrDownLoadUrl,DownLoadUrl,UrlID

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.ReadMovieList(HtmlContent)
		HtmlContent = Html.ReadMoviePic(HtmlContent)
		HtmlContent = Html.ReadMoviePic2(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.ReadMovieList(HtmlContent)
		HtmlContent = Html.ReadMoviePic(HtmlContent)
		HtmlContent = Html.ReadMoviePic2(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.counter>20"
      tmp_sql_order="A.counter desc"
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=hot' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
  Case "good"
      mhead=tit
      tmp_sql="A.isgood=1"
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=good' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
  Case "focus"
      mhead=tit
      tmp_sql="A.isfocus=1"
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=focus' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
  Case "pic"
      mhead=tit
      tmp_sql="A.ispic=1"	
	If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=pic' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"  	  
  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
	 If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?action=special&id="&iSpecialID&"' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"	  
  Case Else
	  if int(ClsID)>0 then tmp_sql="A.ClassID="&ClsID
	  mhead=tit
	  If Cls.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&ClsID&"' target=_blank><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"	
  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.counter Desc"
  Case "star"
    tmp_sql_order="A.star 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.counter"
  tmp_sql=tmp_sql&" And A.ChannelIDs="&ChannelIDs
  call obj_page.p_init("","["&Cls.ChannelTable&"] 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.Ispic,A.Pic,A.types,A.genre,A.role,A.star,A.lang,A.counter,A.remark,A.username,A.Tim,A.isgood,A.isfocus,A.istop,A.HtmlFileDate,C.ClassName,C.HtmlFileDir","["&Cls.ChannelTable&"] 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
				Select Case rs("Types")
				Case "mtv" : mTypes="MTV"
				Case "music" : mTypes="歌曲"
				Case Else : mTypes="影片"
				End Select
				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 & " class=""ig"">"												
				'前标
				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("counter") & "'>" & sTitle & "</a>"
				Tempstr = ListContent
				Tempstr = Replace(Tempstr, "{$MovieTopic}", ArticleTopic)
				Tempstr = Replace(Tempstr, "{$MovieID}", Rs("ID"))
				Tempstr = Replace(Tempstr, "{$MovieTitle}", sTitle)
				Tempstr = Replace(Tempstr, "{$Title}", Rs("name"))
				Tempstr = Replace(Tempstr, "{$Date}", Rs("tim"))
				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, "{$MovieHits}", Rs("counter"))
				Tempstr = Replace(Tempstr, "{$ListStyle}", ListStyle)
				Tempstr = Replace(Tempstr, "{$BestCode}", BestCode)
				Tempstr = Replace(Tempstr, "{$BestString}", BestString)
				Tempstr = Replace(Tempstr, "{$MovieRoles}", rs("role"))
				Tempstr = Replace(Tempstr, "{$MovieTypes}", mTypes)
				Tempstr = Replace(Tempstr, "{$MovieGenre}", rs("genre"))
				Tempstr = Replace(Tempstr, "{$MovieStar}", rs("Star"))
				Tempstr = Replace(Tempstr, "{$MovieLang}", rs("Lang"))
				Tempstr = Replace(Tempstr, "{$MoviePic}",  Cls.GetPic("<a href='" & HtmlFileUrl & "' title='" & Rs("name") & "'" & LinkTarget & ">" & ImageUrl & "</a>"))
				Tempstr = Replace(Tempstr, "{$MovieRemark}", Cls.Code_Cut(rs("remark"),180))
				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,"{$mhead}", mhead)
		HtmlContent = Replace(HtmlContent,"{$Channel_Xml}", ChannelRss)
				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&"<option value='star'"
           if taxis="star" 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.ReadMovieList(HtmlContent)
		HtmlContent = Html.ReadMoviePic(HtmlContent)
		HtmlContent = Html.ReadMoviePic2(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 ShowChannelMovieload(vid)
  '检测
  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
	v_power=rs("power")
	v_emoney=rs("emoney")
	v_url=rs("url")
	Rs.Close
	'权限
   Dim chkpower,chkemoney,ChkMsg
   	   chkpower=true
	   chkemoney=true
   	   chkpower=chk_power(v_power,ChannelIDs)
	   chkemoney=chk_emoney(v_emoney,"Movie",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
	StrDownLoadUrl=v_url
	if InStr(StrDownLoadUrl,"@@@")>0 then
		StrDownLoadUrl=Split(StrDownLoadUrl,"@@@")
		for i=0 to Ubound(StrDownLoadUrl)
			if UrlID=i+1 then
				DownLoadUrl=Split(StrDownLoadUrl(i),"|")(1)
				exit for
			end if
		next
	else
		if UrlID=1 then DownLoadUrl=Split(StrDownLoadUrl,"|")(1)
	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)
    '初始载入
	tit=Cls.ChannelTit&"浏览"
   If Cls.Is_Null(vid)="" Then vid=Cls.Code_ID("id")
   v_id=vid
	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
	cid=rs("ClassID")
	v_username=rs("username")
	v_name=rs("name")
	v_tcolor=rs("tcolor")
	v_genre=rs("genre")
	v_types=rs("types")
	v_whe=rs("whe")
	v_role=rs("role")
	v_star=rs("star")
	v_lang=rs("lang")
	v_viewtype=rs("viewtype")
	v_power=rs("power")
	v_rekoe=rs("rekoe")
	v_emoney=rs("emoney")
	v_url=rs("url")
	v_pic=rs("pic")
	v_remark=rs("remark")
	v_tim=rs("tim")
	v_cod=rs("cod")
	v_counter=rs("counter")
	v_keyes=rs("keyes")
	v_file=Rs("HtmlFileDate")
	Rs.Close
	'头部信息
	If Int(Web_Dim(15)) = 0 Then
	   tit=tit&"--"&v_name
        Else
	   tit=v_name&"--"&tit
	End if
	Tit_Dir = Class_Grade(Cid,Cls.ClassDepth) & Cls.ChannelTit&"浏览" &":"& Tit
	tit_fir=Cls.ChannelName
	IndexUrl=Cls.Web_Dir & Cls.ChannelDir
   '信息处理
  if v_pic<>"" then
     v_pic=pic_show(v_pic,14,v_pic)
	 else
	 v_pic=pic_show(Cls.Web_Dir&"Images/no_pic_show.gif",13,Cls.Web_Dir&"Images/no_pic_show.gif")
  End if
  if Cls.Is_Null(v_tcolor)<>"" then v_name="<font color="&v_tcolor&">"&v_name&"</font>"
  If Cls.ErrTrue Then tmp_err=commend_error(ChannelIDs,v_name,v_id,Cls.ChannelName)
  tmp_commend=format_commend(Cls.ChannelName,v_name,Cls.Web_Dir&Cls.ChannelDir&"/View.asp?id="&v_id)
  d_url = "<table border=0><tr><td>"
  p_url = "<table border=0><tr><td>"
  if v_url = "" then
    d_url="<font color=red><b>暂停播放</b></font>"
    d_url="<font color=red><b>暂停下载</b></font>"
  else
		if Instr(v_url,"@@@")>0 then
			dim StrDownUrl
			StrDownUrl=Split(v_url,"@@@")
			for i=0 to Ubound(StrDownUrl)
				d_url=d_url&"<a href='"&Cls.Web_Dir&Cls.ChannelDir&"/View.asp?action=Download&id="&v_id&"&UrlID="&i+1&"' target=_blank>"&Split(StrDownUrl(i),"|")(0)&"</a>&nbsp;&nbsp;"
				if v_rekoe=0 and v_types="music" then p_url=p_url&"<a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&Cls.ChannelDir&"/Player.asp?ID="&v_id&"&UrlID="&i+1&"','video_player',420,180,'no');"">"&Split(StrDownUrl(i),"|")(0)&"</a>&nbsp;&nbsp;"				
			    if v_rekoe=0 and v_types<>"music" then p_url=p_url&"<a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&Cls.ChannelDir&"/Player.asp?ID="&v_id&"&UrlID="&i+1&"','video_player',468,517,'no');"">"&Split(StrDownUrl(i),"|")(0)&"</a>&nbsp;&nbsp;"
			    if v_rekoe=1 then p_url=p_url&"<a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&Cls.ChannelDir&"/Player.asp?ID="&v_id&"&UrlID="&i+1&"','video_player',468,517,'no');"">"&Split(StrDownUrl(i),"|")(0)&"</a>&nbsp;&nbsp;"				
			next
		    else
				d_url=d_url&"<a href='"&Cls.Web_Dir&Cls.ChannelDir&"/View.asp?action=Download&id="&v_id&"&UrlID=1' target=_blank>"&Split(v_url,"|")(0)&"</a>&nbsp;&nbsp;"
				if v_rekoe=0 and v_types="music" then p_url=p_url&"<a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&Cls.ChannelDir&"/Player.asp?ID="&v_id&"&UrlID="&i+1&"','video_player',410,180,'no');"">"&Split(v_url,"|")(0)&"</a>&nbsp;&nbsp;"				
				if v_rekoe=0 and v_types<>"music" then p_url=p_url&"<a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&Cls.ChannelDir&"/Player.asp?ID="&v_id&"&UrlID="&i+1&"','video_player',468,517,'no');"">"&Split(v_url,"|")(0)&"</a>&nbsp;&nbsp;"					
				if v_rekoe=1 then p_url=p_url&"<a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&Cls.ChannelDir&"/Player.asp?ID="&v_id&"&UrlID="&i+1&"','video_player',468,517,'no');"">"&Split(v_url,"|")(0)&"</a>&nbsp;&nbsp;"				
		end if
  End If
  d_url=d_url&"</td></tr></table>"
  p_url=p_url&"</td></tr></table>"
  '//* 前台表格设置 *//
  '//* 前台表格设置结束 *//
  Select Case v_types
  Case "mtv" : v_types="MTV"
  Case "music" : v_types="歌曲"
  Case Else : v_types="影片"
  End Select
  HtmlContent=Cls.ReadTemplate(3)  
  HtmlContent=Replace(HtmlContent,"{$id}",v_id)  
  HtmlContent=Replace(HtmlContent,"{$name}",v_name) 
  HtmlContent=Replace(HtmlContent,"{$genre}",v_genre)
  HtmlContent=Replace(HtmlContent,"{$types}",v_types)
  HtmlContent=Replace(HtmlContent,"{$star}",v_star)
  HtmlContent=Replace(HtmlContent,"{$lang}",v_lang)
  HtmlContent=Replace(HtmlContent,"{$whe}",v_whe)
  HtmlContent=Replace(HtmlContent,"{$role}",v_role)
  HtmlContent=Replace(HtmlContent,"{$power}",v_power)
  HtmlContent=Replace(HtmlContent,"{$emony_power}",format_emoney_power(v_emoney,v_power,1))
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)
  HtmlContent=Replace(HtmlContent,"{$tcolor}",v_tcolor)
  HtmlContent=Replace(HtmlContent,"{$tim}",Cls.time_type(v_tim,4))
  HtmlContent=Replace(HtmlContent,"{$tit}",tit)
  HtmlContent=Replace(HtmlContent,"{$tit_fir}",Cls.ChannelTit)
  HtmlContent=Replace(HtmlContent,"{$pic}",v_pic)
  HtmlContent=Replace(HtmlContent,"{$username}",format_user_view(v_username,1,0))
  HtmlContent=Replace(HtmlContent,"{$commend_friend}",tmp_commend)
  HtmlContent=Replace(HtmlContent,"{$commend_err}",tmp_err)
  if v_viewtype = 0 or v_viewtype = 2 then
     HtmlContent=Replace(HtmlContent,"{$downurl}",d_url)
  else
     HtmlContent=Replace(HtmlContent,"{$downurl}","<font class=Gys>目前影片暂不开放下载</font>")
  end if
  if v_viewtype = 1 or v_viewtype = 2 then
     HtmlContent=Replace(HtmlContent,"{$playurl}",p_url)
  else
     HtmlContent=Replace(HtmlContent,"{$playurl}","<font class=Gys>目前影片暂不开放在线播放</font>")
  end if
  If IsHtml = 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.ReadMovieList(HtmlContent)
  HtmlContent = Html.ReadMoviePic(HtmlContent)
  HtmlContent = Html.ReadMoviePic2(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=Ubb.HtmlCode(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
		   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
	   Call Html.LoadReplaced()
	   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.RssTrue Then ChannelRss=" <link type='application/rss+xml' rel='alternate'><a href='"&Cls.Web_Dir&Cls.ChannelDir&"/RssFeed.asp?c_id="&ncid&"' target=_blank class=dvaam><img src='"&Cls.Web_SkinDir&"sys/"&Cls.ChannelDir&"_rss_xml.gif' class=xrss border=0 title='RSS 2.0 支持'></a>"
			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,"{$Channel_Xml}",ChannelRss)
    		
    		
			
			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&"/PicMovie/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&"/FocusMovie/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&"/GoodMovie/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&"/HotMovie/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
%>
