<!--#include file="../Conn.asp"-->
<!--#include file="../Cache/QvodCms.Admin.asp"-->
<!--#include file="../Cache/QvodCms.Class.asp"-->
<!--#include file="../Cache/QvodCms.Player.asp"-->
<!--#include file="../Cache/QvodCms.Slide.asp"-->
<!--#include file="../Cache/QvodCms.Base64.asp"-->
<!--#include file="../Cache/QvodCms.ClassNews.asp"-->
<!--#include file="QvodCms.Security.asp"-->
<!--#include file="QvodCms.Fun.asp"-->
<!--#include file="QvodCms.Cache.asp"-->
<!--#include file="QvodCms.Fso.asp"-->
<!--#include file="QvodCms.XmlHttp.asp"-->
<!--#include file="QvodCms.Md5.asp"-->
<%
Class QvodCms_Lable
	Public Content
	Private CacheName,labelRule,regEx,Match,Matches
	
	Public Sub Class_Initialize()'类开始执行的语句
		Set regEx = New RegExp   '建立正则表达式
		regEx.IgnoreCase = True  '设置是否区分字符大小写
		regEx.Global = True      '设置全局可用性
	End Sub
	
	Public Sub Class_Terminate()'类结束
		Set regExpObj = nothing
		Set strDictionary = nothing
	End Sub
	
	Public Function OpenSkin(Byval MoBan_Path)
		Content = GetSkinCache(MoBan_Path)
		Content = ReplaceStr(Content,"@SiteHeader@",GetSkinCache(Config(0)&"Skin/"&Config(12)&"/"&AdminId(12)&"header.html"))
		Content = ReplaceStr(Content,"@SiteFooter@",GetSkinCache(Config(0)&"Skin/"&Config(12)&"/"&AdminId(12)&"footer.html"))		
	End Function
	
	Public Function OpenAll()
	    Call Get_SlideList(Content)
		Content = ReplaceStr(Content,"@InstallDir@",Config(0))
		Content = ReplaceStr(Content,"@SiteName@",Config(8))
		Content = ReplaceStr(Content,"@SiteUrl@",Config(9))
		Content = ReplaceStr(Content,"@Email@",Config(18))	
		Content = ReplaceStr(Content,"@KeyWord@",Config(15))
		Content = ReplaceStr(Content,"@Description@",Config(16))
		Content = ReplaceStr(Content,"@Skin@",Config(12))
		Content = ReplaceStr(Content,"@Copyright@",Config(13))
		Content = ReplaceStr(Content,"@Tong@",Config(14))
		Content = ReplaceStr(Content,"@BeiAn@",AdminId(11))
		Content = ReplaceStr(Content,"@BackUrl@",reurl)
		Content = ReplaceStr(Content,"@Ucon@",UserCon(upic))
		Content = ReplaceStr(Content,"@NiCheng@",ulc)
	    Content = ReplaceStr(Content,"@JiFen@",QvodCms_Clng(ujf))
	    Content = ReplaceStr(Content,"@Vip@",UserSv(DateAdd("m", 0,uvip)))
		Content = ReplaceStr(Content,"@QvodCmsPlayer@","<script language=""javascript"" type=""text/javascript"" src="""&Config(0)&"Js/QvodCms.Js.js""></script>")
		Content = ReplaceStr(Content,"@Css@","<link href="""&Config(0)&"skin/"&Config(12)&"/style.css"" rel=""stylesheet"" type=""text/css"" />")
		Content = ReplaceStr(Content,"@QvodChannel@","qvodcha://"&Config(8)&"|"&Config(9)&"/Channel.xml")
		Content = ReplaceStr(Content,"@QvodAdd@","qvodadd://"&Config(8)&"|http://"&Config(9)&"/")
		Content = ReplaceStr(Content,"@Titele@",Config(8))
		'
		Content=ReplaceStr(Content,"@PingLink@",PingLink("ABCDEFG"))
	    Content=ReplaceStr(Content,"@Today@",Config(0)&"today.html")
	    Content=ReplaceStr(Content,"@Top@",Config(0)&"top.html")	
		'
		regEx.Pattern = "\@ClassShu\(([\s\S]*?)\)@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetTongJi(Cint(Match.SubMatches(0))))
		Next:Set matches = Nothing
		'
		regEx.Pattern = "@Link\((.*?)\)@([\s\S]*?)@\/Link@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetFriend(QvodCms_CLng(Match.SubMatches(0)),Match.SubMatches(1)))
		Next:Set matches = Nothing
		'
		regEx.Pattern = "@Menu\((.*?)\)@([\s\S]*?)@\/Menu@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetMenu(Match.SubMatches(0),Match.SubMatches(1)))
		Next:Set matches = Nothing	
		'
		regEx.Pattern = "@MenuNews\((.*?)\)@([\s\S]*?)@\/MenuNews@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetMenuNews(Match.SubMatches(0),Match.SubMatches(1)))
		Next:Set matches = Nothing									
	End Function
	
	Public Function OpenQvodCmsNews(StrContent)
		If StrContent<>"" Then Content=StrContent
		regEx.Pattern = "@News\((.*?)\)@([\s\S]*?)@\/News@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetListNews(Match.SubMatches(0),Match.SubMatches(1)))
		Next:Set matches = Nothing
		Content=ReplaceStr(Content,"@PageNum@",CurrentPage)
		Content=ReplaceStr(Content,"@Page@",PageStr)
		If class_id>0 then
		Content=ReplaceStr(Content,"@NewsClassName@","<a href="""&GetClassLinkNews(class_id)&""" target=""_blank"">"&GetClassNameNews(class_id)&"</a>")
		Content=ReplaceStr(Content,"@NewsClassMing@",GetClassNameNews(class_id))
		End If
	End Function
	
	Public Function OpenQvodCmsProduct(StrContent)
		If StrContent<>"" Then Content=StrContent
		regEx.Pattern = "@Product\((.*?)\)@([\s\S]*?)@\/Product@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetListProduct(Match.SubMatches(0),Match.SubMatches(1)))
		Next:Set matches = Nothing
		Content=ReplaceStr(Content,"@PageNum@",CurrentPage)
		Content=ReplaceStr(Content,"@Page@",PageStr)
	End Function
	
	Public Function OpenQvodCmsList(StrContent)
        If StrContent<>"" Then Content=StrContent
		regEx.Pattern = "@List\((.*?)\)@([\s\S]*?)@\/List@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetListAll(Match.SubMatches(0), Match.SubMatches(1)))'
		Next:Set matches = Nothing
		Content=ReplaceStr(Content,"@ClassId@",List_Id)
		Content=ReplaceStr(Content,"@ClassName@",GetClassName(List_Id))
		Content=ReplaceStr(Content,"@ClassNameLink@","<a href="""&GetListLink(List_Id)&""" target=""_blank"">"&GetClassName(List_Id)&"</a>")
                Content=ReplaceStr(Content,"@ClassNameBig@",GetClassNameBig(List_Id))
		Content=ReplaceStr(Content,"@ClassNameBigLink@","<a href="""&GetListLink(GetClassNameBigId(List_Id))&""" target=""_blank"">"&GetClassNameBig(List_Id)&"</a>")'
		Content=ReplaceStr(Content,"@Page@",PageStr)
		Content=ReplaceStr(Content,"@PageCs@",PageStrCs)
		Content=ReplaceStr(Content,"@PageNum@",CurrentPage)
		Content=ReplaceStr(Content,"@Ranks@",GetRanks(Ranks))
	End Function
		
	Public Function OpenQvodCmsSearch(StrContent)
        If StrContent<>"" Then Content=StrContent
		regEx.Pattern = "@Search\((.*?)\)@([\s\S]*?)@\/Search@"
		Set Matches = regEx.Execute(Content)
		For Each Match In Matches
		Content=ReplaceStr(Content,Match.value,GetSearchAll(Match.SubMatches(0), Match.SubMatches(1)))'
		Next:Set matches = Nothing
		Content=ReplaceStr(Content,"@SearchKeyword@",keyword)
		Content=ReplaceStr(Content,"@Page@",PageStr)
		Content=ReplaceStr(Content,"@PageNum@",CurrentPage)
	End Function
		
	Public Function OpenData(StrContent)
		Call LableObj.OpenQvodCmsList(StrContent)
		Set rs = Server.CreateObject("adodb.recordset")
		sql = " Select name_id,class_id,data_name,data_actor,data_director,data_erea,data_color,data_picbig,data_picsmall,data_intro,data_lastdate,data_playurl,data_playpath,data_hits,data_elite,data_year,data_language,data_reurl,data_vip,data_fav,data_py,data_order from qvodcms_name where data_status=1 and name_id="&name_id&" "
		rs.Open sql, Conn, 1, 1
		If Not(rs.bof And rs.eof) Then
			List_Id=rs("class_id")
			Content=GetHtmlLable(1,2,3,Content,2,"")
			'
			regEx.Pattern = "\@IntroShu\(([\s\S]*?)\)@"
			Set Matches = regEx.Execute(StrContent)
			For Each Match In Matches
			Content=ReplaceStr(Content,Match.value,GetSubStr(ReplaceHtml(rs("data_intro")),Clng(Match.SubMatches(0)),True))
			Next:Set matches = Nothing
			'
			regEx.Pattern = "@PlayList\((.*?)\)@([\s\S]*?)@\/PlayList@"
			Set Matches = regEx.Execute(Content)
			For Each Match In Matches
			Content=ReplaceStr(Content,Match.value,GetPlayList2(Trim(rs("data_playpath")),Trim(rs("data_playurl")), Match.SubMatches(0), Match.SubMatches(1)))
			Next:Set matches = Nothing
			'
			regEx.Pattern = "@DownList\((.*?)\)@([\s\S]*?)@\/DownList@"
			Set Matches = regEx.Execute(Content)
			For Each Match In Matches
			Content=ReplaceStr(Content,Match.value,GetPlayList5(Trim(rs("data_playpath")),Trim(rs("data_playurl")), Match.SubMatches(0), Match.SubMatches(1)))
			Next:Set matches = Nothing				
		Else 
		    Content = "没有记录"
		End If
		rs.Close
		Set rs=nothing
	End Function
	
	Public Function OpenPlayer(StrContent)
	   Set rs=Conn.Execute("Select name_id,class_id,data_name,data_actor,data_director,data_erea,data_color,data_picbig,data_picsmall,data_intro,data_lastdate,data_playurl,data_playpath,data_hits,data_year,data_language,data_reurl,data_vip,data_fav,data_py,data_order from qvodcms_name where data_status=1 and name_id="&Data_Id&"")
	   If Not(rs.bof And rs.eof) Then
	       Conn.execute("update qvodcms_name Set data_hits=data_hits+1 Where name_id="&Data_Id&"")
	       If Instr(rs("data_picsmall"),"http://")>0 Then PicUrls=Trim(rs("data_picsmall")) Else PicUrls=AdminId(15)&Config(0)&Trim(rs("data_picsmall")) End If
		   If Instr(rs("data_picbig"),"http://")>0 Then PicUrlb=Trim(rs("data_picbig")) Else PicUrlb=AdminId(15)&Config(0)&Trim(rs("data_picbig")) End If
	       Content=ReplaceStr(StrContent,"@PlayerName@",rs("data_name"))
		   Content=ReplaceStr(Content,"@ClassNamePlay@","<a href="""&GetListLink(rs("class_id"))&""" target=""_blank"">"&GetClassName(rs("class_id"))&"</a>")
		   If rs("data_vip")=1 Then Call GetVip(UserName,Uid,uvip)
		   Content=ReplaceStr(Content,"@DataName@","<a href="""&GetDataLink(rs("class_id"),data_id,rs("data_py"))&""" target=""_blank"">"&GetColor(rs("data_name"),rs("data_color"))&"</a>")
		   Content=ReplaceStr(Content,"@ClassMingPlay@",GetClassName(rs("class_id")))
	       Content=ReplaceStr(Content,"@Vip@",GetVipName(rs("data_vip")))'显示VIP收费提示
	       Content=ReplaceStr(Content,"@NameMing@",rs("data_name"))
	       Content=ReplaceStr(Content,"@DataFav@",rs("data_fav"))'收藏人气标签
		   Content=ReplaceStr(Content,"@Actor@",GetActor(rs("data_actor")))
	       Content=ReplaceStr(Content,"@Director@",GetDirector(GetReplace(rs("data_director"))))
	       Content=ReplaceStr(Content,"@Erea@",GetReplace(rs("data_erea")))
		   Content=ReplaceStr(Content,"@Year@",GetReplace(rs("data_year")))
	       Content=ReplaceStr(Content,"@Language@",GetReplace(rs("data_language")))
	       Content=ReplaceStr(Content,"@Hits@",formatnumber(rs("data_hits"),0))
		   Content=ReplaceStr(Content,"@DataId@",rs("name_id"))
		   Content=ReplaceStr(Content,"@Reurl@",Config(9)&GetDataLink(rs("class_id"),rs("name_id"),rs("data_py")))
	       Content=ReplaceStr(Content,"@PicSmall@",PicUrls)'小图路径
	       Content=ReplaceStr(Content,"@PicBig@",PicUrlb)'大图路径
		   Content=ReplaceStr(Content,"@Time4@",GetTimeStr(rs("data_lastdate"),2))
		   Content=ReplaceStr(Content,"@Intro@",rs("data_intro"))
	       Content=ReplaceStr(Content,"@LianZai@",LzReplace(GetReplace(rs("data_reurl")),rs("class_id")))
		   Content=PlayUrlShow(Content,Trim(rs("data_playpath")),Trim(rs("data_playurl")),rs("name_id"))
		    regEx.Pattern = "\@IntroShu\(([\s\S]*?)\)@"
		    Set Matches = regEx.Execute(StrContent)
			For Each Match In Matches
			Content=ReplaceStr(Content,Match.value,GetSubStr(ReplaceHtml(rs("data_intro")),Clng(Match.SubMatches(0)),True))
			Next:Set matches = Nothing
			'
			regEx.Pattern = "@PlayList\((.*?)\)@([\s\S]*?)@\/PlayList@"
			Set Matches = regEx.Execute(Content)
			For Each Match In Matches
			Content=ReplaceStr(Content,Match.value,GetPlayList2(Trim(rs("data_playpath")),Trim(rs("data_playurl")), Match.SubMatches(0), Match.SubMatches(1)))
			Next:Set matches = Nothing
	   Else
	       Content = "没有记录"
	   End If
	   rs.close:Set rs=nothing
	End Function			
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''	
    Public Function GetListAll(Strtype,StrContent)'strtype 标签参数,strList 循环内容
        Dim ListAll(10),TopStr,L1,WhereStr,EliteStr,ContinuStr,List_Html:List_Html=""
		If ubound(Split(StrType,","))<>10 Then GetListAll=err_areaList:Exit Function
		ListAll(0)=Split(StrType,",")(0)'分类
		ListAll(1)=QvodCms_CLng(Split(StrType,",")(1))'影片数
		ListAll(2)=Split(StrType,",")(2)'是否热门
		ListAll(3)=Split(StrType,",")(3)'是否推荐
		ListAll(4)=Split(StrType,",")(4)'是否分页
		ListAll(5)=QvodCms_CLng(Split(StrType,",")(5))'显示几天数据
		ListAll(6)=QvodCms_CLng(Split(StrType,",")(6))'推序方法 1,2,3,4,5,6
		ListAll(7)=QvodCms_CLng(Split(StrType,",")(7))'标题最多字符
		ListAll(8)=QvodCms_CLng(Split(StrType,",")(8))'主演最多字符
		ListAll(9)=QvodCms_CLng(Split(StrType,",")(9))'内容最多字符
		ListAll(10)=QvodCms_CLng(Split(StrType,",")(10))'分页数量
		If IsNumeric(ListAll(0))=False Then
	       If Instr(ListAll(0),"|")>0 Then WhereStr="and a.class_id in("&Replace(ListAll(0),"|",",")&")" Else WhereStr="" End If
	    Else
		   L1=QvodCms_CLng(ListAll(0))
		   If L1=-1 Then L1=list_id'当前分类
		   If L1=0 Then WhereStr="" Else WhereStr=WhereStr&" and (a.class_id="&L1&" or a.class_bigid="&L1&")" End If
	    End If			
		If Config(1)="SQL" and ListAll(5)=1 Then
			WhereStr=WhereStr& " and data_lastdate>='"&(date()-1)&"'"
		ElseIf Config(1)="SQL" and ListAll(5)=2 Then
			WhereStr=WhereStr& " and data_lastdate>='"&(date()-7)&"'"
		ElseIf Config(1)="SQL" and ListAll(5)=3 Then
			WhereStr=WhereStr& " and data_lastdate>='"&(date()-31)&"'"
		ElseIf Config(1)="ACCESS" and ListAll(5)=1 Then
		    WhereStr=WhereStr& " and  DateDiff('d',data_lastdate,#"&now()&"#)=1"
		ElseIf Config(1)="ACCESS" and ListAll(5)=2 Then
			WhereStr=WhereStr& " and  DateDiff('d',data_lastdate,#"&now()&"#)<7"
		ElseIf Config(1)="ACCESS" and ListAll(5)=3 Then
			WhereStr=WhereStr& " and  DateDiff('d',data_lastdate,#"&now()&"#)<31"
		End If
		If ListAll(1)=0 Then TopStr="" Else TopStr="Top "&ListAll(1)&"" End If
	    If ListAll(2)="True" Then WhereStr=WhereStr&" and data_hits>=1000" Else WhereStr=WhereStr End If '是否热门
	    If ListAll(3)="True" or Ranks=3 Then WhereStr=WhereStr&" and data_elite=1" End If   '是否推荐
		If Ranks=1 Then ListAll(6)=3  End If:If Ranks=2 Then ListAll(6)=5  End If
		If Ranks=3 Then
		   Sql = "select "&TopStr&" B.name_id,B.class_id,B.data_name,B.data_actor,B.data_director,B.data_erea,B.data_color,B.data_picbig,B.data_picsmall,B.data_intro,B.data_lastdate,B.data_hits,B.data_elite,B.data_year,B.data_language,B.data_reurl,B.data_sv,B.data_vip,B.data_cu,B.data_fav,B.data_order,B.data_py,B.data_playurl,B.data_playpath from qvodcms_class a  inner join qvodcms_name b on a.class_id=b.class_id where data_status=1  "&WhereStr&" "&GetOrderStr(ListAll(6))&" "
		ElseIf ListAll(4)="True" Then'是否分页   
		   Dim idcount,pagec,sqlid'高效分页开始
	       set krs=server.createobject("adodb.recordset")'获取记录总数
	       krs.open"select "&TopStr&" count(B.name_id) as idcount from qvodcms_class a  inner join qvodcms_name b on a.class_id=b.class_id where data_status=1  "&WhereStr&" ",conn,1,1
           idcount=krs("idcount")'获取记录总数
	       If(idcount>0) then'如果记录总数=0,则不处理
	          If(idcount mod ListAll(10)=0)then'如果记录总数除以每页条数有余数,则=记录总数/每页条数+1
		        pagec=int(idcount/ListAll(10))'获取总页数
	          Else
		        pagec=int(idcount/ListAll(10))+1'获取总页数
	          End If
		   '获取本页需要用到的id 读取所有记录的id数值,因为只有id所以速度很快
	       Set crsz=server.createobject("adodb.recordset")
	       crsz.open"select "&TopStr&" B.name_id  from qvodcms_class a  inner join qvodcms_name b on a.class_id=b.class_id where data_status=1 "&WhereStr&" "&GetOrderStr(ListAll(6))&" ",conn,1,1
	       crsz.pagesize = ListAll(10) '每页显示记录数
	       If CurrentPage > pagec then CurrentPage = pagec
	       If pagec > 0 then crsz.absolutepage = CurrentPage  
	         For i=1 to crsz.pagesize
	          If crsz.eof then exit for  
		        If(i=1)then
			     sqlid=crsz("name_id")
		      Else
			     sqlid=sqlid &","&crsz("name_id")
		      End if
	         crsz.movenext:next:crsz.Close:Set crsz=Nothing
		   End If:krs.Close:Set krs=Nothing
		   If(idcount>0 and sqlid<>"") then'如果记录总数=0,则不处理
		   Sql = "select "&TopStr&" name_id,class_id,data_name,data_actor,data_director,data_erea,data_color,data_picbig,data_picsmall,data_intro,data_lastdate,data_hits,data_elite,data_year,data_language,data_reurl,data_sv,data_vip,data_cu,data_fav,data_order,data_py,data_playurl,data_playpath from qvodcms_name where name_id in("& sqlid &") "&GetOrderStr(ListAll(6))&""
		   Else
		   Sql = "select "&TopStr&" B.name_id,B.class_id,B.data_name,B.data_actor,B.data_director,B.data_erea,B.data_color,B.data_picbig,B.data_picsmall,B.data_intro,B.data_lastdate,B.data_hits,B.data_elite,B.data_year,B.data_language,B.data_reurl,B.data_sv,B.data_vip,B.data_cu,B.data_fav,B.data_order,B.data_py,B.data_playurl,B.data_playpath from qvodcms_class a  inner join qvodcms_name b on a.class_id=b.class_id where data_status=1  "&WhereStr&" "&GetOrderStr(ListAll(6))&" "
		   End If
	   Else
		Sql = "select "&TopStr&" B.name_id,B.class_id,B.data_name,B.data_actor,B.data_director,B.data_erea,B.data_color,B.data_picbig,B.data_picsmall,B.data_intro,B.data_lastdate,B.data_hits,B.data_elite,B.data_year,B.data_language,B.data_reurl,B.data_sv,B.data_vip,B.data_cu,B.data_fav,B.data_order,B.data_py,B.data_playurl,B.data_playpath from qvodcms_class a  inner join qvodcms_name b on a.class_id=b.class_id where data_status=1  "&WhereStr&" "&GetOrderStr(ListAll(6))&" "
	   End If
		Set rs = Server.CreateObject("adodb.recordset")
		rs.Open Sql, Conn, 1, 1
		If Not (rs.bof and rs.eof) Then 
		  i=0
		If ListAll(4)="True" Then'分页
			rs.pagesize=ListAll(10)'每页数量
			m=idcount     '总记录
			n=pagec       '总页数
			z=rs.pagesize        '每页数量
			Do while not rs.eof and i<rs.pagesize
			x=x+1
			If x mod 2=1 and x<>0 then StrCss="list_color" Else StrCss="" End If
			List_str=GetHtmlLable(ListAll(7),ListAll(8),ListAll(9),StrContent,1,StrCss)'调用替换标签的函数
			List_Html=List_Html&List_str
			i=i+1
			rs.movenext
			Loop
			PageStr=GetLinkPage(list_id,CurrentPage,Ranks,ListAll(10),m)
			PageStrCs=ShowPageCs("../ListByTypeCs.asp?Type_Id="&list_id&"&Ranks="&Ranks&"", m, ListAll(10), CurrentPage, True, True, "条", False)	
		Else
		    Do while not rs.eof
			x=x+1
			If x mod 2=1 and x<>0 then StrCss="list_cr" Else StrCss="" End If
			List_str=GetHtmlLable(ListAll(7),ListAll(8),ListAll(9),StrContent,1,StrCss)'调用替换标签的函数
			List_Html=List_Html&List_str
			i=i+1		
			rs.movenext
			Loop
		End If
		Else
		    List_Html="对不起无相关数据!"
		End If
		rs.Close:Set rs=Nothing:GetListAll=List_Html
	End Function
	
    Public Function GetSearchAll(Strtype,StrContent)'处理列表与搜索页的标签
        Dim ListAll(3),WhereStr,ContinuStr,List_Html:List_Html=""
		If ubound(Split(StrType,","))<>3 Then GetSearchAll=err_areaList:Exit Function
		ListAll(0)=QvodCms_CLng(Split(StrType,",")(0))'标题数
		ListAll(1)=QvodCms_CLng(Split(StrType,",")(1))'主演数
		ListAll(2)=QvodCms_CLng(Split(StrType,",")(2))'内容数
		ListAll(3)=QvodCms_CLng(Split(StrType,",")(3))'分页数
		Sql = "select name_id,class_id,data_name,data_actor,data_director,data_erea,data_color,data_picbig,data_picsmall,data_intro,data_lastdate,data_hits,data_elite,data_year,data_language,data_reurl,data_sv,data_vip,data_cu,data_fav,data_order,data_py,data_playurl,data_playpath from qvodcms_name where "&GetSearchStr(SearchType,keyword)&""
		Set rs = Server.CreateObject("adodb.recordset")
		rs.Open Sql, Conn, 1, 1
		If Not (rs.bof and rs.eof) Then 
		    i=0
			rs.pagesize=ListAll(3)'每页数量
			rs.AbsolutePage=CurrentPage
			m=rs.recordcount     '总记录
			n=rs.PageCount       '总页数
			z=rs.pagesize        '每页数量
			Do while not rs.eof and i<rs.pagesize
			List_str=GetHtmlLable(ListAll(0),ListAll(1),ListAll(2),StrContent,1,StrCss)'调用替换标签的函数
			List_Html=List_Html&List_str
			i=i+1
			rs.movenext
			Loop
			PageStr=ShowPage("search.asp?action="&searchtype&"&keyword="&Server.URLEncode(keyword)&"", m, ListAll(3), CurrentPage, True, True, "条", False)
			PageStrCs=ShowPageCs("searchcs.asp?action="&searchtype&"&keyword="&keyword&"", m, ListAll(3), CurrentPage, True, True, "条", False)
		Else
		    List_Html="<center><br><br>对不起,本站暂无此内容!</center>"
		End If
		rs.Close:Set rs=Nothing:GetSearchAll=List_Html
	End Function

	'***************************************
	'函数名：GetHtmlLable
	'说  明：替换所有标签的公用函数
	'参  数: strList 替换前的模板源代码
	'参  数: strType 1=替换循环标签 2=替换内容页
	'****************************************
	Public Function GetHtmlLable(str1,str2,str3,strList,strType,StrCss)
		Dim PicUrls,PicUrlb,List_str
		If Instr(rs("data_picsmall"),"http://")>0 Then PicUrls=Trim(rs("data_picsmall")) Else PicUrls=AdminId(15)&Config(0)&Trim(rs("data_picsmall")) End If
		If Instr(rs("data_picbig"),"http://")>0 Then PicUrlb=Trim(rs("data_picbig")) Else PicUrlb=AdminId(15)&Config(0)&Trim(rs("data_picbig")) End If
		if i<9 then x="0" 
		List_str=ReplaceStr(strList,"@Number@",x&i+1)
		List_str=ReplaceStr(List_str,"@listcss@",StrCss)
		List_str=ReplaceStr(List_str,"@DataId@",rs("name_id"))
		List_str=ReplaceStr(List_str,"@ClassId@",rs("class_id"))
		List_str=ReplaceStr(List_str,"@ClassName@","<a href="""&GetListLink(rs("class_id"))&""" target=""_blank"">"&GetClassName(rs("class_id"))&"</a>")'
		List_str=ReplaceStr(List_str,"@ClassNameCs@","<a href=""listbytypecs.asp?type_id="&rs("class_id")&""">"&GetClassName(rs("class_id"))&"</a>")'
		List_str=ReplaceStr(List_str,"@ClassMing@",GetClassName(rs("class_id")))
	    List_str=ReplaceStr(List_str,"@Vip@",GetVipName(rs("data_vip")))'显示VIP收费提示
	    List_str=ReplaceStr(List_str,"@NameMing@",rs("data_name"))
	    List_str=ReplaceStr(List_str,"@DataFav@",rs("data_fav"))'收藏人气标签
	    List_str=ReplaceStr(List_str,"@DataUrl@",Config(9)&GetDataLink(rs("class_id"),rs("name_id"),rs("data_py")))
	    List_str=ReplaceStr(List_str,"@ClassUrl@",ListUrl)
	    List_str=ReplaceStr(List_str,"@Director@",GetDirector(GetReplace(rs("data_director"))))
	    List_str=ReplaceStr(List_str,"@DirectorCs@",GetDirectorCs(GetReplace(rs("data_director"))))
	    List_str=ReplaceStr(List_str,"@Erea@",GetReplace(rs("data_erea")))
	    List_str=ReplaceStr(List_str,"@Hits@",formatnumber(rs("data_hits"),0))
	    List_str=ReplaceStr(List_str,"@PicSmall@",PicUrls)'小图路径
	    List_str=ReplaceStr(List_str,"@PicBig@",PicUrlb)'大图路径
		List_str=ReplaceStr(List_str,"@Time@",GetTimeStr(rs("data_lastdate"),1))
	    List_str=ReplaceStr(List_str,"@Time1@",GetTimeStr(rs("data_lastdate"),2))
	    List_str=ReplaceStr(List_str,"@Time2@",GetTimeStr(rs("data_lastdate"),3))
	    List_str=ReplaceStr(List_str,"@Time3@",GetTimeStr(rs("data_lastdate"),4))
	    List_str=ReplaceStr(List_str,"@Time4@",GetTimeStr(rs("data_lastdate"),5))
	    List_str=ReplaceStr(List_str,"@Time5@",GetTimeStr(rs("data_lastdate"),6))
	    List_str=ReplaceStr(List_str,"@LianZai@",LzReplace(GetReplace(rs("data_reurl")),rs("class_id")))
		List_str=ReplaceStr(List_str,"@PlayType@",GetPlayList4(rs("data_playpath"),rs("data_playurl"),rs("name_id")))
		If Instr(List_str,"@Hot@")>0 and rs("data_hits") > Cint(AdminId(28)) Then
	    List_str=ReplaceStr(List_str,"@Hot@","<img src="""&Config(0)&"images/hot.gif"" border=""0"" />")
	    Else
	    List_str=ReplaceStr(List_str,"@Hot@","")
	    End If
	    If Instr(List_str,"@Elite@")>0 and rs("data_elite") = 1 Then
	    List_str=ReplaceStr(List_str,"@Elite@","<img src="""&Config(0)&"images/elite.gif"" border=""0"" />")
	    Else
	    List_str=ReplaceStr(List_str,"@Elite@","")
	    End If	
	    If Instr(List_str,"@New@")>0 and DateDiff("D", rs("data_lastdate"), Now()) < Cint(AdminId(25)) Then
	    List_str=ReplaceStr(List_str,"@New@","<img src="""&Config(0)&"images/new.gif"" border=""0"" />")
	    Else
	    List_str=ReplaceStr(List_str,"@New@","")
	    End If
		If left(rs("data_reurl"),2)="高清" Then
		List_str=ReplaceStr(List_str,"@Hd@","hd")
		Elseif left(rs("data_reurl"),2)="超清" Then
		List_str=ReplaceStr(List_str,"@Hd@","cq")
		Elseif left(rs("data_reurl"),2)="DV" Then
		List_str=ReplaceStr(List_str,"@Hd@","dvd")
		Elseif left(rs("data_reurl"),2)="抢先" or left(rs("data_reurl"),1)="t"  Then
		List_str=ReplaceStr(List_str,"@Hd@","ts")
		Elseif right(rs("data_reurl"),2)="全集" or right(rs("data_reurl"),2)="集全" Then
		List_str=ReplaceStr(List_str,"@Hd@","jieju")
		Elseif left(rs("data_reurl"),2)="热播" Then
		List_str=ReplaceStr(List_str,"@Hd@","rb")
		Else
		List_str=ReplaceStr(List_str,"@Hd@","")
		End IF
		List_str=ReplaceStr(List_str,"@Year@",GetReplace(rs("data_year")))
	    List_str=ReplaceStr(List_str,"@Language@",GetReplace(rs("data_language")))
		If strType=1 Then
	    List_str=ReplaceStr(List_str,"@DataName@","<a href="""&DataUrl&""" target=""_blank"">"&GetColor(GetCu(GetSubStr(rs("data_name"),str1,True),rs("data_cu")),rs("data_color"))&"</a>")
	    List_str=ReplaceStr(List_str,"@DataMing@",GetColor(GetCu(GetSubStr(rs("data_name"),str1,True),rs("data_cu")),rs("data_color")))
	    List_str=ReplaceStr(List_str,"@Actor@",GetActor(GetSubStr(rs("data_actor"),str2,True)))
	    List_str=ReplaceStr(List_str,"@ActorCs@",GetActorCs(GetSubStr(rs("data_actor"),str2,True)))
	    List_str=ReplaceStr(List_str,"@Intro@",GetSubStr(ReplaceHtml(rs("data_intro")),str3,True))	
		Else
		List_str=ReplaceStr(List_str,"@Titele@",rs("data_name"))
	    List_str=ReplaceStr(List_str,"@DataName@",rs("data_name"))
	    List_str=ReplaceStr(List_str,"@DataMing@",rs("data_name"))
	    List_str=ReplaceStr(List_str,"@Actor@",GetActor(rs("data_actor")))
	    List_str=ReplaceStr(List_str,"@ActorCs@",GetActorCs(rs("data_actor")))
        List_str=ReplaceStr(List_str,"@Actorr@",rs("data_actor"))
	    List_str=ReplaceStr(List_str,"@Intro@",rs("data_intro"))
		List_str=ReplaceStr(List_str,"@Reurl@",GetLocationUrl())'来源地址)
		List_str=ReplaceStr(List_str,"@QvodCs@",GetPlayList3(rs("data_playpath"),rs("data_playurl"),rs("name_id")))'播放器地址)
		End If
		GetHtmlLable=List_str
	End Function
	
    Public Function  GetNewsData(StrContent)'读取新闻内容
	  Call LableObj.OpenQvodCmsNews(StrContent)
	  Set rs = Server.CreateObject("adodb.recordset")
	  sql = " select * from qvodcms_news where id="&newsid&" "
	  rs.Open sql, Conn, 1, 1
	    If Not(rs.bof And rs.eof) Then
	    Conn.Execute("update qvodcms_news Set hits=hits+1 where id="&newsid&"")
		Content=GetHtmlNews(Content,1,150,300,CurrentPage,"")
	  Else
		Content = "没有新闻记录"
	  End If
	  rs.Close:Set rs=nothing
    End Function 

    Public Function GetListNews(Strtype,StrContent)'新闻列表处理标签@News(0,5,False,False,False,1,30,150,15)@ 
        Dim ListAll(8),TopStr,List_Html:List_Html=""
		If ubound(Split(StrType,","))<>8 Then GetListNews=err_areaList:Exit Function
		ListAll(0)=Split(StrType,",")(0)''分类ID
		ListAll(1)=QvodCms_CLng(Split(StrType,",")(1))'显示数
		ListAll(2)=Split(StrType,",")(2)'是否图片
		ListAll(3)=Split(StrType,",")(3)'是否推荐
		ListAll(4)=Split(StrType,",")(4)'是否分页
		ListAll(5)=QvodCms_CLng(Split(StrType,",")(5))'排序方式 1 ID,2,人气,3时间
		ListAll(6)=QvodCms_CLng(Split(StrType,",")(6))'标题数
		ListAll(7)=QvodCms_CLng(Split(StrType,",")(7))'摘要数
		ListAll(8)=QvodCms_CLng(Split(StrType,",")(8))'分页数
        If IsNumeric(ListAll(0))=False Then
	       If Instr(ListAll(0),"|")>0 Then WhereStr="and a.news_class_id in("&Replace(ListAll(0),"|",",")&")" Else WhereStr="" End If
	    Else
		   L1=QvodCms_CLng(ListAll(0))
		   If L1=-1 Then L1=class_id'当前分类
		   If L1=0 Then WhereStr="" Else WhereStr=WhereStr&" and (a.news_class_id="&L1&" or a.class_bigid="&L1&")" End If
	    End If			
		
		If ListAll(1)=0 Then TopStr="" Else TopStr="Top "&ListAll(1)&"" End If
	    If ListAll(2)="True" Then WhereStr=WhereStr&" and Hot=1" Else WhereStr=WhereStr End If '是否热门
	    If ListAll(3)="True" or Ranks=3 Then WhereStr=WhereStr&" and Elite=1" End If   '是否推荐
		
		If ListAll(4)="True" Then'是否分页   
		   Dim idcount,pagec,sqlid'高效分页开始
	       set krs=server.createobject("adodb.recordset")'获取记录总数
	       krs.open"select "&TopStr&" count(B.id) as idcount from qvodcms_news_class a  inner join qvodcms_news b on a.news_class_id=b.class_id where status=1  "&WhereStr&" ",conn,1,1
           idcount=krs("idcount")'获取记录总数
	       If(idcount>0) then'如果记录总数=0,则不处理
	          If(idcount mod ListAll(8)=0)then'如果记录总数除以每页条数有余数,则=记录总数/每页条数+1
		        pagec=int(idcount/ListAll(8))'获取总页数
	          Else
		        pagec=int(idcount/ListAll(8))+1'获取总页数
	          End If
		   '获取本页需要用到的id 读取所有记录的id数值,因为只有id所以速度很快
	       Set crsz=server.createobject("adodb.recordset")
	       crsz.open"select "&TopStr&" B.id  from qvodcms_news_class a  inner join qvodcms_news b on a.news_class_id=b.class_id where status=1 "&WhereStr&" "&GetOrderNews(ListAll(5))&" ",conn,1,1
	       crsz.pagesize = ListAll(8) '每页显示记录数
	       If CurrentPage > pagec then CurrentPage = pagec
	       If pagec > 0 then crsz.absolutepage = CurrentPage  
	         For i=1 to crsz.pagesize
	          If crsz.eof then exit for  
		        If(i=1)then
			     sqlid=crsz("id")
		      Else
			     sqlid=sqlid &","&crsz("id")
		      End if
	         crsz.movenext:next:crsz.Close:Set crsz=Nothing
		   End If:krs.Close:Set krs=Nothing
		   If(idcount>0 and sqlid<>"") then'如果记录总数=0,则不处理
		   Sql = "select "&TopStr&" * from qvodcms_news where id in("& sqlid &") "&GetOrderNews(ListAll(5))&""
		   Else
		   Sql = "select "&TopStr&" * from qvodcms_news_class a  inner join qvodcms_news b on a.news_class_id=b.class_id where status=1  "&WhereStr&" "&GetOrderNews(ListAll(5))&" "
		   End If
	    Else
	       Sql = "select "&TopStr&" * from qvodcms_news_class a  inner join qvodcms_news b on a.news_class_id=b.class_id where status=1  "&WhereStr&" "&GetOrderNews(ListAll(5))&" "	   
	    End If
		Set rs = Server.CreateObject("adodb.recordset")
		rs.Open Sql, Conn, 1, 1
		If Not (rs.bof and rs.eof) Then 
		  i=0
		If ListAll(4)="True" Then'分页
			rs.pagesize=ListAll(8)'每页数量
			m=idcount     '总记录
			n=pagec       '总页数
			z=rs.pagesize        '每页数量
			Do while not rs.eof and i<rs.pagesize
			If i mod 5=0 and i<>0 then
			List_str=GetHtmlNews(StrContent,1,ListAll(6),ListAll(7),1,"newstr")'调用替换标签的函数
			Else
			List_str=GetHtmlNews(StrContent,1,ListAll(6),ListAll(7),1,"")'调用替换标签的函数
			End If
			List_Html=List_Html&List_str
			i=i+1
			rs.movenext
			Loop
			PageStr=GetListLinkNews(class_id,CurrentPage,0,ListAll(8),m)
		Else
		    Do while not rs.eof
			List_str=GetHtmlNews(StrContent,1,ListAll(6),ListAll(7),1,"")'调用替换标签的函数
			List_Html=List_Html&List_str		
			i=i+1
			rs.movenext
			Loop
		End If
		Else
		    List_Html="对不起无相关数据!"
		End If
		rs.Close:Set rs=Nothing:GetListNews=List_Html
   End Function

   Public Function GetHtmlNews(strList,strType,StrNum,StrNuma,CurrentPage,Css)'新闻内容替换标签
    If Instr(rs("Pic"),"http://")>0 Then NewsPic=Trim(rs("Pic")) Else NewsPic=AdminId(15)&Config(0)&Trim(rs("Pic")) End If
	List_str=ReplaceStr(strList,"@Number@",i+1)
	List_str=ReplaceStr(List_str,"@NewsId@",rs("id"))
	List_str=ReplaceStr(List_str,"@NewsTimes@",QvodCms_Time(rs("datetimes"),6))
	List_str=ReplaceStr(List_str,"@NewsTime@",QvodCms_Time(rs("datetimes"),2))
	List_str=ReplaceStr(List_str,"@NewsTime1",GetTimeStr(rs("datetimes"),5))
	List_str=ReplaceStr(List_str,"@NewsClassName@","<a href="""&GetClassLinkNews(rs("class_id"))&""" target=""_blank"">"&GetClassNameNews(rs("class_id"))&"</a>")
	List_str=ReplaceStr(List_str,"@NewsClassMing@",GetClassNameNews(rs("class_id")))
	List_str=ReplaceStr(List_str,"@NewsMing@",rs("Title"))'不带任何html代码
	List_str=ReplaceStr(List_str,"@NewsUrl@",GetDataLinkNews(rs("class_id"),rs("id"),rs("datetimes"),1))
	List_str=ReplaceStr(List_str,"@NewsHits@",rs("hits"))
	List_str=ReplaceStr(List_str,"@NewsTr@",Css)
	List_str=ReplaceStr(List_str,"@NewsTu@",GetTu(rs("hot")))
	List_str=ReplaceStr(List_str,"@NewsPic@",NewsPic)
	List_str=ReplaceStr(List_str,"@NewsAuthor@",rs("Author"))
	List_str=ReplaceStr(List_str,"@NewsFrom@",rs("Source"))
	List_str=ReplaceStr(List_str,"@NewsZy@",rs("Description"))
	List_str=ReplaceStr(List_str,"@NewsZyNum@",GetSubStr(rs("Description"),StrNuma,True))
	List_str=ReplaceStr(List_str,"@NewsSeo@",rs("keywords"))
	List_str=ReplaceStr(List_str,"@NewsContent@",GetContentNews(rs("Content"),rs("class_id"),rs("id"),rs("datetimes"),CurrentPage))
	List_str=ReplaceStr(List_str,"@NewsName@",GetColor(GetSubStr(rs("Title"),StrNum,True),rs("color")))
	List_str=ReplaceStr(List_str,"@NewsMing@",rs("Title"))
	List_str=ReplaceStr(List_str,"@NewsUp@",GetNewsUp(rs("class_id"),rs("id")))
	List_str=ReplaceStr(List_str,"@NewsNext@",GetNewsNext(rs("class_id"),rs("id")))
	GetHtmlNews=List_str
   End Function 
   
   Public Function  GetProductData(StrContent)'读取奖品内容
	  Set rs = Server.CreateObject("adodb.recordset")
	  sql = " select * from qvodcms_product where pid="&pid&" "
	  rs.Open sql, Conn, 1, 1
	    If Not(rs.bof And rs.eof) Then
		Content=GetHtmlProduct(StrContent,2,200)
	  Else
		Content = "没有奖品记录"
	  End If
	  rs.Close:Set rs=nothing
    End Function 

    Public Function GetListProduct(Strtype,StrContent)'奖品列表处理标签
        Dim ListAll(3),TopStr,List_Html:List_Html=""
		If ubound(Split(StrType,","))<>3 Then GetListProduct=err_areaList:Exit Function
		ListAll(0)=Split(StrType,",")(0)''奖品数
		ListAll(1)=QvodCms_CLng(Split(StrType,",")(1))'标题字数
		ListAll(2)=Split(StrType,",")(2)'是否分页
		ListAll(3)=QvodCms_CLng(Split(StrType,",")(3))'分页数量
        If ListAll(0)=0 Then TopStr="" Else TopStr="Top "&ListAll(0)&"" End If
        Set rs = Server.CreateObject("adodb.recordset")
	    Sql = "select "&TopStr&" * from qvodcms_product order by pid desc"
	    rs.Open sql, Conn, 1, 1
	    List_Html=""
	    If Not(rs.bof And rs.eof) Then
	      i=0
		 If ListAll(2)="True" Then'分页
			rs.pagesize=ListAll(3)'每页数量
			rs.AbsolutePage=CurrentPage
			m=rs.recordcount     '总记录
			n=rs.PageCount       '总页数
			z=rs.pagesize        '每页数量
			Do while not rs.eof and i<rs.pagesize
			List_str= GetHtmlProduct(StrContent,1,ListAll(1))'调用替换标签的函数
			List_Html=List_Html&List_str	
			i=i+1
			rs.movenext:Loop
			PageStr=ShowPage("prodtype.asp?", m, ListAll(3), CurrentPage, True, True, "个", False)'''''''''''处理分页标签的链接
		 Else
		    Do while not rs.eof
			List_str=GetHtmlProduct(StrContent,1,ListAll(1))'调用替换标签的函数
			List_Html=List_Html&List_str	
			i=i+1
			rs.movenext:Loop
		 End If
	   Else
	    List_Html="<li>暂无相关奖品数据！</li>"
	    End If:rs.Close:Set rs=nothing
	    GetListProduct=List_Html
   End Function

   Public Function GetHtmlProduct(strList,strType,StrNum)'奖品内容替换标签
    If Instr(rs("pic"),"http://")>0 Then PicPro=Trim(rs("pic")) Else PicPro=AdminId(15)&Config(0)&Trim(rs("pic")) End If
	List_str=ReplaceStr(strList,"@Number@",i+1)
	List_str=ReplaceStr(List_str,"@Pid@",rs("pid"))
	List_str=ReplaceStr(List_str,"@Pimg@",PicPro)
	List_str=ReplaceStr(List_str,"@Time@",QvodCms_Time(rs("ptime"),2))
	List_str=ReplaceStr(List_str,"@Pming@",rs("pname"))'不带任何html代码
	List_str=ReplaceStr(List_str,"@Purl@",Config(0)&"prod.asp?pid="&rs("pid"))
	List_str=ReplaceStr(List_str,"@Pjf@",rs("pjf"))'积分
	List_str=ReplaceStr(List_str,"@Psl@",rs("pj"))'总数量
	List_str=ReplaceStr(List_str,"@Pslo@",rs("ps"))'剩余数量
	List_str=ReplaceStr(List_str,"@Pname@",GetColor(GetSubStr(rs("pname"),StrNum,True),rs("pcolor")))
	If strType<>2 Then
	List_str=ReplaceStr(List_str,"@Pabout@",GetSubStr(ReplaceHtml(rs("pabout")),200,True))
	Else
	List_str=ReplaceStr(List_str,"@Pabout@",rs("pabout"))
	List_str=ReplaceStr(List_str,"@Porder@",GetListOrder(pid))'兑换记录
	End If
	GetHtmlProduct=List_str
   End Function 

   Public Function GetPlayList2(PlayPath,PlayUrl,Strtype,StrlistAll)
	    Dim PlayAll(2),vnum,PlayUrlData,playIn,playfr,PlayHtml
		If ubound(Split(StrType,","))<>1 Then GetPlayList2=err_areaList:Exit Function
		PlayAll(0)=QvodCms_CLng(Split(StrType,",")(0))'选择来源 0=全部 1=当前来源,PlaySvs
		PlayAll(1)=QvodCms_CLng(Split(StrType,",")(1))'打开播放页窗体模式:0 当前窗体 1:新窗体 2:弹出窗体
		If isNul(PlayPath) or isNul(PlayUrl) Then GetPlayList2="":Exit Function
		PlayFm=Split(PlayReplace(PlayFromSort(PlayPath)),"$$")
		PlayUrlData=Split(PlayUrlSort(PlayPath,PlayUrl),"$$$")

		   IF Ubound(PlayFm)<>Ubound(PlayUrlData) Then
			  IF Ubound(PlayFm)<Ubound(PlayUrlData) Then
				vnum=Ubound(PlayFm)
			  Else
				vnum=Ubound(PlayUrlData)
			  End IF
		   Else
				vnum=Ubound(PlayFm)
		   End IF

		   if PlayAll(0)=1 Then
				For k=0 to vnum
				if k=Clng(PlaySvs) then Exit for
				'k=k+1
				  for m=1 to From_Count
			        If Split(PlayReplace(PlayPath),"$$")(k)=playfrom(m) then
			         playfr=playfrom(m)
				     playIn=playInfo(m)
				    End if 
		          Next
				Next
			   PlayHtml=PlayHtml&ReplaceStr(StrlistAll,"@PlayUrl@",PlayDataShow(Split(PlayUrl,"$$$")(k-1),k-1,rs("name_id"),PlayAll(1),rs("data_py"),rs("Class_id"),0,rs("data_name")))
			               PlayHtml=ReplaceStr(PlayHtml,"@PlayFrom@",playfr)
                           PlayHtml=ReplaceStr(PlayHtml,"@PlayNum@",k+1)
                           PlayHtml=ReplaceStr(PlayHtml,"@PlayIntro@",playIn)
						   PlayHtml=ReplaceStr(PlayHtml,"@PlayFromEn@",PlayServer(playfr))
		   Else
		      For k=0 to vnum
		        for m=1 to From_Count
			      If PlayFm(k)=playfrom(m) then
			       playfr=playfrom(m)
				   playIn=playInfo(m)
				  End if 
		        Next
			    PlayHtml=PlayHtml&ReplaceStr(StrlistAll,"@PlayUrl@",PlayDataShow(PlayUrlData(k),getArraySortID(PlayPath,playfr),rs("name_id"),PlayAll(1),rs("data_py"),rs("Class_id"),rs("data_order"),rs("data_name")))
			                PlayHtml=ReplaceStr(PlayHtml,"@PlayFrom@",playfr)
                            PlayHtml=ReplaceStr(PlayHtml,"@PlayNum@",k+1)            
            	            PlayHtml=ReplaceStr(PlayHtml,"@PlayIntro@",playIn)
							PlayHtml=ReplaceStr(PlayHtml,"@PlayFromEn@",PlayServer(playfr))
		      Next		  
		   End if
		   
		  GetPlayList2=PlayHtml
	End Function
	
	Public Function GetPlayList3(PlayPath,PlayUrl,PlayID)
	    Dim PlayUrlData,playIn,playfr,PlayHtml,vnum,PlayUrlCs,urltemp
		If isNul(PlayPath) or isNul(PlayUrl) Then Exit Function
		PlayFm=Split(PlayPath,"$$")
		PlayUrlData=Split(PlayUrl,"$$$")
		   IF Ubound(PlayFm)<>Ubound(PlayUrlData) Then
			  IF Ubound(PlayFm)<Ubound(PlayUrlData) Then
				vnum=Ubound(PlayFm)
			  Else
				vnum=Ubound(PlayUrlData)
			  End IF
		   Else
				vnum=Ubound(PlayFm)
		   End IF
		      For k=0 to vnum
                if PlayFm(k)="快播QVOD" Then
				   PlayUrlCs=Split(PlayUrlData(k),"#")'视频集数分隔
				    For J=0 To Ubound(PlayUrlCs)
		             If Not IsNul(PlayUrlCs(J)) Then  url3=Split(PlayUrlCs(J),"$")
				       If Ubound(url3)=0 Then
				        urltemp=urltemp&"<li><a href=""#"" nameid="""&PlayID&"_"&k+1&""" urlid="""&J+1&""">第"&J+1&"集</a></li>"
		               Else
			            urltemp=urltemp&"<li><a href=""#"" nameid="""&PlayID&"_"&k+1&""" urlid="""&J+1&""">"&url3(0)&"</a></li>"
		               End If
				    Next:Exit for
				 Else
				  urltemp="此影片暂无快播资源！"
				 End IF 
		      Next		  
		  GetPlayList3=urltemp
	End Function
	
	Public Function GetPlayList4(PlayPath,PlayUrl,PlayID)
	    Dim PlayUrlData,playIn,playfr,PlayHtml,vnum,PlayUrlTy,urlTy,x
		If isNul(PlayPath) or isNul(PlayUrl) Then Exit Function
		PlayUrlData=Split(PlayUrl,"$$$")
		PlayUrlTy=Split(PlayUrlData(0),"#")'视频集数分隔 
	      urlTy=GetPlayLink(PlayID,rs("data_py"),rs("Class_id"))&AdminId(9)&"_"&PlayID&"_1_"&Ubound(PlayUrlTy)+1&".html"
		 ' if right(rs("data_reurl"),2)="全集" or right(rs("data_reurl"),2)="集全" or right(rs("data_reurl"),2)="0集" Then
		 ' For J=0 to Ubound(PlayUrlTy)
		 ' l=l+1
		  'If Not IsNul(PlayUrlTy(J)) Then  url3=Split(PlayUrlTy(J),"$")
		    'urlTy=urlTy&GetPlayLink(PlayID,rs("data_py"),rs("Class_id"))&AdminId(9)&"_"&PlayID&"_1_"&x&".html"
			'urlTy=urlTy&"<li><a href="""&GetPlayLink(PlayID,rs("data_py"),rs("Class_id"))&AdminId(9)&"_"&PlayID&"_1_"&J+1&".html"" title="""&rs("data_name")&""&url3(0)&""" target=""_blank"">"&url3(0)&"</a></li>"
			'If l=6 Then Exit for
		 ' next
		 ' else
		 ' For J=Ubound(PlayUrlTy) to 0 step -1
		  'l=l+1
		  'If Not IsNul(PlayUrlTy(J)) Then  url3=Split(PlayUrlTy(J),"$")
		    'urlTy=urlTy&GetPlayLink(PlayID,rs("data_py"),rs("Class_id"))&AdminId(9)&"_"&PlayID&"_1_"&x&".html"
			'urlTy=urlTy&"<li><a href="""&GetPlayLink(PlayID,rs("data_py"),rs("Class_id"))&AdminId(9)&"_"&PlayID&"_1_"&J+1&".html"" title="""&rs("data_name")&""&url3(0)&""" target=""_blank"">"&url3(0)&"</a></li>"
			'If l=6 Then Exit for
		 ' next
		  'end if
		  
		  GetPlayList4=urlTy
		  'Response.Write Playtype
		  'Response.End()
	End Function
		
	Public Function GetPlayList5(DownPath,DownUrl,Strtype,StrlistAll)
	    Dim PlayAll(2),vnum,DownUrlData,DownIn,Downfr,DownHtml
		If ubound(Split(StrType,","))<>1 Then GetPlayList5=err_areaList:Exit Function
		PlayAll(1)=QvodCms_CLng(Split(StrType,",")(1))'打开播放页窗体模式:0 当前窗体 1:新窗体 2:弹出窗体
		If isNul(DownPath) or isNul(DownUrl) Then Exit Function
		DownFm=Split(DownPath,"$$")
		DownUrlData=Split(DownUrl,"$$$")
		   IF Ubound(DownFm)<>Ubound(DownUrlData) Then
			  IF Ubound(DownFm)<Ubound(DownUrlData) Then
				vnum=Ubound(DownFm)
			  Else
				vnum=Ubound(DownUrlData)
			  End IF
		   Else
				vnum=Ubound(DownFm)
		   End IF
		 
		      For k=0 to vnum
		        for m=1 to From_Count
			      If DownFm(k)=playfrom(m) then
			       Downfr=playfrom(m)
				   DownIn=playInfo(m)
				  End if 
		        Next
				if DownFm(k)="迅雷下载" or DownFm(k)="快车下载" or  DownFm(k)="旋风下载" Then
				DownHtml=DownHtml&ReplaceStr(StrlistAll,"@DownUrl@",DownDataShow(DownUrlData(k),k,rs("name_id"),PlayAll(1),DownIn,btac,0))
				DownHtml=ReplaceStr(DownHtml,"@DownFrom@",Downfr)
            	DownHtml=ReplaceStr(DownHtml,"@DownIntro@",DownIn)
				End IF
		      Next		  
		   
		   GetPlayList5=DownHtml
	End Function	
	
	Public Function GetTongJi(str)
		If str=0 Then'所有
			Set Shu=Conn.Execute("select count(name_id) from qvodcms_name")
		ElseIf str=999 Then'今日
			If Config(1)="SQL" Then
			Set Shu=Conn.Execute(" select count(name_id) from qvodcms_name where datediff(d,data_lastdate,getdate())=0 ")
			Else
			Set Shu=Conn.Execute(" select count(*) from qvodcms_name where datediff('d',data_lastdate,now())=0 ")
			End If
		Else
		    If str=-1 Then str=QvodCms_CLng(List_Id)
			Set Shu=Conn.execute(" select count(name_id) from qvodcms_name where (class_id="&str&" or class_id in (select class_id from qvodcms_class where class_bigid="&str&")) ")
		End If
		GetTongJi=Shu(0)
		Set Shu=Nothing
	End Function
	
	Public Function GetFriend(strtype,strlist)
	    Dim Friend_I,Friend_Html,Lits_Html,Where_Link,Cache_Friend:Friend_I=0:Friend_Html="":Cache_Friend="Cache_Friend"
		If Cint(Config(19))=1 and CacheObj.ChkCache(Cache_Friend) Then'开启缓存+有缓存
			 Friend_Html = CacheObj.GetCache(Cache_Friend)
		Else
		    If strtype=1 Then Where_Link="where link_typeid=1" Else Where_Link="where link_typeid=0"
			Set rs = Conn.Execute("Select * from qvodcms_link "&Where_Link&" order by link_orderid asc")
			If Not(rs.bof And rs.eof) Then
			Do while not rs.eof
			Friend_I=Friend_I+1
			Lits_Html=ReplaceStr(strlist,"@LinkI@",Friend_I)
			Lits_Html=ReplaceStr(Lits_Html,"@LinkName@",rs("link_name"))
			Lits_Html=ReplaceStr(Lits_Html,"@LinkUrl@",rs("link_url"))
			Lits_Html=ReplaceStr(Lits_Html,"@LinkLogo@",rs("link_logo"))
			Lits_Html=ReplaceStr(Lits_Html,"@LinkIntro@",rs("link_about"))
			Friend_Html=Friend_Html&Lits_Html
			rs.movenext
			Loop
			End If
			rs.close:Set rs=nothing
			CacheObj.SetCache Cache_Friend,FriendLink'写入友链缓存
		End If
		GetFriend=Friend_Html
	End Function
	
	Public Function GetMenu(strtype,strlist)
		Dim Menu_I,Menu_Html,Lits_Html,Class_bigid,WhereStr:Menu_I=0:Menu_Html=""
		If Not isNum(strtype) Then GetMenu=err_menu:Exit Function	
		Set rs = Conn.Execute("Select * from qvodcms_class where class_id in("&strtype&") and class_orderid>0 order by class_orderid asc")
		If Not(rs.bof And rs.eof) Then
			Do while not rs.eof
			Menu_I=Menu_I+1
			Lits_Html=ReplaceStr(strlist,"@MenuI@",Menu_I)
			Lits_Html=ReplaceStr(Lits_Html,"@MenuId@",rs("class_id"))
			Lits_Html=ReplaceStr(Lits_Html,"@MenuName@",rs("class_name"))
			Lits_Html=ReplaceStr(Lits_Html,"@MenuEnName@",rs("class_dir"))
			Lits_Html=ReplaceStr(Lits_Html,"@MenuUrl@",GetListLink(rs("class_id")))
			If Instr(Lits_Html,"@MenuCss@")>0 Then
				If List_Id=rs("class_id") Then 
				Lits_Html=ReplaceStr(Lits_Html,"@MenuCss@","Current")
				Else
				Lits_Html=ReplaceStr(Lits_Html,"@MenuCss@","")
				End If
			End If
			Menu_Html=Menu_Html&Lits_Html
			rs.movenext
			Loop
		End If
		rs.close:Set rs=nothing
		GetMenu=Menu_Html
	End Function
	
	Public Function GetMenuNews(strtype,strlist)
		Dim MenuNews_I,MenuNews_Html,Lits_Html,Class_bigid,WhereStr:MenuNews_I=0:MenuNews_Html=""
		If Not isNum(strtype) Then GetMenuNews=err_menu:Exit Function	
		Set rs = Conn.Execute("Select * from qvodcms_news_class where news_class_id in("&strtype&") and class_orderid>0 order by class_orderid asc")
		If Not(rs.bof And rs.eof) Then
			Do while not rs.eof
			MenuNews_I=MenuNews_I+1
			Lits_Html=ReplaceStr(strlist,"@MenuNewsI@",Menu_I)
			Lits_Html=ReplaceStr(Lits_Html,"@MenuNewsId@",rs("news_class_id"))
			Lits_Html=ReplaceStr(Lits_Html,"@MenuNewsName@",rs("class_name"))
			Lits_Html=ReplaceStr(Lits_Html,"@MenuNewsEnName@",rs("class_dir"))
			Lits_Html=ReplaceStr(Lits_Html,"@MenuNewsUrl@",GetClassLinkNews(rs("news_class_id")))
			If Instr(Lits_Html,"@MenuNewsCss@")>0 Then
				If class_id=rs("news_class_id") Then 
				Lits_Html=ReplaceStr(Lits_Html,"@MenuNewsCss@","NewsCurrent")
				Else
				Lits_Html=ReplaceStr(Lits_Html,"@MenuNewsCss@","")
				End If
			End If
			MenuNews_Html=MenuNews_Html&Lits_Html
			rs.movenext
			Loop
		End If
		rs.close:Set rs=nothing
		GetMenuNews=MenuNews_Html
	End Function
	
   Public Function Get_SlideList(Content)'模板全局单个标签替换
	  Content=ReplaceStr(Content,"@Title1@",a1)
	  Content=ReplaceStr(Content,"@Title2@",a2)
	  Content=ReplaceStr(Content,"@Title3@",a3)
	  Content=ReplaceStr(Content,"@Title4@",a4)
	  Content=ReplaceStr(Content,"@Title5@",a5)
	  Content=ReplaceStr(Content,"@Title6@",a6)
	  Content=ReplaceStr(Content,"@Title7@",a7)
	  Content=ReplaceStr(Content,"@Title8@",a8)
	  Content=ReplaceStr(Content,"@Title9@",a9)
	  Content=ReplaceStr(Content,"@Title10@",a10)
	  Content=ReplaceStr(Content,"@Title11@",a11)
	  Content=ReplaceStr(Content,"@Title12@",a12)
	  Content=ReplaceStr(Content,"@Title13@",a13)
	  Content=ReplaceStr(Content,"@Title14@",a14)
	  Content=ReplaceStr(Content,"@Title15@",a15)
	  Content=ReplaceStr(Content,"@Title16@",a16)
	  Content=ReplaceStr(Content,"@Title17@",a17)
	  Content=ReplaceStr(Content,"@Title18@",a18)
	  Content=ReplaceStr(Content,"@Title19@",a19)
	  Content=ReplaceStr(Content,"@Title20@",a20)
	  Content=ReplaceStr(Content,"@Title21@",a21)
	  Content=ReplaceStr(Content,"@Title22@",a22)
	  Content=ReplaceStr(Content,"@Title23@",a23)
	  Content=ReplaceStr(Content,"@Title24@",a24)
	  Content=ReplaceStr(Content,"@Title25@",a25)
	  Content=ReplaceStr(Content,"@Title26@",a26)
	  Content=ReplaceStr(Content,"@Title27@",a27)
	  Content=ReplaceStr(Content,"@Title28@",a28)
	  Content=ReplaceStr(Content,"@Title29@",a29)
	  Content=ReplaceStr(Content,"@Title30@",a30)
	  Content=ReplaceStr(Content,"@Title31@",a31)
	  Content=ReplaceStr(Content,"@Title32@",a32)  
	  ''''
	  Content=ReplaceStr(Content,"@Pic1@",p1)
	  Content=ReplaceStr(Content,"@Pic2@",p2)
	  Content=ReplaceStr(Content,"@Pic3@",p3)
	  Content=ReplaceStr(Content,"@Pic4@",p4)
	  Content=ReplaceStr(Content,"@Pic5@",p5)
	  Content=ReplaceStr(Content,"@Pic6@",p6)
	  Content=ReplaceStr(Content,"@Pic7@",p7)
	  Content=ReplaceStr(Content,"@Pic8@",p8)
	  Content=ReplaceStr(Content,"@Pic9@",p9)
	  Content=ReplaceStr(Content,"@Pic10@",p10)
	  Content=ReplaceStr(Content,"@Pic11@",p11)
	  Content=ReplaceStr(Content,"@Pic12@",p12)
	  Content=ReplaceStr(Content,"@Pic13@",p13)
	  Content=ReplaceStr(Content,"@Pic14@",p14)
	  Content=ReplaceStr(Content,"@Pic15@",p15)
	  Content=ReplaceStr(Content,"@Pic16@",p16)
	  Content=ReplaceStr(Content,"@Pic17@",p17)
	  Content=ReplaceStr(Content,"@Pic18@",p18)
	  Content=ReplaceStr(Content,"@Pic19@",p19)
	  Content=ReplaceStr(Content,"@Pic20@",p20)
	  Content=ReplaceStr(Content,"@Pic21@",p21)
	  Content=ReplaceStr(Content,"@Pic22@",p22)
	  Content=ReplaceStr(Content,"@Pic23@",p23)
	  Content=ReplaceStr(Content,"@Pic24@",p24)
	  Content=ReplaceStr(Content,"@Pic25@",p25)
	  Content=ReplaceStr(Content,"@Pic26@",p26)
	  Content=ReplaceStr(Content,"@Pic27@",p27)
	  Content=ReplaceStr(Content,"@Pic28@",p28)
	  Content=ReplaceStr(Content,"@Pic29@",p29)
	  Content=ReplaceStr(Content,"@Pic30@",p30)
	  Content=ReplaceStr(Content,"@Pic31@",p31)
	  Content=ReplaceStr(Content,"@Pic32@",p32)
	  '''
	  Content=ReplaceStr(Content,"@Link1@",u1)
	  Content=ReplaceStr(Content,"@Link2@",u2)
	  Content=ReplaceStr(Content,"@Link3@",u3)
	  Content=ReplaceStr(Content,"@Link4@",u4)
	  Content=ReplaceStr(Content,"@Link5@",u5)
	  Content=ReplaceStr(Content,"@Link6@",u6)
	  Content=ReplaceStr(Content,"@Link7@",u7)
	  Content=ReplaceStr(Content,"@Link8@",u8)
	  Content=ReplaceStr(Content,"@Link9@",u9)
	  Content=ReplaceStr(Content,"@Link10@",u10)
	  Content=ReplaceStr(Content,"@Link11@",u11)
	  Content=ReplaceStr(Content,"@Link12@",u12)
	  Content=ReplaceStr(Content,"@Link13@",u13)
	  Content=ReplaceStr(Content,"@Link14@",u14)
	  Content=ReplaceStr(Content,"@Link15@",u15)
	  Content=ReplaceStr(Content,"@Link16@",u16)
	  Content=ReplaceStr(Content,"@Link17@",u17)
	  Content=ReplaceStr(Content,"@Link18@",u18)
	  Content=ReplaceStr(Content,"@Link19@",u19)
	  Content=ReplaceStr(Content,"@Link20@",u20)
	  Content=ReplaceStr(Content,"@Link21@",u21)
	  Content=ReplaceStr(Content,"@Link22@",u22)
	  Content=ReplaceStr(Content,"@Link23@",u23)
	  Content=ReplaceStr(Content,"@Link24@",u24)
	  Content=ReplaceStr(Content,"@Link25@",u25)
	  Content=ReplaceStr(Content,"@Link26@",u26)
	  Content=ReplaceStr(Content,"@Link27@",u27)
	  Content=ReplaceStr(Content,"@Link28@",u28)
	  Content=ReplaceStr(Content,"@Link29@",u29)
	  Content=ReplaceStr(Content,"@Link30@",u30)
	  Content=ReplaceStr(Content,"@Link31@",u31)
	  Content=ReplaceStr(Content,"@Link32@",u32)
	  '
	  Content=ReplaceStr(Content,"@Info1@",n1)
	  Content=ReplaceStr(Content,"@Info2@",n2)
	  Content=ReplaceStr(Content,"@Info3@",n3)
	  Content=ReplaceStr(Content,"@Info4@",n4)
	  Content=ReplaceStr(Content,"@Info5@",n5)
	  Content=ReplaceStr(Content,"@Info6@",n6)
	  Content=ReplaceStr(Content,"@Info7@",n7)
	  Content=ReplaceStr(Content,"@Info8@",n8)
	  Content=ReplaceStr(Content,"@Info9@",n9)
	  Content=ReplaceStr(Content,"@Info10@",n10)
	  Content=ReplaceStr(Content,"@Info11@",n11)
	  Content=ReplaceStr(Content,"@Info12@",n12)
	  Content=ReplaceStr(Content,"@Info13@",n13)
	  Content=ReplaceStr(Content,"@Info14@",n14)
	  Content=ReplaceStr(Content,"@Info15@",n15)
	  Content=ReplaceStr(Content,"@Info16@",n16)
	  Content=ReplaceStr(Content,"@Info17@",n17)
	  Content=ReplaceStr(Content,"@Info18@",n18)
	  Content=ReplaceStr(Content,"@Info19@",n19)
	  Content=ReplaceStr(Content,"@Info20@",n20)
	  Content=ReplaceStr(Content,"@Info21@",n21)
	  Content=ReplaceStr(Content,"@Info22@",n22)
	  Content=ReplaceStr(Content,"@Info23@",n23)
	  Content=ReplaceStr(Content,"@Info24@",n24)
	  Content=ReplaceStr(Content,"@Info25@",n25)
	  Content=ReplaceStr(Content,"@Info26@",n26)
	  Content=ReplaceStr(Content,"@Info27@",n27)
	  Content=ReplaceStr(Content,"@Info28@",n28)
	  Content=ReplaceStr(Content,"@Info29@",n29)
	  Content=ReplaceStr(Content,"@Info30@",n30)
	  Content=ReplaceStr(Content,"@Info31@",n31)
	  Content=ReplaceStr(Content,"@Info32@",n32)
   End Function
   
End Class

Dim Lable_Cache,Lable_Str,MoBan_Path,i,List_Id,Data_Id
Dim CacheObj,LableObj
Set CacheObj = New QvodCms_Cache
Set LableObj = New QvodCms_Lable
Call OpenConn()
Sub Moban_Index_Str(MoBan_Path)
	With LableObj : .OpenSkin(MoBan_Path) : .OpenAll :.OpenQvodCmsNews(StrContent) :.OpenQvodCmsList(Content): .OpenQvodCmsProduct(Content): End With
End Sub

Sub Moban_Search_Str(MoBan_Path)
	With LableObj : .OpenSkin(MoBan_Path) : .OpenAll : End With
End Sub

Sub Moban_Class_Str(MoBan_Path)
	With LableObj : .OpenSkin(MoBan_Path) : .OpenAll : End With
End Sub

Sub Moban_Data_Str(MoBan_Path)
	With LableObj : .OpenSkin(MoBan_Path) : .OpenAll : End With
End Sub

Sub Moban_Play_Str(MoBan_Path)
	With LableObj : .OpenSkin(MoBan_Path) : .OpenAll : .OpenQvodCmsList(Content):End With
End Sub

%>