<%
'生成视频详细静态方法
Function html_To_Video(ID, bkkey)
	Call SiteInfo()	
	Set rs = server.CreateObject("adodb.recordset")
	rs.open "select * from BokeCMS_Video where ID="&ID,conn,1,2
	VideoName = rs("VideoName")
	Origin = rs("Origin")
	ClassSeo = rs("ClassSeo")
	Content = rs("Content")
	AddTime = rs("AddTime")
	UpdateTime = rs("UpdateTime")
	FileSize = rs("FileSize")
	FileUrl = rs("FileUrl")
	thumbnail = rs("thumbnail")
	SortID = rs("SortID")
	SortName = Conn.execute("select * from BokeCMS_VideoSort where ID="&rs("SortID"))("SortName")	
	SeoTitle = rs("VideoName")
	If rs("SeoKeywords") <> "" Then
		SeoKeywords = rs("SeoKeywords")
	Else
		SeoKeywords = rs("VideoName")
	End If
	If rs("SeoDescription") <> "" Then
		SeoDescription = rs("SeoDescription")
	Else
		SeoDescription = rs("VideoName")
	End If
	Call CloseRs(rs)

 set rs=server.CreateObject("adodb.recordset")
 rs.Open "select top 1 * from  BokeCMS_Web",conn,1,1		  
Videoad=rs("Videoad")
Videoad=split(Videoad,"|")
Videoad1=Videoad(0)
Videoad2=Videoad(1)
Videoad3=Videoad(2)
Videoad4=Videoad(3)
Videoad5=Videoad(4)

adlink1=Videoad(5)
adlink2=Videoad(6)
adlink3=Videoad(7)
adlink4=Videoad(8)
adlink5=Videoad(9)

SiteRun1=Videoad(10)
SiteRun2=Videoad(11)
SiteRun3=Videoad(12)
SiteRun4=Videoad(13)
SiteRun5=Videoad(14)

cs1=Videoad(15)
cs2=Videoad(16)
cs3=Videoad(17)
cs4=Videoad(18)
cs5=Videoad(19)
cs6=Videoad(20)
cs7=Videoad(21)
cs8=Videoad(22)
cs9=Videoad(23)
cs10=Videoad(24)
cs11=Videoad(25)
cs12=Videoad(26)
cs13=Videoad(27)
cs14=Videoad(28)
cs15=Videoad(29)
cs16=Videoad(30)
cs17=Videoad(31)
cs18=Videoad(32)
cs19=Videoad(33)
cs20=Videoad(34)

gtitle=rs("gtitle")
gtitle=split(gtitle,"|")
gtitle1=gtitle(0)
gtitle2=gtitle(1)
gtitle3=gtitle(2)
gtitle4=gtitle(3)
gtitle5=gtitle(4)
glink1=gtitle(5)
glink2=gtitle(6)
glink3=gtitle(7)
glink4=gtitle(8)
glink5=gtitle(9)
Call CloseRs(rs)

Dim wz1,wz2
If cs4=1 Then wz1="top-left"
If cs4=2 Then wz1="top-right"
If cs4=3 Then wz1="bottom-left"
If cs4=4 Then wz1="bottom-right"
If cs7=1 Then wz2="top-left"
If cs7=2 Then wz2="top-right"
If cs7=3 Then wz2="bottom-left"
If cs7=4 Then wz2="bottom-right"

If cs18=1 Then
cs18="yes"
Else
cs18="no"
End If
If cs19=1 Then
cs19="yes"
Else
cs19="no"
End If
If cs20=1 Then
cs20="yes"
Else
cs20="no"
End if


	If bkkey = "PC" Then Flag = "ViewFlag"
	If bkkey = "Mobile" Then Flag = "MobileFlag"
	set rs = server.CreateObject("adodb.recordset")
	rs.open "select top 1 * from BokeCMS_Video where ID<" & ID & " and "&Flag&" Order by ID desc", Conn, 1, 2
	if rs.eof then
		PrevLink = "#" : PrevName = "没有了"
	else
		PrevLink = rs("ClassSeo") & Separated & rs("ID") & "." & HTMLName : PrevName = rs("VideoName")
	end if
	rs.close
	rs.open "select top 1 * from BokeCMS_Video where ID>" & ID & " and "&Flag&" Order by ID asc", Conn, 1, 2
	if rs.eof then
		NextLink = "#" : NextName = "没有了"
	else
		NextLink = rs("ClassSeo") & Separated & rs("ID") & "." & HTMLName : NextName = rs("VideoName")
	end if
	Call CloseRs(rs)

	If bkkey = "PC" Then
	'If LCase(Right(FileUrl,3))="flv" Or LCase(Right(FileUrl,3))="f4v" Or LCase(Right(FileUrl,3))="mp4" Or LCase(Right(FileUrl,3))="3gp" Then
		replace_code = ReadFromUTF(TemplatePath&"/html/VideoView.html","utf-8")
		'Else
		'replace_code = ReadFromUTF(TemplatePath&"/html/VideoView2.html","utf-8")
	'End if
		FilePath = "/"&VideoDir&"/"&ClassSeo&Separated&ID&"."&HTMLName&""
		TemplatePath = TemplatePath
	End If
	If bkkey = "Mobile" Then
		replace_code = ReadFromUTF(mTemplatePath&"/html/VideoView.html","utf-8")
		FilePath = "/wap/"&VideoDir&"/"&ClassSeo&Separated&ID&"."&HTMLName&""
		TemplatePath = mTemplatePath
	End If

	If SiteStatus Then
		replace_code = Position(replace_code, SortID, 7, bkkey)	
		replace_code = replace(replace_code, "{bokecms:SortName}", SortName)
		replace_code = replace(replace_code, "{bokecms:Origin}", Origin)
		replace_code = ReplaceCommon(replace_code, TemplatePath, bkkey)		
		replace_code = replace(replace_code, "{bokecms:ID}", ID)
		replace_code = replace(replace_code, "{bokecms:VideoName}", VideoName)
		'replace_code = replace(replace_code, "{bokecms:FileSize}", FileSize)
		replace_code = replace(replace_code, "{bokecms:FileUrl}", FileUrl)
		replace_code = replace(replace_code, "{bokecms:thumbnail}", thumbnail)
		replace_code = replace(replace_code, "{bokecms:SortID}", SortID)
		replace_code = replace(replace_code, "{bokecms:Content}", Content)		
		replace_code = replace(replace_code, "{bokecms:SeoTitle}", SeoTitle)
		replace_code = replace(replace_code, "{bokecms:SeoKeywords}", SeoKeywords)
		replace_code = replace(replace_code, "{bokecms:SeoDescription}", SeoDescription)
		replace_code = ParseTime(replace_code, AddTime, "AddTime")
		replace_code = ParseTime(replace_code, UpdateTime, "UpdateTime")
		replace_code = replace(replace_code, "{bokecms:PrevName}", PrevName)
		replace_code = replace(replace_code, "{bokecms:PrevLink}", PrevLink)
		replace_code = replace(replace_code, "{bokecms:NextName}", NextName)
		replace_code = replace(replace_code, "{bokecms:NextLink}", NextLink)

		replace_code = replace(replace_code, "{bokecms:wz1}",wz1)
		replace_code = replace(replace_code, "{bokecms:wz2}",wz2)
        replace_code = replace(replace_code, "{bokecms:SiteRun1}",SiteRun1)
		replace_code = replace(replace_code, "{bokecms:cs1}",cs1)
		replace_code = replace(replace_code, "{bokecms:cs2}",cs2)
		replace_code = replace(replace_code, "{bokecms:cs3}",cs3)
		replace_code = replace(replace_code, "{bokecms:cs4}",cs4)
		replace_code = replace(replace_code, "{bokecms:cs5}",cs5)
		replace_code = replace(replace_code, "{bokecms:cs6}",cs6)
		replace_code = replace(replace_code, "{bokecms:cs7}",cs7)
		replace_code = replace(replace_code, "{bokecms:cs8}",cs8)
		replace_code = replace(replace_code, "{bokecms:cs9}",cs9)
		replace_code = replace(replace_code, "{bokecms:cs10}",cs10)
		replace_code = replace(replace_code, "{bokecms:cs11}",cs11)
		replace_code = replace(replace_code, "{bokecms:cs12}",cs12)
		replace_code = replace(replace_code, "{bokecms:cs13}",cs13)
		replace_code = replace(replace_code, "{bokecms:cs14}",cs14)
		replace_code = replace(replace_code, "{bokecms:cs15}",cs15)
		replace_code = replace(replace_code, "{bokecms:cs16}",cs16)
		replace_code = replace(replace_code, "{bokecms:cs17}",cs17)
		replace_code = replace(replace_code, "{bokecms:cs18}",cs18)
		replace_code = replace(replace_code, "{bokecms:cs19}",cs19)
		replace_code = replace(replace_code, "{bokecms:cs20}",cs20)
		replace_code = replace(replace_code, "{bokecms:Videoad1}",Videoad1)
		replace_code = replace(replace_code, "{bokecms:Videoad2}",Videoad2)
		replace_code = replace(replace_code, "{bokecms:Videoad3}",Videoad3)
		replace_code = replace(replace_code, "{bokecms:Videoad4}",Videoad4)
		replace_code = replace(replace_code, "{bokecms:Videoad5}",Videoad5)
		replace_code = replace(replace_code, "{bokecms:adlink1}",adlink1)
		replace_code = replace(replace_code, "{bokecms:adlink2}",adlink2)
		replace_code = replace(replace_code, "{bokecms:adlink3}",adlink3)
		replace_code = replace(replace_code, "{bokecms:adlink4}",adlink4)
		replace_code = replace(replace_code, "{bokecms:adlink5}",adlink5)
		replace_code = replace(replace_code, "{bokecms:SiteRun1}",SiteRun1)
		replace_code = replace(replace_code, "{bokecms:SiteRun2}",SiteRun2)
		replace_code = replace(replace_code, "{bokecms:SiteRun3}",SiteRun3)
		replace_code = replace(replace_code, "{bokecms:SiteRun4}",SiteRun4)
		replace_code = replace(replace_code, "{bokecms:SiteRun5}",SiteRun5)

		replace_code = HtmlTo(replace_code, "", "", bkkey, "")
	Else
		replace_code = ExplainJS
	End If	
	If bkkey = "PC" Then replace_code = replace_code & ConstJs'ConstJs为自动跳转手机版
	'========视频滚动文字广告
		title_code = ReadFromUTF("/player/M_CuSunV3set.xml","utf-8")
		titlePath = "/player/CuSunV3set.xml"
		title_code = replace(title_code, "{bokecms:gtitle1}",gtitle1)
		title_code = replace(title_code, "{bokecms:gtitle2}",gtitle2)
		title_code = replace(title_code, "{bokecms:gtitle3}",gtitle3)
		title_code = replace(title_code, "{bokecms:gtitle4}",gtitle4)
		title_code = replace(title_code, "{bokecms:gtitle5}",gtitle5)
		title_code = replace(title_code, "{bokecms:glink1}",glink1)
		title_code = replace(title_code, "{bokecms:glink2}",glink2)
		title_code = replace(title_code, "{bokecms:glink3}",glink3)
		title_code = replace(title_code, "{bokecms:glink4}",glink4)
		title_code = replace(title_code, "{bokecms:glink5}",glink5)
        Call WriteToUTF(titlePath,title_code)
     '========视频滚动文字广告END
	Call WriteToUTF(FilePath, replace_code)
End Function
%>