<%
'生成新闻详细静态方法
Function html_To_News(ID, Ke01)
	dim newHtml
	set newHtml = new Html
	
	Call SiteInfo()
	Set rs = server.CreateObject("adodb.recordset")
	rs.open "select * from keyicms_News where ID=" & ID, Conn, 1, 2
	NewsName = rs("NewsName")
	ClassSeo = rs("ClassSeo")
	Origin = rs("Origin")
	Text = rs("Text")
	Color = rs("Color")
	Bold = rs("Bold")
	SmallPic = rs("SmallPic")
	UpdateTime = rs("UpdateTime")
	Content = rs("Content")
	SortID = rs("SortID")
	SortName = Conn.execute("select * from keyicms_NewsSort where ID=" & rs("SortID"))("SortName")
	SeoTitle = rs("NewsName")
	If rs("SeoKeywords") <> "" Then
		SeoKeywords = rs("SeoKeywords")
	Else
		SeoKeywords = rs("NewsName")
	End If
	If rs("SeoDescription") <> "" Then
		SeoDescription = rs("SeoDescription")
	Else
		SeoDescription = rs("NewsName")
	End If
	rs.close : set rs = nothing

	If Ke01 = "PC" Then
		FilePath = RootHost & "/" & NewsDir & "/" & ClassSeo & Separated & ID & "." & HTMLName
		TemplatePath = TemplatePath
		TemplatePath = TemplatePath
	End If
	If Ke01 = "Mobile" Then
		FilePath = RootHost & "/" & mFolder & "/" & NewsDir & "/" & ClassSeo & Separated & ID & "." & HTMLName
		TemplatePath = mTemplatePath
		TemplatePath = mTemplatePath
	End If

	If SiteStatus Then
		If Ke01 = "PC" Then Flag = "ViewFlag"
		If Ke01 = "Mobile" Then Flag = "MobileFlag"
	
		set rs = server.CreateObject("adodb.recordset")
		rs.open "select top 1 * from keyicms_News 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("NewsName")
		end if
		rs.close
		rs.open "select top 1 * from keyicms_News 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("NewsName")
		end if
		rs.close : set rs = nothing

		with newHtml
			.ReadFromUTF TemFilePath & "/NewsView.dwt", "utf-8"
			.Include()
			.Position SortID, 2
			.ReplaceCommon()

			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:ID}", ID)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:NewsName}", NewsName)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:Origin}", Origin)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:Text}", Text)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:Color}", Color)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:Bold}", Bold)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:SmallPic}", SmallPic)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:SortID}", SortID)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:SortName}", SortName)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:Content}", Content)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:SeoTitle}", SeoTitle)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:SeoKeywords}", SeoKeywords)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:SeoDescription}", SeoDescription)
			newHtml.replace_code = ParseTime(newHtml.replace_code, UpdateTime, "UpdateTime")

			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:PrevName}", PrevName)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:PrevLink}", PrevLink)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:NextName}", NextName)
			newHtml.replace_code = replace(newHtml.replace_code, "{keyicms:NextLink}", NextLink)

			.KE01_If()

			If Ke01 = "PC" Then newHtml.replace_code = newHtml.replace_code & ConstJs
		end with
	Else
		newHtml.replace_code = ExplainJS
	End If
	newHtml.WriteToUTF(FilePath)
	set newHtml = nothing
End Function
%>