⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 board.asp

📁 公司企业网站管理系统全站源码,用于企业内部对网站的管理
💻 ASP
📖 第 1 页 / 共 5 页
字号:
		GroupSetting=GetGroupPermission
		If Not IsNumeric(Replace(Request.Form("GroupID"),",","")) or Request.Form("GroupID")="" Then
			Errmsg = ErrMsg + "<BR><li>请选择对应的用户组。"
			Dvbbs_Error()
			Exit Sub
		End If
		SaveGroupid = Request.Form("groupid")
		Set rs= Server.CreateObject("ADODB.Recordset")
		if Request("isdefault")=1 then
			'清理ID
			Dvbbs.Execute("Delete from dv_BoardPermission where BoardID="&request.Form("reBoardID")&" and GroupID in ("&SaveGroupid&")")
		Else
			'使用自定义
			sql="Select Pid,GroupID,PSetting from dv_BoardPermission where BoardID="&request("reBoardID")&" And GroupID in ("&SaveGroupid&") "
			NewGroupid = ","&SaveGroupid&","
			Set Rs=Dvbbs.Execute(sql)
			If Not Rs.eof And Not Rs.bof Then
				If Instr(SaveGroupid,",")=0 Then
					sql="update dv_BoardPermission set PSetting='"&GroupSetting&"' where pid="&Rs(0)
					Dvbbs.Execute(Sql)
					NewGroupid = ""
				Else
					Do while Not Rs.Eof
						NewStr = Split(GroupSetting,",")
						OldStr = Split(Rs(2),",")
						UpdateStr = ""
						For K = 0 To 90
							If Request.Form("CheckGroupSetting("&K&")")="on" Then
								UpdateStr = UpdateStr & NewStr(k)
							Else
								UpdateStr = UpdateStr & OldStr(k)
							End If
							If K<90 Then
								UpdateStr = UpdateStr & ","
							End If
						Next
						sql="update dv_BoardPermission set PSetting='"&UpdateStr&"' where pid="&Rs(0)
						Dvbbs.Execute(Sql)
						NewGroupid = Replace(NewGroupid,","&Rs(1)&",",",")
					Rs.MoveNext
					Loop
				End If
			Else
				Dim iSaveGroupID
				iSaveGroupID = Split(SaveGroupid,",")
				For i = 0 To Ubound(iSaveGroupID)
					sql="insert into dv_BoardPermission (BoardID,GroupID,PSetting) values ("&request("reBoardID")&","&iSaveGroupID(i)&",'"&GroupSetting&"')"
					Dvbbs.Execute(Sql)
				Next
				NewGroupid = ""
			End If
			Set Rs=Nothing


			If Replace(NewGroupid,",","")<>"" Then
				'有新组添加
				NewGroupid = Split(NewGroupid,",")
				For i=1 to Ubound(NewGroupid)-1
					Sql = Dvbbs.Execute("select GroupSetting From Dv_UserGroups where UserGroupID="&NewGroupid(i))(0)
					If Sql<>"" Then
						NewStr = Split(GroupSetting,",")
						OldStr = Split(Sql,",")
						UpdateStr = ""
						For K = 0 To 90
							If Request.Form("CheckGroupSetting("&K&")")="on" Then
								UpdateStr = UpdateStr & NewStr(k)
							Else
								UpdateStr = UpdateStr & OldStr(k)
							End If
							If K<90 Then
								UpdateStr = UpdateStr & ","
							End If
						Next
						sql="insert into dv_BoardPermission (BoardID,GroupID,PSetting) values ("&request("reBoardID")&","&NewGroupid(i)&",'"&UpdateStr&"')"
						Dvbbs.Execute(Sql)
					End If
				Next
			End If
		End If

		'重新提取有自定义的ID
		Dim IsGroupSetting1
		IsGroupSetting=Get_board_AccUserList(CLng(request("reBoardID")))
		IsGroupSetting1=Get_Board_GroupSetting(CLng(request("reBoardID")))
		If IsGroupSetting="" Then
			IsGroupSetting=IsGroupSetting1
		ElseIf IsGroupSetting1<>"" Then
			IsGroupSetting=IsGroupSetting&","& IsGroupSetting1
		End If
		Dvbbs.Execute("update dv_Board set IsGroupSetting='"&IsGroupSetting&"' Where BoardID="&CLng(request("reBoardID")))
		RestoreBoardCache()
		Set Rs=Nothing
		Dv_suc("修改成功!")
Else
	Dim reGroupSetting,reBoardID,groupid
	Dim Groupname,Boardname,founduserper,rs
	founduserper=false
	if request("GroupID")<>"" then
	set rs=Dvbbs.Execute("select * from dv_BoardPermission where boardid="&request("reBoardID")&" and GroupID="&request("GroupID"))
	if rs.eof and rs.bof then
		founduserper=false
	else
	groupid=rs("groupid")
	reGroupSetting=rs("PSetting")
	reBoardID=rs("boardid")
	set rs=Dvbbs.Execute("select usertitle from dv_UserGroups where usergroupid="&groupid)
	groupname=rs("usertitle")
	founduserper=true
	end if
	if not founduserper then
	set rs=Dvbbs.Execute("select * from dv_usergroups where usergroupid="&request("groupid"))
	if rs.eof and rs.bof then
	response.write "未找到该用户组!"
	exit sub
	end if
	groupid=request("groupid")
	reGroupSetting=rs("GroupSetting")
	reBoardID=request("reBoardID")
	Groupname=rs("usertitle")
	end if
	end if
	set rs=Dvbbs.Execute("select boardtype from dv_board where boardid="&reBoardID)
	Boardname=rs("boardtype")
%>
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
<FORM METHOD=POST ACTION="?action=editpermission">
<input type=hidden name="groupid" value="<%=groupid%>">
<input type=hidden name="reBoardID" value="<%=reBoardID%>">
<input type=hidden name="pID" value="<%=request("pid")%>">
<tr> 
<th colspan="4" style="text-align:center;">编辑论坛用户组权限&nbsp;>> <%=boardname%>&nbsp;>> <%=groupname%></th>
</tr>
<tr> 
<td height="23" colspan="4" class=td1><input type=radio class="radio" name="isdefault" value="1" <%if not founduserper then%>checked<%end if%>><B>使用用户组默认值</B> (注意: 这将删除任何之前所做的自定义设置)</td>
</tr>
<tr> 
<td height="23" colspan="4" class=td1><input type=radio class="radio" name="isdefault" value="0" <%if founduserper then%>checked<%end if%>><B>使用自定义设置</B>&nbsp;(选择自定义才能使以下设置生效) </td>
</tr>
<tr> 
<td height="23" colspan="4" class=td1>
①<font color="red">在更新多个用户组设置时,请选取最左边的复选表单,只有选取的设置项目才会更新;</font>
<BR>②不执行多用户组更新时,不需要选取左边的复选表单;
<br><b>批量更新用户组设置</b>:<input type="button" value="选择用户组" class="button" onclick="getGroup('Select_Group');">
 <INPUT TYPE="checkbox" NAME="chkall" onclick="CheckAll(this.form);" class="checkbox">[全选]
</td>
</tr>
<%
GroupPermission(reGroupSetting)
%>
<input type=hidden value="yes" name="groupaction">
</FORM>
</table>
<%
Call Select_Group(Request("groupid"))
end if
end sub

sub RestoreBoard()
	'按照目前的排序循环i数值更新rootid
	'还原所有版面的depth,orders,parentid,parentstr,child为0
	Dim i,rs
	i=0
	set rs=Dvbbs.Execute("select boardid from dv_board order by rootid,orders")
	do while not rs.eof
	i=i+1
	Dvbbs.Execute("update dv_board set rootid="&i&",depth=0,orders=0,ParentID=0,ParentStr='0',child=0 where boardid="&rs(0))
	rs.movenext
	loop
	Set Rs=Nothing
	Dv_suc("请返回做论坛归属设置。复位")
	RestoreBoardCache()
End sub

Sub clearDate
	If Dvbbs.Boardid=0 Then
		errmsg=errmsg+"<br><li>请选择论坛版面"
		dvbbs_error()
		Exit Sub
	End If
	Dim Rs,str1,str2,str3,str4,i
	Set Rs=Dvbbs.Execute("Select Count(*) from dv_topic where Boardid="& Dvbbs.boardid &"")
	str1=Rs(0)
	str3=0
	str4=0
	For i= 0 to UBound(AllPostTable)
		Set Rs=Dvbbs.Execute("Select Count(*) from "&AllPostTable(i)&" where Boardid="& Dvbbs.boardid &"")
		str2=str2&"其中在"&AllPostTable(i)&"有"&Rs(0)&"篇文章,"
		str3=str3+Rs(0)
		Set Rs=Dvbbs.Execute("Select Count(*) from "&AllPostTable(i)&" where Boardid="& Dvbbs.boardid &" and isbest=1")
		str4=str4+Rs(0)
	Next
	Response.Write"<br>"
	Response.Write"<table cellpadding=0 cellspacing=0 align=center width=""100%"">"
	Response.Write"<tr align=center>"
	Response.Write"<th width=""100%"" colspan=2 style=""text-align:center;"">"
	Response.Write Dvbbs.BoardType
	Response.Write "-贴子信息"
	Response.Write"</td>"
	Response.Write"</tr>"
	Response.Write"<tr>"
	Response.Write"<td width=""100%"" class=""td2"" colspan=2>"
	Response.Write "<li>主题总数:<b>"
	Response.Write str1
	Response.Write "</b><li>文章总数:<b>"
	Response.Write str3
	Response.Write "</b><li>"
	Response.Write str2
	Response.Write "<li>有<B>"&str4&"</B>篇精华文章"
	Response.Write"</td></tr>"
	Response.Write "<form action =""?action=delDate&boardid="&Dvbbs.boardid&""" method=post>"
	Response.Write"<tr>"
	Response.Write"<td class=""td2"" valign=middle colspan=2 align=left><li>  清除<b>"
	Response.Write Dvbbs.BoardType
	Response.Write "</b>在 "
	Response.Write "<select name=""tablelist""><option value=""all"">所有数据表</option>"
	For i= 0 to UBound(AllPostTable)
		Response.Write "<option value="""&AllPostTable(i)&""">"
		Response.Write 	AllPostTableName(i)
		Response.Write "</option>"
	Next 
	Response.Write "</select>"
	Response.Write " 中 <input type=text name=dd value=365 size=5 > 天前的贴子"
	Response.Write " <input type=""submit"" name=""Submit"" value=""执 行"" class=""button""> <b>注意:此操作不可恢复!</b>其中精华贴不会被删除。<BR><BR>如果您的论坛数据众多,执行此操作将消耗大量的服务器资源,执行过程请耐心等候,最好选择夜间在线人少的时候更新。"
	Response.Write "</td></tr>"
	Response.Write "</form>"
	Response.Write"</table>"
End Sub
Sub delDate
	Dim i,rs,sql
	If Dvbbs.Boardid=0 Then
		errmsg=errmsg+"<br><li>请选择论坛版面"
		dvbbs_error()
		Exit Sub
	End If
	Dim tablelist
	If request.form("tablelist")<>"all" Then
		tablelist=Dvbbs.checkstr(request.form("tablelist"))
	Else
		For i= 0 to UBound(AllPostTable)
		If i=0 Then
			tablelist=AllPostTable(i)
		Else
			tablelist=tablelist&","&AllPostTable(i)
		End If
		Next
	End If
	tablelist=split(tablelist,",")
	Dim SqlTopic
	Dim k
	k=0
	For i= 0 to UBound(tablelist)
		'删除数据表记录
		If IsSqlDataBase=1 Then
			SqlTopic="Select TopicID,isvote,PollID from dv_Topic where Boardid="&Dvbbs.boardid&" and isbest=0 and PostTable='"&tablelist(i)&"' and Datediff(d,LastPostTime,"&SqlNowString&") > "& CLng(request.form("dd"))&" "
		Else
			SqlTopic="Select TopicID,isvote,PollID from dv_Topic where Boardid="&Dvbbs.boardid&" and isbest=0 and PostTable='"&tablelist(i)&"' and Datediff('d',LastPostTime,"&SqlNowString&") > "& CLng(request.form("dd"))&" "
		End If
		Set rs=Dvbbs.Execute(SqlTopic)
		Do While Not Rs.Eof
			Sql="Delete from "&tablelist(i)&" where Boardid="&Dvbbs.boardid&" and rootid="&RS(0)&""
			Dvbbs.Execute(Sql)
			If Rs(1)=1 And Not IsNull(Rs(2)) Then
				Sql="Delete from dv_vote where voteid="&RS(2)&""
				Dvbbs.Execute(Sql)
			End If 
			Dvbbs.Execute("Delete from Dv_Appraise where Boardid="&Dvbbs.boardid&" and Topicid="&RS(0)&"")
			Rs.movenext
			k=k+1
		Loop 
		'删除主题表记录
		If IsSqlDataBase=1 Then
		SqlTopic="Delete from dv_Topic where Boardid="&Dvbbs.boardid&" and isbest=0 and PostTable='"&tablelist(i)&"' and Datediff(d,LastPostTime,"&SqlNowString&") > "& CLng(request.form("dd"))&" "
		Else
		SqlTopic="Delete from dv_Topic where Boardid="&Dvbbs.boardid&" and isbest=0 and PostTable='"&tablelist(i)&"' and Datediff('d',LastPostTime,"&SqlNowString&") > "& CLng(request.form("dd"))&" "
		End If
		Dvbbs.Execute(SqlTopic) 
		Set rs=Nothing 	
	Next
	Response.Write "删除了"&k&"个主题。"
End Sub

Sub RestoreClass()
	Dim ClassID,RootID,RootIDNum,ParentID,Rs,i
	ClassID=Request("ClassID")
	If Not IsNumeric(ClassID) Or ClassID="" Then
		Response.Write "错误的版面参数!"
		Exit Sub
	Else
		ClassID=Clng(ClassID)
	End If
	Set Rs=Dvbbs.Execute("Select RootID,BoardID From Dv_Board Where BoardID="&ClassID)
	If Rs.Eof And Rs.Bof Then
		Response.Write "错误的版面参数!"
		Exit Sub
	Else
		RootID=Rs(0)
		ParentID=Rs(1)
	End If
	i=0
	Set Rs=Dvbbs.Execute("Select BoardID,ParentID From Dv_Board Where RootID="&RootID&" Order By ParentID,Orders,Depth")
	Do While Not Rs.Eof
		If Rs(1)=0 Then
			Dvbbs.Execute("UpDate Dv_Board Set Orders="&i&" Where BoardID="&Rs(0))
		Else
			Dvbbs.Execute("UpDate Dv_Board Set Orders="&i&",ParentID="&ParentID&",ParentStr='"&ParentID&"',Depth=1,child=0 Where BoardID="&Rs(0))
		End If
		i=i+1
	Rs.MoveNext
	Loop
	Set Rs=Dvbbs.Execute("Select Count(*) From Dv_Board Where RootID="&RootID)
	RootIDNum=Rs(0)
	If IsNull(RootIDNum) Or RootIDNum="" Then
		RootIDNum=0
	Else
		RootIDNum=RootIDNum-1
	End If
	Dvbbs.Execute("UpDate Dv_Board Set Child="&RootIDNum&" Where BoardID="&ClassID)
	dv_suc("复位分类成功!")
	RestoreBoardCache()
	Set Rs=Nothing
End Sub

Sub handorders()
%>
<table width="100%" border="0" cellspacing="1" cellpadding="3" align="center">
	<tr> 
	<th>论坛分类重新排序修改(请在相应论坛分类的排序表单内输入相应的排列序号)
	</th>
	</tr>
	<tr>
	<td class="td1">
	<B>注意</B>:<BR>
1、由于本论坛排序算法不是递归,所以请正确输入排序的序号,否则将引起论坛显示不正常,<font color=red>如果您未正确了解说明,请不要随意更改</font><BR>
2、一级分类排序序号为0,请正确输入,<font color=blue>所有输入框请输入数字</font><BR>
3、排序规则为数字最大的排在后面,<font color=blue>在这里不能用排序来指定某个版面的所属分类或版面</font>,如下为正确的排序输入方式:<BR>
<B>分类</B> 0<BR>
--二级版面A 1<BR>
--二级版面B 2<BR>
----三级版面A 3<BR>
----三级版面B 4<BR>
----三级版面C 5<BR>
--二级版面C 6<BR>
A.<font color=blue>要把三级版面C提到三级版面A上面</font>,则依次输入:分类(0)-二级A(1)-二级B(2)-三级A(<font color=red>4</font>)-三级B(<font color=red>5</font>)-三级C(<font color=red>3</font>)-二级C(6

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -