<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn/conn.asp"-->
<!--#include file="inc/Commoncode.asp"-->
<!--#include file="inc/CommonFunction.asp"-->
<%Call closeandopen(1)
Cid=0:MTID=0:Classid=0	
Set fso = Server.CreateObject(FR_HR_FSO)
If CreateHTML=1 then
	on error resume next
	Server.transfer(FormatLink(0,Cid,0,0,0))
	if err then
		err.clear
		Call TempIndex()
		conn.close: set conn = nothing
		Server.Transfer(FormatLink(0,Cid,0,0,0))
		if err then err.clear: response.write "<h1>Create Index error!</h1>": response.end
	end if
Else
Call TempIndex()
End if
Sub TempIndex()
'读取模版内容
html=LoadTemplate(Cid,0,0)
html=ReplaceLableFlag(ReplaceAllLabel(html))
html=Replace(html,"{$FR_频道编号}",Cid)
html=Replace(html,"{$FR_会员类型编号}",MTID)
html=Replace(html,"{$FR_本站公告}",""&Announcehtml(Cid,0)&"")
If CreateHTML=1 Then
HtmlFileName=Server.MapPath(""&FormatLinks(0,Cid,0,0,0)&"")
Set fout = fso.CreateTextFile(HtmlFileName)
	fout.WriteLine CreateHTMLReplace(html)&"<script src="&InstallDir&"autohtml/index.asp?id="&Cid&"></script>"
Set fout = Nothing
Else
Response.Write(CreateHTMLReplace(html))
End if
End Sub
Set fso = Nothing
Call CloseConn
%>