<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/System_Language.asp" -->
<!--#include file="../Include/Version.Asp" -->
<!--#include file="SC_Config.Asp"-->
<!--#include file="SC_Function.Asp"-->

<!--#include file="SC_About.Asp"-->
<!--#include file="SC_AboutSort.Asp"-->
<!--#include file="SC_Case.Asp"-->
<!--#include file="SC_CaseSort.Asp"-->
<!--#include file="SC_Download.Asp"-->
<!--#include file="SC_DownloadSort.Asp"-->
<!--#include file="SC_Video.Asp"-->
<!--#include file="SC_VideoSort.Asp"-->
<!--#include file="SC_Recruitment.asp"-->
<!--#include file="SC_RecruitmentSort.Asp"-->
<!--#include file="SC_News.Asp"-->
<!--#include file="SC_NewsSort.Asp"-->
<!--#include file="SC_Product.Asp"-->
<!--#include file="SC_ProductSort.Asp"-->
<!--#include file="SC_Index.Asp"-->

<%
'生成全站静态方法
Call SiteInfo()
Table = request("Table")
bkkey = request("bkkey")
If bkkey = "PC" Then
	Flag = " ViewFlag "
	TemplatePath = TemplatePath
End If
If bkkey = "Mobile" Then
	Flag = " MobileFlag "
	TemplatePath = mTemplatePath
End If

'生成企业信息＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
set rsSite = server.CreateObject("adodb.recordset")
rsSite.open "select * from BokeCMS_Module where DataForm=1", conn, 1, 2
If rsSite("ViewFlag") Then
	ErrMsg = ErrMsg & "======"&rsSite("SystemName")&"=======<br />"
	If Checkfile(TemplatePath&"/html/AboutView.html") Then
		Set rshtml = Conn.Execute("Select * from BokeCMS_About where "&Flag)
		do while not rshtml.eof
			Call html_To_About(rshtml("ID"), bkkey)
			rshtml.movenext
		loop
		rshtml.close : set rshtml = Nothing
		ErrMsg = ErrMsg & rsSite("SystemName") & "的详细页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的AboutView.html模板未找到，详细页未生成</font><br />"
	End If

	If not Checkfile(TemplatePath&"/html/About.html") and not Checkfile(TemplatePath&"/html/AboutView.html") Then
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的About.html和AboutView.html模板均未找到，栏目页未生成</font><br />"
	Else
		Call html_To_AboutSort("Index."&HTMLName, bkkey)
		ErrMsg = ErrMsg & rsSite("SystemName") & "的栏目页生成成功<br />"
	End If
End If
rsSite.close : set rsSite = nothing

'生成新闻资讯＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
set rsSite = server.CreateObject("adodb.recordset")
rsSite.open "select * from BokeCMS_Module where DataForm=2", conn, 1, 2
If rsSite("ViewFlag") Then
	ErrMsg = ErrMsg & "======"&rsSite("SystemName")&"=======<br />"
	If Checkfile(TemplatePath&"/html/NewsView.html") Then
		Set rshtml = Conn.Execute("Select * from BokeCMS_News where "&Flag)
		do while not rshtml.eof
			Call html_To_News(rshtml("ID"), bkkey)	
			rshtml.movenext
		loop
		rshtml.close : set rshtml = Nothing		
		ErrMsg = ErrMsg & rsSite("SystemName") & "的详细页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的NewsView.html模板未找到，详细页未生成</font><br />"
	End If
	
	If Checkfile(TemplatePath&"/html/NewsList.html") Then
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:NewsList([\s\S]*?)}([\s\S]*?){/bokecms:NewsList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/NewsList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_News Where "&Flag, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		rs.close : set rs = nothing
		If totalpage = 0 then totalpage = totalpage + 1
		
		For n = 1 To totalpage
			Call html_To_NewsSort("", "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next
		
		Set rshtml = Server.CreateObject("ADODB.Recordset")
		sql = "select * from BokeCMS_NewsSort order by ID desc"
		rshtml.Open sql, conn, 1, 1
		If Not rshtml.EOF Then
			Do While Not rshtml.EOF
				ID = rshtml("ID")
				set rs = server.CreateObject("adodb.recordset")
				rs.open "Select * from BokeCMS_News where "&Flag&" and instr(SortPath,'"&rshtml("SortPath")&"')>0",conn,1,2
				rs.pagesize = MarPage
				totalpage = rs.pagecount
				rs.close : set rs = nothing
				If totalpage = 0 then totalpage = totalpage + 1
				Call html_To_NewsSort(ID, "Index."&HTMLName, 1, bkkey)
				For n = 1 To totalpage
					Call html_To_NewsSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
				Next
				rshtml.movenext
			Loop
		End If
		rshtml.Close : Set rshtml = Nothing
		ErrMsg = ErrMsg & rsSite("SystemName") & "的列表页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的NewsList.html模板未找到，列表页未生成</font><br />"
	End If

	If not Checkfile(TemplatePath&"/html/News.html") and not Checkfile(TemplatePath&"/html/NewsList.html") Then
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "News.html和NewsList.html模板均未找到，栏目页未生成</font><br />"
	Else
		Call html_To_NewsSort("", "Index."&HTMLName, "", bkkey)
		ErrMsg = ErrMsg & rsSite("SystemName") & "的栏目页生成成功<br />"
	End If
End If
rsSite.close : set rsSite = nothing

'生成企业产品====================
set rsSite = server.CreateObject("adodb.recordset")
rsSite.open "select * from BokeCMS_Module where DataForm=3", conn, 1, 2
If rsSite("ViewFlag") Then
	ErrMsg = ErrMsg & "======"&rsSite("SystemName")&"=======<br />"
	If Checkfile(TemplatePath&"/html/ProductView.html") Then
		Set rshtml = Conn.Execute("Select * from BokeCMS_Product where "&Flag)
		do while not rshtml.eof
			Call html_To_Product(rshtml("ID"), bkkey)	
			rshtml.movenext
		loop
		rshtml.close : set rshtml = Nothing		
		ErrMsg = ErrMsg & rsSite("SystemName") & "的详细页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的ProductView.html模板未找到，详细页未生成</font><br />"
	End If

	If Checkfile(TemplatePath&"/html/ProductList.html") Then
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:ProductList([\s\S]*?)}([\s\S]*?){/bokecms:ProductList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/ProductList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Product Where "&Flag, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		rs.close : set rs = nothing
		If totalpage = 0 then totalpage = totalpage + 1
		
		For n = 1 To totalpage
			Call html_To_ProductSort("", "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next
		
		Set rshtml = Server.CreateObject("ADODB.Recordset")
		sql = "select * from BokeCMS_ProductSort order by ID desc"
		rshtml.Open sql, conn, 1, 1
		
		If Not rshtml.EOF Then
			Do While Not rshtml.EOF
				ID = rshtml("ID")
				set rs = server.CreateObject("adodb.recordset")
				rs.open "Select * from BokeCMS_Product where "&Flag&" and instr(SortPath,'"&rshtml("SortPath")&"')>0",conn,1,2
				rs.pagesize = MarPage
				totalpage = rs.pagecount
				rs.close : set rs = nothing
				If totalpage = 0 then totalpage = totalpage + 1
				Call html_To_ProductSort(ID, "Index."&HTMLName, 1, bkkey)
				For n = 1 To totalpage
					Call html_To_ProductSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
				Next
				rshtml.movenext
			Loop
		End If
		rshtml.Close : Set rshtml = Nothing
		ErrMsg = ErrMsg & rsSite("SystemName") & "的列表页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的ProductList.html模板未找到，列表页未生成</font><br />"
	End If

	If not Checkfile(TemplatePath&"/html/Product.html") and not Checkfile(TemplatePath&"/html/ProductList.html") Then
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的Product.html和ProductList.html模板均未找到，栏目页未生成</font><br />"
	Else
		Call html_To_ProductSort("", "Index."&HTMLName, "", bkkey)
		ErrMsg = ErrMsg & rsSite("SystemName") & "的栏目页生成成功<br />"
	End If
End If
rsSite.close : set rsSite = nothing

'生成企业案例＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
set rsSite = server.CreateObject("adodb.recordset")
rsSite.open "select * from BokeCMS_Module where DataForm=4", conn, 1, 2
If rsSite("ViewFlag") Then
	ErrMsg = ErrMsg & "======"&rsSite("SystemName")&"=======<br />"
	If Checkfile(TemplatePath&"/html/CaseView.html") Then
		Set rshtml = Conn.Execute("Select * from BokeCMS_Case where "&Flag)
		do while not rshtml.eof
			Call html_To_Case(rshtml("ID"), bkkey)	
			rshtml.movenext
		loop
		rshtml.close : set rshtml = Nothing
		ErrMsg = ErrMsg & rsSite("SystemName") & "的详细页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的CaseView.html模板未找到，详细页未生成</font><br />"
	End If

	If Checkfile(TemplatePath&"/html/CaseList.html") Then
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:CaseList([\s\S]*?)}([\s\S]*?){/bokecms:CaseList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/CaseList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Case Where "&Flag, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		rs.close : set rs = nothing
		If totalpage = 0 then totalpage = totalpage + 1
		
		For n = 1 To totalpage
			Call html_To_CaseSort("", "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next
	
		Set rshtml = Server.CreateObject("ADODB.Recordset")
		sql = "select * from BokeCMS_CaseSort order by ID desc"
		rshtml.Open sql, conn, 1, 1
		If Not rshtml.EOF Then
			Do While Not rshtml.EOF
				ID = rshtml("ID")
				set rs = server.CreateObject("adodb.recordset")
				rs.open "Select * from BokeCMS_Case where "&Flag&" and instr(SortPath,'"&rshtml("SortPath")&"')>0",conn,1,2
				rs.pagesize = MarPage
				totalpage = rs.pagecount
				rs.close : set rs = nothing
				If totalpage = 0 then totalpage = totalpage + 1
				Call html_To_CaseSort(ID, "Index."&HTMLName, 1, bkkey)
				For n = 1 To totalpage
					Call html_To_CaseSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
				Next
				rshtml.movenext
			Loop
		End If
		rshtml.Close : Set rshtml = Nothing
		ErrMsg = ErrMsg & rsSite("SystemName") & "的列表页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的CaseList.html模板未找到，列表页未生成</font><br />"
	End If

	If not Checkfile(TemplatePath&"/html/Case.html") and not Checkfile(TemplatePath&"/html/CaseList.html") Then
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的Case.html和CaseList.html模板未找到，栏目页未成功</font><br />"
	Else
		Call html_To_CaseSort("", "Index."&HTMLName, "", bkkey)
		ErrMsg = ErrMsg & rsSite("SystemName") & "的栏目页生成成功<br />"
	End If
End If
rsSite.close : set rsSite = nothing

'生成下载中心＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
set rsSite = server.CreateObject("adodb.recordset")
rsSite.open "select * from BokeCMS_Module where DataForm=5", conn, 1, 2
If rsSite("ViewFlag") Then
	ErrMsg = ErrMsg & "======"&rsSite("SystemName")&"=======<br />"
	If Checkfile(TemplatePath&"/html/DownloadView.html") Then
		Set rshtml = Conn.Execute("Select * from BokeCMS_Download where "&Flag)
		do while not rshtml.eof
			Call html_To_Download(rshtml("ID"), bkkey)	
			rshtml.movenext
		loop
		rshtml.close : set rshtml = Nothing		
		ErrMsg = ErrMsg & rsSite("SystemName") & "的详细页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的DownloadView.html模板未找到，详细页未生成</font><br />"
	End If

	If Checkfile(TemplatePath&"/html/DownloadList.html") Then
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:DownList([\s\S]*?)}([\s\S]*?){/bokecms:DownList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/DownloadList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Download Where "&Flag, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		rs.close : set rs = nothing
		If totalpage = 0 then totalpage = totalpage + 1
		
		For n = 1 To totalpage
			Call html_To_DownSort("", "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next
		
		Set rshtml = Server.CreateObject("ADODB.Recordset")
		sql = "Select * from BokeCMS_DownSort Order by ID Desc"
		rshtml.Open sql, conn, 1, 1
		If Not rshtml.EOF Then
			Do While Not rshtml.EOF
				ID = rshtml("ID")
				set rs = server.CreateObject("adodb.recordset")
				rs.open "Select * from BokeCMS_Download Where "&Flag&" and instr(SortPath,'"&rshtml("SortPath")&"')>0",conn,1,2
				rs.pagesize = MarPage
				totalpage = rs.pagecount
				rs.close : set rs = nothing
				If totalpage = 0 then totalpage = totalpage + 1
				Call html_To_DownSort(ID, "Index."&HTMLName, 1, bkkey)
				For n = 1 To totalpage
					Call html_To_DownSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
				Next
				rshtml.movenext
			Loop
		End If
		rshtml.Close : Set rshtml = Nothing
		ErrMsg = ErrMsg & rsSite("SystemName") & "的列表页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的DownloadList.html模板未找到，列表页未生成</font><br />"
	End If

	If not Checkfile(TemplatePath&"/html/Download.html") and not Checkfile(TemplatePath&"/html/DownloadList.html") Then
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的Download.html和DownloadList.html模板未找到，未生成</font><br />"
	Else
		ErrMsg = ErrMsg & rsSite("SystemName") & "的栏目页生成成功<br />"
		Call html_To_DownSort("", "Index."&HTMLName, "", bkkey)
	End If
End If
rsSite.close : set rsSite = nothing

'生成招聘＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
set rsSite = server.CreateObject("adodb.recordset")
rsSite.open "select * from BokeCMS_Module where DataForm=6", conn, 1, 2
If rsSite("ViewFlag") Then
	ErrMsg = ErrMsg & "======"&rsSite("SystemName")&"=======<br />"
	If Checkfile(TemplatePath&"/html/RecruitmentView.html") Then
		Set rshtml = Conn.Execute("Select * from BokeCMS_Recruitment where "&Flag)
		do while not rshtml.eof
			Call html_To_Recruitment(rshtml("ID"), bkkey)	
			rshtml.movenext
		loop
		rshtml.close : set rshtml = Nothing		
		ErrMsg = ErrMsg & rsSite("SystemName") & "的详细页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的RecruitmentView.html模板未找到，详细未生成</font><br />"
	End If
	
	If Checkfile(TemplatePath&"/html/RecruitmentList.html") Then
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:RecruitmentList([\s\S]*?)}([\s\S]*?){/bokecms:RecruitmentList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/RecruitmentList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Recruitment Where "&Flag, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		rs.close : set rs = nothing
		If totalpage = 0 then totalpage = totalpage + 1
		
		For n = 1 To totalpage
			Call html_To_RecruitmentSort("Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next
		ErrMsg = ErrMsg & rsSite("SystemName") & "的列表页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的RecruitmentList.html模板未找到，列表页未生成</font><br />"
	End If

	If not Checkfile(TemplatePath&"/html/Recruitment.html") and not Checkfile(TemplatePath&"/html/RecruitmentList.html") Then
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的Recruitment.html和RecruitmentList.html模板未找到，未生成</font><br />"
	Else
		Call html_To_RecruitmentSort("Index."&HTMLName, "", bkkey)
		ErrMsg = ErrMsg & rsSite("SystemName") & "的栏目页生成成功<br />"
	End If
End If
rsSite.close : set rsSite = nothing

'生成视频中心＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
set rsSite = server.CreateObject("adodb.recordset")
rsSite.open "select * from BokeCMS_Module where DataForm=7", conn, 1, 2
If rsSite("ViewFlag") Then
	ErrMsg = ErrMsg & "======"&rsSite("SystemName")&"=======<br />"
	If Checkfile(TemplatePath&"/html/VideoView.html") Then
		Set rshtml = Conn.Execute("Select * from BokeCMS_Video where "&Flag)
		do while not rshtml.eof
			Call html_To_Video(rshtml("ID"), bkkey)	
			rshtml.movenext
		loop
		rshtml.close : set rshtml = Nothing		
		ErrMsg = ErrMsg & rsSite("SystemName") & "的详细页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的VideoView.html模板未找到，详细页未生成</font><br />"
	End If

	If Checkfile(TemplatePath&"/html/VideoList.html") Then
		set strDictionary = server.CreateObject("SCRIPTING.DICTIONARY")
		Set regExpObj = New Regexp
		regExpObj.IgnoreCase = True
		regExpObj.Global = True
		regExpObj.Pattern="{bokecms:VideoList([\s\S]*?)}([\s\S]*?){/bokecms:VideoList}"
		replace_code = ReadFromUTF(TemplatePath&"/html/VideoList.html","utf-8")
		set matches = regExpObj.Execute(replace_code)
		for each match in matches
			labelStr = match.SubMatches(0)
			set labelArr = parseArr(labelStr)
			lPageFlag = labelArr("PageFlag")
			If lPageFlag = "True" Then MarPage = labelArr("Num")
		next
		set matches = nothing
		Set regExpObj = nothing
		set strDictionary = nothing
		
		set rs = server.CreateObject("adodb.recordset")
		rs.open "Select * from BokeCMS_Video Where "&Flag, conn, 1, 2
		rs.pagesize = MarPage
		totalpage = rs.pagecount
		rs.close : set rs = nothing
		If totalpage = 0 then totalpage = totalpage + 1
		
		For n = 1 To totalpage
			Call html_To_VideoSort("", "Index"&Separated&n&"."&HTMLName, n, bkkey)
		Next
		
		Set rshtml = Server.CreateObject("ADODB.Recordset")
		sql = "Select * from BokeCMS_VideoSort Order by ID Desc"
		rshtml.Open sql, conn, 1, 1
		If Not rshtml.EOF Then
			Do While Not rshtml.EOF
				ID = rshtml("ID")
				set rs = server.CreateObject("adodb.recordset")
				rs.open "Select * from BokeCMS_Video Where "&Flag&" and instr(SortPath,'"&rshtml("SortPath")&"')>0",conn,1,2
				rs.pagesize = MarPage
				totalpage = rs.pagecount
				rs.close : set rs = nothing
				If totalpage = 0 then totalpage = totalpage + 1
				Call html_To_VideoSort(ID, "Index."&HTMLName, 1, bkkey)
				For n = 1 To totalpage
					Call html_To_VideoSort(ID, "Index"&Separated&n&"."&HTMLName, n, bkkey)
				Next
				rshtml.movenext
			Loop
		End If
		rshtml.Close : Set rshtml = Nothing
		ErrMsg = ErrMsg & rsSite("SystemName") & "的列表页生成成功<br />"
	Else
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的VideoList.html模板未找到，列表页未生成</font><br />"
	End If

	If not Checkfile(TemplatePath&"/html/Video.html") and not Checkfile(TemplatePath&"/html/VideoList.html") Then
		ErrMsg = ErrMsg & "<font style='color:#F00'>" & rsSite("SystemName") & "的Video.html和VideoList.html模板未找到，未生成</font><br />"
	Else
		ErrMsg = ErrMsg & rsSite("SystemName") & "的栏目页生成成功<br />"
		Call html_To_VideoSort("", "Index."&HTMLName, "", bkkey)
	End If
End If
rsSite.close : set rsSite = nothing

'生成首页等＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
If Checkfile(TemplatePath&"/html/Index.html") Then
	Call html_To_Index("Index", bkkey)
	ErrMsg = ErrMsg & "<br />首页生成成功<br />"
Else
	ErrMsg = ErrMsg & "<font style='color:#F00'>首页模板未找到，未生成</font><br />"
End If
If Checkfile(TemplatePath&"/html/Contact.html") Then
	Call html_To_Index("Contact", bkkey)
	ErrMsg = ErrMsg & "联系生成成功<br />"
Else
	ErrMsg = ErrMsg & "<font style='color:#F00'>首页的模板未找到，未生成</font><br />"
End If
If Checkfile(TemplatePath&"/html/Message.html") Then
	Call html_To_Index("Message", bkkey)
	ErrMsg = ErrMsg & "留言生成成功<br />"
Else
	ErrMsg = ErrMsg & "<font style='color:#F00'>留言的模板未找到，未生成</font><br />"
End If

response.Write ErrMsg
%>