<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Ubbcode_Setup.asp -->
<!-- #include file=../../inc/Board_popfun.asp -->
<!-- #include file=../inc/bbsmanage_Fun.asp -->
<%
DEF_BBS_HomeUrl = "../../"
Const MaxLinkNum = 100
Dim GBL_ID
initDatabase
GBL_CHK_TempStr = ""
GBL_ID = CheckSupervisorPass

Dim Form_FiltrateBadWordString,Form_DEF_MaxUBBNumber,Form_DEF_UbbUnderwriteImages,Form_DEF_UbbDefaultEdit

GetDefaultValue

SiteHead(DEF_SiteNameString & " - 管理员")
UserTopicTopInfo
DisplayUserNavigate("UBB编码参数设置")
If GBL_CHK_Flag = 1 Then
	SiteLink
Else%>
	<table width=96%>
	<tr>
	<td>
	<%
	If Request("submitflag")="" Then
		Response.Write "<br><b>请先登录</b>"
	Else
		Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
	End If
	DisplayLoginForm
	Response.Write "</p>"%>
	</td>
	</tr>
	</table>
<%End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function SiteLink

%>
<form name="pollform3sdx" method="post" action="UbbcodeSetup.asp">
<input type="hidden" name="SubmitFlag" value=yes>
<p>
	<b>
		<a href=SiteSetup.asp>论坛常用参数设置</a> <a href=SiteSetup.asp>上传参数设置</a>
		<a href=../User/UserSetup.asp>用户注册参数设置</a>
		<font color=gray class=GrayFont>UBB编码参数设置</font>
		</b>
		<br><font color=8888888 class=GrayFont>(下面为网站参数，请注意修改，错误的设置将会发生严重错误)<br><br>
		如果在设置后发现网站不能正常运行，请将LeadBBS最新版的inc/Upload_Setup.asp覆盖回去</font>
</p>
<%If Request.Form("SubmitFlag") <> "" Then
	CheckLinkValue
End If%>
<b><font color=ff0000 class=RedFont><%=GBL_CHK_TempStr%></font></b>
<p>
<%
If Request.Form("SubmitFlag") <> "" Then
	If GBL_CHK_TempStr <> "" Then
		DisplayDatabaseLink
	Else
		MakeDataBaseLinkFile
		Exit Function
	End If
Else
	DisplayDatabaseLink
End If
%>
<br>
<input type=submit name=提交 value=提交 class=fmbtn>
<input type=reset name=取消 value=取消 class=fmbtn>
</form>
<%

End Function

Function CheckLinkValue

	GetFormValue

End Function

Function DisplayDatabaseLink

		%>
		<table border=0 cellpadding=5 cellspacing=1 width="100%" bgcolor="<%=DEF_BBS_LightColor%>" class=TBBG1>
		<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<td width=50>脏字过滤</td>
			<td><input class=fminpt type="text" name="Form_FiltrateBadWordString" maxlength="1024" size="50" value="<%=htmlencode(Form_FiltrateBadWordString)%>"><font color=gray> <br>
			使用|符号分隔，脏字符自动替换为＊号</font></td>
		</tr>
		<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<td>表情数量</td>
			<td><input class=fminpt type="text" name="Form_DEF_MaxUBBNumber" maxlength="3" size="10" value="<%=htmlencode(Form_DEF_MaxUBBNumber)%>">
			<br><font color=gray>(每表情符号最多允许显示数量，多出的不再编码为表情图片)</font></td>
		</tr>
		<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<td>签名图片</td>
			<td><table border=0 cellpadding=0 cellspacing=0><tr>
				<td><input class=fmchkbox type=radio name=Form_DEF_UbbUnderwriteImages value=0<%If Form_DEF_UbbUnderwriteImages = 0 Then%> checked<%End If%>></td><td>关闭</td>
          		<td><input class=fmchkbox type=radio name=Form_DEF_UbbUnderwriteImages value=1<%If Form_DEF_UbbUnderwriteImages = 1 Then%> checked<%End If%>></td><td>启用</td>
          		<td>&nbsp; (<font color=gray>是否允许图片作为签名</font>)</td>
          		</tr></table></td>
		</tr>
		<tr bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<td>发帖模式</td>
			<td><table border=0 cellpadding=0 cellspacing=0><tr>
				<td><input class=fmchkbox type=radio name=Form_DEF_UbbDefaultEdit value=0<%If Form_DEF_UbbDefaultEdit = 0 Then%> checked<%End If%>></td><td>高级模式</td>
          		<td><input class=fmchkbox type=radio name=Form_DEF_UbbDefaultEdit value=1<%If Form_DEF_UbbDefaultEdit = 1 Then%> checked<%End If%>></td><td>普通模式</td>
          		</tr></table>
          		&nbsp; (<font color=gray>指定默认的发帖模式，高级模式允许在线编辑网页</font>)</td>
		</tr>
		</table>
		<%

End Function

Function GetDefaultValue

	Form_FiltrateBadWordString = FiltrateBadWordString
	Form_DEF_MaxUBBNumber = DEF_MaxUBBNumber
	Form_DEF_UbbDefaultEdit = DEF_UbbDefaultEdit
	Form_DEF_UbbUnderwriteImages = DEF_UbbUnderwriteImages

End Function

Function GetFormValue

	Form_FiltrateBadWordString = Trim(Request.Form("Form_FiltrateBadWordString"))
	Form_DEF_MaxUBBNumber = Trim(Request.Form("Form_DEF_MaxUBBNumber"))
	Form_DEF_UbbUnderwriteImages = Trim(Request.Form("Form_DEF_UbbUnderwriteImages"))
	Form_DEF_UbbDefaultEdit = Trim(Request.Form("Form_DEF_UbbDefaultEdit"))

	If inStr(Form_FiltrateBadWordString,"""") Then GBL_CHK_TempStr = "脏字过滤不能包含有引号<br>" & VbCrLf
	If isNumeric(Form_DEF_MaxUBBNumber) = 0 Then GBL_CHK_TempStr = "表情数量必须为数字<br>" & VbCrLf
	If isNumeric(Form_DEF_UbbUnderwriteImages) = 0 Then GBL_CHK_TempStr = "是否允许签名图片必须为数字<br>" & VbCrLf
	If isNumeric(Form_DEF_UbbDefaultEdit) = 0 Then GBL_CHK_TempStr = "发帖模式必须为数字<br>" & VbCrLf

End Function

Function MakeDataBaseLinkFile

	Dim n,TempStr
	TempStr = ""
	TempStr = TempStr & chr(60) & "%" & VbCrLf
	TempStr = TempStr & "const FiltrateBadWordString=" & Chr(34) & Replace(Form_FiltrateBadWordString,Chr(34),Chr(34) & Chr(34)) & Chr(34) & VbCrLf
	TempStr = TempStr & "const DEF_MaxUBBNumber = " & Form_DEF_MaxUBBNumber & VbCrLf
	TempStr = TempStr & "const DEF_UbbUnderwriteImages = " & Form_DEF_UbbUnderwriteImages & VbCrLf
	TempStr = TempStr & "const DEF_UbbDefaultEdit = " & Form_DEF_UbbDefaultEdit & VbCrLf

	TempStr = TempStr & "%" & chr(62) & VbCrLf

	ADODB_SaveToFile TempStr,"../../inc/Ubbcode_Setup.asp"
	If GBL_CHK_TempStr = "" Then
		Response.Write "<br><font color=Green class=GreenFont>2.成功完成设置！</font>"
	Else
		%><%=GBL_CHK_TempStr%><br>服务器不支持在线写入文件功能，请使用FTP等功能，将<font color=Red Class=RedFont>../../inc/Ubbcode_Setup.asp</font>文件替换成框中内容(注意备份)<p>
		<textarea name="fileContent" cols="80" rows="30" class=fmtxtra><%=Server.htmlencode(TempStr)%></textarea><%
		GBL_CHK_TempStr = ""
	End If

End Function%>