<%
'*******************************************************
'易达CMS中小企业快速建站系统
'软件开发 黑龙江省世纪伟成网络科技有限公司
'网址：http://yidacms.com
'软件享有著作权，未经公司或开发者同意禁止更改以下代码。
'*******************************************************
function Video(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Video:\{(.+?)\}>([\s\S]*?)<Video>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
	leixing=nbq(bq,"leixing")
	Tlen=nbq(bq,"Tlen")
	str=replace(str,match,Videody(leixing,nr,Tlen))
	next
	Video=str
end function

Function Videody(leixing,yida_cms,Tlen)
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_video where id = " & leixing & ""
	rs.open sql,dbok,1,1
        if rs.eof then
	 zanwu = zanwuneirong
	  else
           yida_cms = replace(yida_cms,"{Video:player}",videoplayer)
        end if
        tt=tt+yida_cms
	rs.Close
	set rs=nothing
        Videody = tt & zanwu
End Function

function Videoclass(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Videoclass:\{(.+?)\}>([\s\S]*?)<Videoclass>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
	Language=nbq(bq,"Language") 
	Row=nbq(bq,"Row")
	str=replace(str,match,shipinfenlei(Language,Row,nr))
	next
	Videoclass=str
end function

Function shipinfenlei(Language,Row,yida_cms)
	set rs = server.createobject("adodb.recordset")
	sql="select top "&Row&" * from shuaiweb_videoclass where wait_ncsi = 1 and yida_language = '" & Language & "' ORDER BY shuaiweb_videoclasssort ASC"
	rs.open sql,dbok,1,1
	Do While Not rs.EOF

        if Language = "ch" then
         if yida_url = "asp" then
          Videoclassurl = webpath & "zh_video.asp?id=" & rs("id")
           elseif yida_url = "html" or yida_url = "asphtml" then
          Videoclassurl = webpath & "html/video/videolist_"&rs("id")&".html"
         end if
        elseif Language = "en" then
         if yida_url = "asp" then
          Videoclassurl = webpath & "en_video.asp?id=" & rs("id")
           elseif yida_url = "html" or yida_url = "asphtml" then
          Videoclassurl = webpath & "html/en_video/videolist_"&rs("id")&".html"
         end if
        end if

        yida_cms1=replace(yida_cms,"{Video:name}",rs("shuaiweb_videoclassname"))
        yida_cms2=replace(yida_cms1,"{Video:id}",rs("id"))
        yida_cms3=replace(yida_cms2,"{Videoclass:url}",Videoclassurl)
        tt=tt+yida_cms3
	rs.movenext						
	Loop
        shipinfenlei = tt
	rs.Close
	set rs=nothing
End Function

function Videolist(str)
	set reg=new regexp
	reg.IgnoreCase = False 
	reg.Global = True 
	reg.Pattern = "<Video:\{(.+?)\}>([\s\S]*?)<Video>"
	set aa=reg.execute(str)
	for each match in aa
	bq=match.submatches(0)
	nr=match.submatches(1)
        Language=nbq(bq,"Language")
	Row=nbq(bq,"Row")
	Tlen=nbq(bq,"Tlen")
	str=replace(str,match,Getvideo(Language,Row,nr,Tlen))
	next
	Videolist=str
end function

Function Getvideo(Language,Row,yida_cms,Tlen)
set rs = server.createobject("adodb.recordset")
if request("id") = "" then
 sql="select * from shuaiweb_video where yida_language = '" & Language & "' ORDER BY id DESC"
  else
 sql="select top "&Row&" * from shuaiweb_video where shuaiweb_videoclass = "&cint(request("id"))&" and  yida_language = '" & Language & "' ORDER BY id DESC"
end if
rs.open sql,dbok,1,1
Do While Not rs.EOF

if Language = "ch" then
 if yida_url = "asp" then
  Getvideourl = webpath & "zh_video_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Getvideourl = webpath & "html/video/video_"&rs("id")&".html"
 end if
elseif Language = "en" then
 if yida_url = "asp" then
  Getvideourl = webpath & "en_video_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Getvideourl = webpath & "html/en_video/video_"&rs("id")&".html"
 end if
end if

yida_cms1=replace(yida_cms,"{Video:name}",left(rs("shuaiweb_videoname"),Tlen))
yida_cms2=replace(yida_cms1,"{Video:id}",rs("id"))
yida_cms3=replace(yida_cms2,"{Video:riqi}",FormatDate(rs("time"),4))
yida_cms4=replace(yida_cms3,"{Video:url}",Getvideourl)
 if rs("shuaiweb_videopic") <> "" then
  videotupian = sw_dizhi & rs("shuaiweb_videopic")
   else
  videotupian = sw_dizhi & "images/VideoWithout.gif"
 end if
yida_cms5=replace(yida_cms4,"{Video:tupian}",videotupian)
yida_cms6=replace(yida_cms5,"{Video:neirong}",left(RemoveHTML(rs("shuaiweb_videocontent")),100))
tt=tt+yida_cms6
rs.movenext						
Loop
Getvideo = tt
rs.Close
set rs=nothing	
End Function

Function Videoview(a)
        video_id = cint(request("id"))
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_video WHERE id = "&video_id&""
	rs.open sql,dbok,1,3

	yidacms_tag_video = yidacms_tag_video &_ 

	(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(rs("shuaiweb_videocontent"),"{sys:weburl}",sw_dizhi),"{sys:title}",sw_webtitle),"{sys:gongsibiaoti}",co_name),"{sys:gongsidizhi}",sw_gongsidizhi),"{sys:dianhua}",sw_dianhua),"{sys:yidongdianhua}",sw_yidongdianhua),"{sys:chuanzhen}",sw_chuanzhen),"{sys:qq}",sw_qq),"{sys:lianxiren}",sw_lianxiren),"{sys:beian}",sw_beian),"{sys:youxiang}",sw_youxiang),"{sys:youbian}",sw_youbian))

        a = replace(a,"{Video:name}",rs("shuaiweb_videoname"))
        a = replace(a,"{Video:id}",rs("id"))
        a = replace(a,"{Video:videourl}",rs("shuaiweb_videourl"))
        a = replace(a,"{Video:neirong}",yidacms_tag_video)

        if rs("yida_language") = "ch" then
         a = replace(a,"{Video:shijian}",FormatDate(rs("time"),4))
          elseif rs("yida_language") = "en" then
         a = replace(a,"{Video:shijian}",FormatDate(rs("time"),12))
        end if

        If Not(rs.bof and rs.eof) Then
        a = replace(a,"{Video:liulan}",rs("wait_nesan"))
        rs("wait_nesan") = rs("wait_nesan") +1
        Rs.UPDATE
        end if

        a = replace(a,"{Video:player}",videoplayer)
	rs.Close
	set rs=nothing
Videoview = a
End Function

Function videoplayer()
if rs("shuaiweb_videotype") = 3 then
videoplayer = videoplayer&"<object id=""player"" height="&rs("shuaiweb_videoheight")&" width="&rs("shuaiweb_videowidth")&" classid=""CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6""> "&vbcrlf
videoplayer = videoplayer&"<param NAME=""AutoStart"" VALUE=""-1""> "&vbcrlf
videoplayer = videoplayer&"<param NAME=""Balance"" VALUE=""0""> "&vbcrlf
videoplayer = videoplayer&"<param name=""enabled"" value=""-1""> "&vbcrlf
videoplayer = videoplayer&"<param NAME=""EnableContextMenu"" VALUE=""-1""> "&vbcrlf
videoplayer = videoplayer&"<param NAME=""url"" VALUE="&rs("shuaiweb_videourl")&" target=""_blank"">"&vbcrlf
videoplayer = videoplayer&"<param NAME=""PlayCount"" VALUE=""1""> "&vbcrlf
videoplayer = videoplayer&"<param name=""rate"" value=""1""> "&vbcrlf
videoplayer = videoplayer&"<param name=""currentPosition"" value=""0""> "&vbcrlf
videoplayer = videoplayer&"<param name=""currentMarker"" value=""0""> "&vbcrlf
videoplayer = videoplayer&"<param name=""defaultFrame"" value=""""> "&vbcrlf
videoplayer = videoplayer&"<param name=""invokeURLs"" value=""0""> "&vbcrlf
videoplayer = videoplayer&"<param name=""baseURL"" value=""""> "&vbcrlf
videoplayer = videoplayer&"<param name=""stretchToFit"" value=""1""> "&vbcrlf
videoplayer = videoplayer&"<param name=""volume"" value=""50""> "&vbcrlf
videoplayer = videoplayer&"<param name=""mute"" value=""0""> "&vbcrlf
videoplayer = videoplayer&"<param name=""uiMode"" value=""full""> "&vbcrlf
videoplayer = videoplayer&"<param name=""windowlessVideo"" value=""0""> "&vbcrlf
videoplayer = videoplayer&"<param name=""fullScreen"" value=""0""> "&vbcrlf
videoplayer = videoplayer&"<param name=""enableErrorDialogs"" value=""-1""> "&vbcrlf
videoplayer = videoplayer&"<param name=""SAMIStyle"" value> "&vbcrlf
videoplayer = videoplayer&"<param name=""SAMILang"" value> " &vbcrlf
videoplayer = videoplayer&"<param name=""SAMIFilename"" value> "&vbcrlf
videoplayer = videoplayer&"</object> "&vbcrlf
elseif rs("shuaiweb_videotype") = 2 then
videoplayer = videoplayer&"<object codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"" height="&rs("shuaiweb_videoheight")&" width="&rs("shuaiweb_videowidth")&" classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"">"&vbcrlf
videoplayer = videoplayer&"<param value="""&sw_dizhi&"images/Flvplayer.swf"" name=""movie"" />"&vbcrlf
videoplayer = videoplayer&"<param value=""high"" name=""quality"" />"&vbcrlf
videoplayer = videoplayer&"<param value=""true"" name=""allowFullScreen"" />"&vbcrlf
videoplayer = videoplayer&"<param value=""vcastr_file="&rs("shuaiweb_videourl")&"&amp;LogoText=yidacms.com&IsAutoPlay=0&amp;BufferTime=3"" name=""FlashVars"" /></object>"&vbcrlf
elseif rs("shuaiweb_videotype") = 1 then
videoplayer = videoplayer&"<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"" width="&rs("shuaiweb_videowidth")&" height="&rs("shuaiweb_videoheight")&">"&vbcrlf
videoplayer = videoplayer&"  <param name=""movie"" value="&rs("shuaiweb_videourl")&" />"&vbcrlf
videoplayer = videoplayer&"  <param name=""quality"" value=""high"" />"&vbcrlf
videoplayer = videoplayer&"  <embed src="&rs("shuaiweb_videourl")&" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width="&rs("shuaiweb_videowidth")&" height="&rs("shuaiweb_videoheight")&"></embed>"&vbcrlf
videoplayer = videoplayer&"</object>"&vbcrlf
end if
End Function
%>