<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->
<!-- #include file=../../inc/Limit_Fun.asp -->
<!-- #include file=../inc/bbsmanage_Fun.asp -->
<!-- #include file=inc/ForumBoard_fun.asp -->
<%
DEF_BBS_HomeUrl = "../../"
Dim GBL_ID,GBL_ModifyID
initDatabase
GBL_CHK_TempStr = ""
GBL_ID = checkSupervisorPass

SiteHead(DEF_SiteNameString & " - 管理员")
UserTopicTopInfo
DisplayUserNavigate("论坛版面修改")%>
<br><br><%If GBL_CHK_Flag=1 Then
	LoginAccuessFul
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 LoginAccuessFul

%>
<b>修改版面</b>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td>
		<table width="100%" border="0" cellspacing="0" cellpadding="1"  bgcolor="<%=DEF_BBS_LightColor%>" class=TBBG1 align=right>
		<tr>
			<td>
				<table width="100%" border="0" cellspacing="1" cellpadding="5">
				<tr bgcolor="<%=DEF_BBS_LightestColor%>" class=TBBG9>
					<td>
<%
	GBL_ModifyID = Left(Request("GBL_ModifyID"),14)
	If isNumeric(GBL_ModifyID)=0 Then GBL_ModifyID=0
	GBL_ModifyID = cCur(GBL_ModifyID)
	If GetForumBoardData(GBL_MODIFYID) <> 0 Then
		GBL_BoardID=cCur(GBL_GetData(0,0))
		GBL_BoardID_Old = GBL_BoardID
		GBL_BoardAssort = cCur(GBL_GetData(1,0))
		GBL_BoardAssort_Old = GBL_BoardAssort
		GBL_BoardName=GBL_GetData(2,0)
		GBL_BoardIntro=GBL_GetData(3,0)

		GBL_LastWriter=GBL_GetData(4,0)
		GBL_LastWriteTime=GBL_GetData(5,0)
		GBL_TopicNum=cCur(GBL_GetData(6,0))
		GBL_AnnounceNum=cCur(GBL_GetData(7,0))
		GBL_ForumPass = GBL_GetData(8,0)
		GBL_HiddenFlag = GBL_GetData(9,0)
		GBL_MasterList = GBL_GetData(12,0)
		GBL_BoardLimit = GBL_GetData(13,0)
		GBL_OrderID = cCur(GBL_GetData(18,0))
		GBL_OrderID_Old = GBL_OrderID
		GBL_BoardStyle = GBL_GetData(19,0)
		GBL_MasterList_Old = GBL_MasterList
		GBL_StartTime = Right("0000000" & GBL_GetData(20,0),6)
		GBL_EndTime = Right("0000000" & GBL_GetData(21,0),6)

		GBL_BoardHead = Trim(GBL_GetDAta(22,0))
		GBL_BoardBottom = Trim(GBL_GetDAta(23,0))
		GBL_BoardImgUrl = Trim(GBL_GetDAta(24,0))
		GBL_BoardImgWidth = GBL_GetDAta(25,0)
		GBL_BoardImgHeight = GBL_GetDAta(26,0)

		GBL_ParentBoard = cCur(GBL_GetDAta(27,0))
		GBL_ParentBoard_Old = cCur(GBL_ParentBoard)
		GBL_LowerBoard = GBL_GetData(28,0)
		GBL_OtherLimit = GBL_GetData(35,0)

		GBL_LimitHourStart = Mid(GBL_StartTime,1,2)
		GBL_LimitWeekStart = Mid(GBL_StartTime,3,2)
		GBL_LimitMonthStart = Mid(GBL_StartTime,5,2)

		GBL_LimitHourEnd = Mid(GBL_EndTime,1,2)
		GBL_LimitWeekEnd = Mid(GBL_EndTime,3,2)
		GBL_LimitMonthEnd = Mid(GBL_EndTime,5,2)
		
		GBL_OtherLimit_Part1 = Right(GBL_OtherLimit,2)
		If Len(GBL_OtherLimit) > 2 Then
			GBL_OtherLimit_Part2 = Left(GBL_OtherLimit,Len(GBL_OtherLimit)-2)
		Else
			GBL_OtherLimit_Part2 = 0
		End If

		GBL_CHK_TempStr = ""
		'If GBL_ForumPass <> "" Then
		'	Response.Write "<font color=ff0000 class=RedFont><b>此版面已经禁止修改．</b></font><br>" & VbCrLf
		'Else
			If Request.Form("submitflag")="LKOkxk2" Then
				GBL_BoardID = Left(Trim(Request.Form("GBL_BoardID")),14)
				GBL_BoardAssort = Left(Trim(Request.Form("GBL_BoardAssort")),14)
				GBL_BoardName = Trim(Request.Form("GBL_BoardName"))
				GBL_BoardIntro = Trim(Request.Form("GBL_BoardIntro"))
				GBL_LastWriter = Trim(Request.Form("GBL_LastWriter"))
				GBL_LastWriteTime = Trim(Request.Form("GBL_LastWriteTime"))
				GBL_TopicNum = Left(Trim(Request.Form("GBL_TopicNum")),14)
				GBL_AnnounceNum = Trim(Request.Form("GBL_AnnounceNum"))
				GBL_ForumPass = Trim(Request.Form("GBL_ForumPass"))
				GBL_HiddenFlag = Trim(Request.Form("GBL_HiddenFlag"))
				GBL_MasterList = Trim(Request.Form("GBL_MasterList"))
				GBL_OrderID = Left(Trim(Request.Form("GBL_OrderID")),14)
				GBL_BoardStyle = Left(Trim(Request.Form("GBL_BoardStyle")),14)
		
				GBL_LimitWeekStart = Left(Trim(Request.Form("GBL_LimitWeekStart")),14)
				GBL_LimitWeekEnd = Left(Trim(Request.Form("GBL_LimitWeekEnd")),14)
				GBL_LimitMonthEnd = Left(Trim(Request.Form("GBL_LimitMonthEnd")),14)
				GBL_LimitMonthStart = Left(Trim(Request.Form("GBL_LimitMonthStart")),14)
				GBL_LimithourStart = Left(Trim(Request.Form("GBL_LimithourStart")),14)
				GBL_LimithourEnd = Left(Trim(Request.Form("GBL_LimithourEnd")),14)
				
				GBL_BoardImgUrl = Trim(Request.Form("GBL_BoardImgUrl"))
				GBL_BoardImgWidth = Left(Trim(Request.Form("GBL_BoardImgWidth")),14)
				GBL_BoardImgHeight = Left(Trim(Request.Form("GBL_BoardImgHeight")),14)
				
				GBL_ParentBoard = Left(Trim(Request.Form("BoardID2")),14)
				
				GBL_BoardHead = Left(Request.Form("GBL_BoardHead"),8*1024)
				GBL_BoardBottom = Left(Request.Form("GBL_BoardBottom"),8*1024)
				GBL_OtherLimit_Part1 = Left(Request.Form("GBL_OtherLimit_Part1"),14)
				GBL_OtherLimit_Part2 = Left(Request.Form("GBL_OtherLimit_Part2"),14)
		
				If CheckFormForumBoardData = 0 Then
					Response.Write "<font color=ff0000 class=RedFont><b>数据不能通过：" & GBL_CHK_TempStr & "</b></font><br>" & VbCrLf
					DisplayJoinForm
				Else
					If UpdateForumBoard = 0 Then
						Response.Write "<font color=ff0000 class=RedFont><b>修改出错：" & GBL_CHK_TempStr & "</b></font><br>" & VbCrLf
						DisplayJoinForm
					Else
						Response.Write "<font color=008800 class=GreenFont><b>修改成功!</b></font><br>" & VbCrLf
					End If
				End If
			Else
				DisplayJoinForm
			End If
		'End If
	Else
		Response.Write "<font color=ff0000 class=RedFont><b>错误，未选择要修改的版面。</b></font><br>" & VbCrLf
	End If%>
					</td>
				</tr>
				</table>
			</td>
		</tr>
		</table>
	</td>
</tr>
</table>
<%

End Function

Function DisplayForumAssortList

	Dim Rs,GetData,N,TempAssort
	If isNumeric(GBL_BoardAssort)=0 Then
		TempAssort = 0
	Else
		TempAssort = cCur(GBL_BoardAssort)
	End If
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	Rs.Open "Select top 1000 * from LeadBBS_Assort order by AssortID",con,1,1
	GBL_DBNum = GBL_DBNum + 1
	If Rs.Eof Then
		Rs.Close
		Set Rs = Nothing
		Exit Function
	Else
		GetData = Rs.GetRows(-1)
		Rs.Close
		Set Rs = Nothing
	End If
	For N = 0 to Ubound(GetData,2)
		GetData(1,n) = KillHTMLLabel(GetData(1,n))
		If StrLength(GetData(1,n)) > 31 Then
			GetData(1,n) = LeftTrue(GetData(1,n),28) & "..."
		End If
		If cCur(GetData(0,N))=TempAssort Then
			Response.Write "<option value=" & GetData(0,N) & " selected>" & GetData(1,n) & "</option>" & VbCrLf
		Else
			Response.Write "<option value=" & GetData(0,N) & ">" & GetData(1,n) & "</option>" & VbCrLf
		End If
	Next

End Function

Function DisplayJoinForm%>

	<form action=ForumBoardModify.asp name=form1 id=form1 method=post>
	<table>
	<tr>
		<td>论坛版面编号:</td>
		<td><input name=GBL_BoardID value="<%=htmlencode(GBL_BoardID)%>" readonly class=fminpt>
		<input name=submitflag type=hidden value="LKOkxk2"></td>
	</tr>
	<tr>
		<td>版面排列顺序:</td><td><input name=GBL_OrderID value="<%=htmlencode(GBL_OrderID)%>" class=fminpt> <font color=888888 class=GrayFont>越小越前面</font></td>
	</tr>
	<tr>
		<td>版面分类编号:</td><td><select name=GBL_BoardAssort style="width:130;"><option value=0>请选择分类</option><%DisplayForumAssortList%></select></td>
	</tr>
	<tr>
		<td>上级版面编号:</td><td><!-- #include file=../../inc/incHTM/BoardForMoveList.asp -->
		<br>更改了此项，一定要记得<font color=red class=RedFont>重做论坛列表及修复</font>，否则帖子统计会有出入
		<script>
			var provincebox = document.form1.BoardID2.options,i;
			for(i = 0; i < provincebox.length; i++)
			{
				if(provincebox.options[i].value=="<%=GBL_ParentBoard%>")
				{provincebox.selectedIndex = i;break;}
			}
		</script></td>
	</tr>
	<tr>
		<td>
		<input name=GBL_ModifyID type=hidden value="<%=htmlencode(GBL_ModifyID)%>" class=fminpt>
		论坛版面名称:</td><td><input name=GBL_BoardName value="<%=htmlencode(GBL_BoardName)%>" class=fminpt></td>
	</tr>
	<tr>
		<td>版面简单描述:<br>可以使用HTML</td><td><textarea name=GBL_BoardIntro rows=3 cols=41 class=fmtxtra><%If GBL_BoardIntro <> "" Then Response.Write VbCrLf & Server.htmlEncode(GBL_BoardIntro)%></textarea></td>
	</tr>
	<tr>
		<td>最后发表用户:</td><td><input name=GBL_LastWriter value="<%=htmlencode(GBL_LastWriter)%>" class=fminpt></td>
	</tr>
	<tr>
		<td>最后发表时间:</td><td><input name=GBL_LastWriteTime value="<%=htmlencode(GBL_LastWriteTime)%>" class=fminpt></td>
	</tr>
	<tr>
		<td>论坛总主题数:</td><td><input name=GBL_TopicNum value="<%=htmlencode(GBL_TopicNum)%>" class=fminpt></td>
	</tr>
	<tr>
		<td>论坛总帖子数:</td><td><input name=GBL_AnnounceNum value="<%=htmlencode(GBL_AnnounceNum)%>" class=fminpt></td>
	</tr>
	<tr>
		<td>论坛显示状态:</td><td>
			<select name="GBL_HiddenFlag">
			<%
			Dim TempN
			If GBL_HiddenFlag = "" or inStr(GBL_HiddenFlag,",") > 0 or isNumeric(GBL_HiddenFlag) = 0 Then GBL_HiddenFlag=0
			GBL_HiddenFlag = Clng(GBL_HiddenFlag)
	        For TempN = 0 to GBL_HiddenFlagNum
	        	%><option value="<%=TempN%>"<%If GBL_HiddenFlag = TempN Then Response.Write " Selected"%>><%=GBL_HiddenFlagData(TempN)%></option>
	        <%Next%>
			</select></td>
	</tr>
	<tr>
		<td>版面默认风格:</td><td>
			<select name="GBL_BoardStyle">
			<%
			If GBL_BoardStyle = "" or inStr(GBL_BoardStyle,",") > 0 or isNumeric(GBL_BoardStyle) = 0 Then GBL_BoardStyle=0
			GBL_BoardStyle = Clng(GBL_BoardStyle)
	        For TempN = 0 to DEF_BoardStyleStringNum
	        	%><option value="<%=TempN%>"<%If GBL_BoardStyle = TempN Then Response.Write " Selected"%>><%=DEF_BoardStyleString(TempN)%></option>
	        <%Next%>
			</select></td>
	</tr>
	<tr>
		<td>论坛访问密码:</td><td><input name=GBL_ForumPass value="<%=htmlencode(GBL_ForumPass)%>" maxlength=20 class=fminpt></td>
	</tr>
	<tr>
		<td>论坛图片地址:</td><td><input name=GBL_BoardImgUrl value="<%=htmlencode(GBL_BoardImgUrl)%>" maxlength=255 size=40 class=fminpt>(请使用绝对路径)</td>
	</tr>
	<tr>
		<td>论坛图片大小:</td><td>宽度<input name=GBL_BoardImgWidth value="<%=htmlencode(GBL_BoardImgWidth)%>" maxlength=3 size=3 class=fminpt> 高度<input name=GBL_BoardImgHeight value="<%=htmlencode(GBL_BoardImgHeight)%>" maxlength=3 size=3 class=fminpt> 注意大小在0-200之间</td>
	</tr>
	<tr>
		<td>论坛版主列表:</td><td><input name=GBL_MasterList value="<%=htmlencode(GBL_MasterList)%>" maxlength=250 size=28 class=fminpt>(逗号分隔,全体版主填写<span style="cursor:hand" onclick="document.form1.GBL_MasterList.value='?LeadBBS?';">?LeadBBS?</span>)</td>
	</tr>
	<tr>
		<td width=80>论坛权限限制:</td>
		<td valign=top><%
			for TempN = 0 to LimitBoardStringDataNum%>	 
			<input type="checkbox" class=fmchkbox name="Limit<%=TempN+1%>" value="1"<%If GetBinarybit(GBL_BoardLimit,TempN+1) = 1 Then
				Response.Write " checked>"
			Else
				Response.Write ">"
			End If%><%=LimitBoardStringData(tempN)%><br>
			<%Next%></td>
	</tr>
	<tr>
		<td width=80>更多访问限制:</td>
		<TD valign=top>
			<Select name=GBL_OtherLimit_Part1>
				<option value=0<%If GBL_OtherLimit_Part1 = 0 Then Response.Write " selected"%>>====无限制====</option>
				<option value=1<%If GBL_OtherLimit_Part1 = 1 Then Response.Write " selected"%>>需要积分</option>
				<option value=2<%If GBL_OtherLimit_Part1 = 2 Then Response.Write " selected"%>>需要经验[在线时间]</option>
				<option value=3<%If GBL_OtherLimit_Part1 = 3 Then Response.Write " selected"%>>需要魅力</option>
				<option value=4<%If GBL_OtherLimit_Part1 = 4 Then Response.Write " selected"%>>需要威望</option>
			</select>
			<input name=GBL_OtherLimit_Part2 value="<%=htmlencode(GBL_OtherLimit_Part2)%>" maxlength=12 size=12 class=fminpt>
		</td>
	</tr>
	<tr>
		<td>论坛限时设定:<br>
		0表示不限</td><td>小时关闭：<input name=GBL_LimitHourStart value="<%=htmlencode(GBL_LimitHourStart)%>" maxlength=2 size=2 class=fminpt>时-<input name=GBL_LimitHourEnd value="<%=htmlencode(GBL_LimitHourEnd)%>" maxlength=2 size=2 class=fminpt>时 (0-23)
		<br>
		星期关闭：星期<input name=GBL_LimitWeekStart value="<%=htmlencode(GBL_LimitWeekStart)%>" maxlength=2 size=2 class=fminpt>-星期<input name=GBL_LimitWeekEnd value="<%=htmlencode(GBL_LimitWeekEnd)%>" maxlength=2 size=2 class=fminpt> (1-7)
		<br>
		月份关闭：第<input name=GBL_LimitMonthStart value="<%=htmlencode(GBL_LimitMonthStart)%>" maxlength=2 size=2 class=fminpt>天-第<input name=GBL_LimitMonthEnd value="<%=htmlencode(GBL_LimitMonthEnd)%>" maxlength=2 size=2 class=fminpt>天 (1-31)</td>
	</tr>	
	<tr>
		<td>版面风格头部:<br>使用HTML语法<br>定义后版面将<br>不允许用户自<br>定义成其它风<br>格</td><td><textarea name=GBL_BoardHead rows=6 cols=51 class=fmtxtra><%If GBL_BoardHead <> "" Then Response.Write VbCrLf & Server.htmlEncode(GBL_BoardHead)%></textarea></td>
	</tr>
	<tr>
		<td>版面风格尾部:<br>使用HTML语法<br>最多允许８Ｋ<br>超过截断</td><td><textarea name=GBL_BoardBottom rows=6 cols=51 class=fmtxtra><%If GBL_BoardBottom <> "" Then Response.Write VbCrLf & Server.htmlEncode(GBL_BoardBottom)%></textarea></td>
	</tr>
	<tr>
		<td colspan=2><input type=submit value="提交" class=fmbtn> <input type=reset value="取消" class=fmbtn></td>
	</tr>
	</table></form>

<%End Function%>