<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/template.inc"-->
<%
Dim Action,message,m_strTitle
Action=LCase(NewAsp.CheckBadstr(Request("action")))
Select Case Action
	Case "lockip"	:	m_strTitle="IP 锁定"
	Case "stop"		:	m_strTitle="频道关闭"
	Case "close"
		m_strTitle="网站维护中"	:	message=NewAsp.MainSetting(9)
Case Else
	m_strTitle="出错啦"	:	message=CheckErrCodes(Request.Querystring("message"))
End Select

Call Main()
Call TPL_Flush()
NewAsp.PageEnd()

Sub Main()
	Dim strHTML
	strHTML = NewAsp.LoadTemplate("showerr")
	strHTML = Replace(strHTML, "{$pagetitle}",  "错误信息："&m_strTitle)
	strHTML = Replace(strHTML, "{$channelid}", 0)
	strHTML = Replace(strHTML, "{$classid}", 0)
	TPL_Scan strHTML
End Sub

Sub TPL_ParseNode(sTokenType, sTokenName, sVariant)
	Select Case sTokenType
		Case "newasp"
			ParseDataNode		sTokenName,sVariant
	Case Else
	End Select
End Sub

Sub ParseDataNode(sToken,sVariant)
	On Error Resume Next
	Select Case sToken
		Case "title"	:	TPL_Scan m_strTitle
		Case "message"	:	TPL_Scan message
		Case "ip"		:	TPL_Scan NewAsp.UserTrueIP
		Case "datetime"	:	TPL_Scan Now()
	End Select
	If Err Then Err.Clear
End Sub

Sub TPL_ParseArea(sTokenName, sTemplate)
	Select Case sTokenName
		Case "action=lockip"	:	If Action="lockip" Then TPL_Scan sTemplate
		Case "action=close"		:	If Action="close" Then TPL_Scan sTemplate
		Case "action=stop"		:	If Action="stop" Then TPL_Scan sTemplate
	End Select
End Sub

Function CheckErrCodes(ByVal strCode)
	Dim Re
	Set re=new RegExp
	re.IgnoreCase =True
	re.Global=True
	re.Pattern="<.[^>]*(style).>"
	strCode = re.Replace(strCode, "")
	re.Pattern="<(a.[^>]*|\/a|li|br|B|\/li|\/B|font.[^>]*|\/font)>"
	strCode=re.Replace(strCode,"[$1]")
	'strCode=Server.HTMLEncode(strCode)
	strCode=Replace(Replace(strCode, "<", "&lt;"), ">", "&gt;")
	re.Pattern="\[(a.[^\]]*|\/a|li|br|B|\/li|\/B|font.[^\]]*|\/font)\]"
	strCode=re.Replace(strCode,"<$1>")
	re.Pattern="<.[^>]*(on(load|click|dbclick|mouseover|mouseout|mousedown|mouseup|mousewheel|keydown|submit|change|focus)).>"
	strCode = re.Replace(strCode, "")
	Set Re=Nothing
	CheckErrCodes=strCode
End Function
%>