📄 admin_board.asp
字号:
| <a href="admin_board.asp?action=mode&boardid=<%=Request("editid")%>"><font color="<%=Dvbbs.mainsetting(3)%>"><U>认证用户</U></font></a>
<%end if%>
| <a href="admin_update.asp?action=updat&submit=更新论坛数据&boardid=<%=Request("editid")%>" title="更新最后回复、帖子数、回复数"><font color="<%=Dvbbs.mainsetting(3)%>"><U>更新数据</U></font></a> | <a href="admin_update.asp?action=delboard&boardid=<%=Request("editid")%>" onclick="{if(confirm('清空将包括该论坛所有帖子置于回收站,确定清空吗?')){return true;}return false;}"><font color="<%=Dvbbs.mainsetting(3)%>"><U>清空</U></font></a> | <%if rs("child")=0 then%><a href="admin_board.asp?action=del&editid=<%=Request("editid")%>" onclick="{if(confirm('删除将包括该论坛的所有帖子,确定删除吗?')){return true;}return false;}"><font color="<%=Dvbbs.mainsetting(3)%>"><U>删除</U></a><%else%><a href="#" onclick="{if(confirm('该论坛含有下属论坛,必须先删除其下属论坛方能删除本论坛!')){return true;}return false;}"><font color="<%=Dvbbs.mainsetting(3)%>"><U>删除</U></a><%end if%>
| <a href="admin_Board.asp?action=clearDate&boardid=<%=Request("editid")%>"> <font color="<%=Dvbbs.mainsetting(3)%>"><u>清理数据</u></a>
</td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
set rs_c=nothing
end sub
sub mode()
dim boarduser
%>
<form action ="admin_board.asp?action=savemod" method=post>
<table width="95%" class="tableBorder" cellspacing="1" cellpadding="1" align="center">
<tr>
<th width="52%" height=22>说明:</th>
<th width="48%">操作:</th>
</tr>
<tr>
<td width="52%" height=22 class=forumrow><B>论坛名称</B></td>
<td width="48%" class=forumrow>
<%
set rs= server.CreateObject ("adodb.recordset")
sql="select boardid,boardtype,boarduser from dv_board where boardid="&request("boardid")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "该版面并不存在或者该版面不是加密版面。"
Else
response.write rs(1)
response.write "<input type=hidden value="&rs(0)&" name=boardid>"
boarduser=rs(2)
end if
rs.close
set rs=nothing
%>
</td>
</tr>
<tr>
<td width="52%" class=forumrow><B>认证用户</B>:<br>
只有设定为认证论坛的论坛需要填写能够进入该版面的用户,每输入一个用户请确认用户名在论坛中存在,每个用户名用<B>回车</B>分开</font>
</td>
<td width="48%" class=forumrow>
<textarea cols=35 rows=6 name="vipuser">
<%if not isnull(boarduser) or boarduser<>"" then
response.write Replace(boarduser,",",Chr(10))
end if%></textarea>
</td>
</tr>
<tr>
<td width="52%" height=22 class=forumrow> </td>
<td width="48%" class=forumrow>
<input type="submit" name="Submit" value="设 定">
</td>
</tr>
</table>
</form>
<%
End Sub
'保存编辑论坛认证用户信息
'入口:用户列表字符串
sub savemod()
dim boarduser
dim boarduser_1
dim userlen
dim updateinfo
If trim(request("vipuser"))<>"" then
boarduser=request("vipuser")
boarduser=split(boarduser,chr(13)&chr(10))
for i = 0 to ubound(boarduser)
if not (boarduser(i)="" or boarduser(i)=" ") then
boarduser_1=""&boarduser_1&""&boarduser(i)&","
end if
next
userlen=len(boarduser_1)
if boarduser_1<>"" then
boarduser=left(boarduser_1,userlen-1)
updateinfo=" boarduser='"&boarduser&"' "
Dvbbs.Execute("update dv_board set "&updateinfo&" where boardid="&request("boardid"))
Dv_suc("论坛设置成功!<LI>成功添加认证用户:"&boarduser&"<LI><a href=""?action=RestoreBoardCache"" >请执行重建版面缓存才能生效</a><br>")
else
response.write "<p><font color=red>你没有添加认证用户</font><br><br>"
Exit Sub
end if
Else
response.write "<p><font color=red>你没有添加认证用户</font><br><br>"
End If
End Sub
'保存添加论坛信息
sub savenew()
if request("boardtype")="" then
Errmsg=Errmsg+"<br>"+"<li>请输入论坛名称。"
founderr=true
end if
if request("class")="" then
Errmsg=Errmsg+"<br>"+"<li>请选择论坛分类。"
founderr=true
end if
if request("readme")="" then
Errmsg=Errmsg+"<br>"+"<li>请输入论坛说明。"
founderr=true
end if
if founderr=true then
dvbbs_error()
exit sub
end if
dim boardid
dim rootid
dim parentid
dim depth
dim orders
dim Fboardmaster
dim maxrootid
dim parentstr
if request("class")<>"0" then
set rs=Dvbbs.Execute("select rootid,boardid,depth,orders,boardmaster,ParentStr from dv_board where boardid="&request("class"))
rootid=rs(0)
parentid=rs(1)
depth=rs(2)
orders=rs(3)
if depth+1>20 then
Errmsg="本论坛限制最多只能有20级分类"
dvbbs_error()
exit sub
end if
parentstr=rs(5)
else
set rs=Dvbbs.Execute("select max(rootid) from dv_board")
maxrootid=rs(0)+1
if isnull(MaxRootID) then MaxRootID=1
end if
sql="select boardid from dv_board where boardid="&request("newboardid")
set rs=Dvbbs.Execute(sql)
if not (rs.eof and rs.bof) then
Errmsg="您不能指定和别的论坛一样的序号。"
dvbbs_error()
exit sub
else
boardid=request("newboardid")
end if
dim trs,forumuser,setting
set trs=Dvbbs.Execute("select * from dv_setup")
Setting=Split(trs("Forum_Setting"),"|||")
forumuser=Setting(2)
set rs = server.CreateObject ("adodb.recordset")
sql = "select * from dv_board"
rs.Open sql,conn,1,3
rs.AddNew
if request("class")<>"0" then
rs("depth")=depth+1
rs("rootid")=rootid
rs("orders") = Request.form("newboardid")
rs("parentid") = Request.Form("class")
if ParentStr="0" then
rs("ParentStr")=Request.Form("class")
else
rs("ParentStr")=ParentStr & "," & Request.Form("class")
end if
else
rs("depth")=0
rs("rootid")=maxrootid
rs("orders")=0
rs("parentid")=0
rs("parentstr")=0
end if
rs("boardid") = Request.form("newboardid")
rs("boardtype") = request.form("boardtype")
rs("readme") =fixjs(Request.form("readme"))
rs("TopicNum") = 0
rs("PostNum") = 0
rs("todaynum") = 0
rs("child")=0
rs("LastPost")="$0$"&Now()&"$$$$$"
rs("Board_Setting")="0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,16240,3,0,gif|jpg|jpeg|bmp|png|rar|txt|zip|mid,0,0,1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1|1,0,0,100,30,10,9,12,1,10,10,0,0,0,0,1,4,0,1,4,0,0,0,200,0,0,0,0,0,0,0,1,0|0|0|0|0|0|0|0|0,0|0|0|0|0|0|0|0|0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
rs("sid")=request.form("sid")
rs("cid")=request.form("cid")
rs("board_ads")=trs("forum_ads")
rs("board_user")=forumuser
if Request("boardmaster")<>"" then
rs("boardmaster") = Request.form("boardmaster")
end if
if request.form("indexIMG")<>"" then
rs("indexIMG")=fixjs(request.form("indexIMG"))
end if
rs.Update
rs.Close
if Request("boardmaster")<>"" then call addmaster(Request("boardmaster"),"none",0)
if request("class")<>"0" then
if depth>0 then
'当上级分类深度大于0的时候要更新其父类(或父类的父类)的版面数和相关排序
for i=1 to depth
'更新其父类版面数
if parentid<>"" then
Dvbbs.Execute("update dv_board set child=child+1 where boardid="&parentid)
end if
'得到其父类的父类的版面ID
set rs=Dvbbs.Execute("select parentid from dv_board where boardid="&parentid)
if not (rs.eof and rs.bof) then
parentid=rs(0)
end if
'当循环次数大于1并且运行到最后一次循环的时候直接进行更新
if i=depth and parentid<>"" then
Dvbbs.Execute("update dv_board set child=child+1 where boardid="&parentid)
end if
next
'更新该版面排序以及大于本需要和同在本分类下的版面排序序号
Dvbbs.Execute("update dv_board set orders=orders+1 where rootid="&rootid&" and orders>"&orders)
Dvbbs.Execute("update dv_board set orders="&orders&"+1 where boardid="&Request.form("newboardid"))
else
'当上级分类深度为0的时候只要更新上级分类版面数和该版面排序序号即可
Dvbbs.Execute("update dv_board set child=child+1 where boardid="&request("class"))
set rs=Dvbbs.Execute("select max(orders) from dv_board where boardid="&Request.form("newboardid"))
Dvbbs.Execute("update dv_board set orders="&rs(0)&"+1 where boardid="&Request.form("newboardid"))
end if
end if
dv_suc("论坛添加成功!<br>该论坛目前高级设置为默认选项,建议您返回论坛管理中心重新设置该论坛的高级选项,<A HREF=admin_BoardSetting.asp?editid="&Request.form("newboardid")&">点击此处进入该版面高级设置</A><br>" & str)
set rs=nothing
trs.close
set trs=nothing
Dvbbs.ReloadAllBoardInfo()
Dvbbs.Name="setup"
Dvbbs.ReloadSetup
Dvbbs.CacheData=Dvbbs.value
Set tRs=Dvbbs.Execute("Select RootID From Dv_Board Where BoardID="&Request.form("newboardid"))
Dim UpdateRootID
UpdateRootID = tRs(0)
Set tRs=dvbbs.Execute("Select BoardID From Dv_Board Where RootID="&UpdateRootID&" Order By Orders")
Do While Not tRs.Eof
Dvbbs.ReloadBoardInfo(tRs(0))
tRs.Movenext
Loop
Set tRs=Nothing
Dvbbs.DelCahe "BoardJumpList"
Dvbbs.DelCahe "MyAllBoardList"
end sub
'保存编辑论坛信息
sub savedit()
if clng(request("editid"))=clng(request("class")) then
Errmsg="所属论坛不能指定自己"
dvbbs_error()
exit sub
end if
dim newboardid,maxrootid
dim parentid,boardmaster,depth,child,ParentStr,rootid,iparentid,iParentStr
dim trs,brs,mrs
set rs = server.CreateObject ("adodb.recordset")
sql = "select * from dv_board where boardid="&request("editid")
rs.Open sql,conn,1,3
newboardid=rs("boardid")
parentid=rs("parentid")
iparentid=rs("parentid")
boardmaster=rs("boardmaster")
ParentStr=rs("ParentStr")
depth=rs("depth")
child=rs("child")
rootid=rs("rootid")
'判断所指定的论坛是否其下属论坛
if ParentID=0 then
if clng(request("class"))<>0 then
set trs=Dvbbs.Execute("select rootid from dv_board where boardid="&request("class"))
if rootid=trs(0) then
errmsg="您不能指定该版面的下属论坛作为所属论坛1"
dvbbs_error()
exit sub
end if
end if
else
set trs=Dvbbs.Execute("select boardid from dv_board where ParentStr like '%"&ParentStr&","&newboardid&"%' and boardid="&request("class"))
if not (trs.eof and trs.bof) then
errmsg="您不能指定该版面的下属论坛作为所属论坛2"
dvbbs_error()
exit sub
end if
end if
if parentid=0 then
parentid=rs("boardid")
iparentid=0
end if
rs("boardtype") = Request.Form("boardtype") '取消JS过滤。
'rs("parentid") = Request.Form("class")
rs("boardmaster") = Request("boardmaster")
rs("readme") = fixjs(Request("readme"))
rs("indexIMG")=Simencodejs(request.form("indexIMG"))
rs("sid")=Cint(request.form("sid"))
rs("cid")=Cint(request.form("cid"))
rs.Update
rs.Close
set rs=nothing
if request("oldboardmaster")<>Request("boardmaster") then call addmaster(Request("boardmaster"),request("oldboardmaster"),1)
set mrs=Dvbbs.Execute("select max(rootid) from dv_board")
Maxrootid=mrs(0)+1
'假如更改了所属论坛
'需要更新其原来所属版面信息,包括深度、父级ID、版面数、排序、继承版主等数据
'需要更新当前所属版面信息
'继承版主数据需要另写函数进行更新--取消,在前台可用boardid in parentstr来获得
dim k,nParentStr,mParentStr
dim ParentSql,boardcount
if clng(parentid)<>clng(request("class")) and not (iparentid=0 and cint(request("class"))=0) then
'如果原来不是一级分类改成一级分类
if iparentid>0 and cint(request("class"))=0 then
'更新当前版面数据
Dvbbs.Execute("update dv_board set depth=0,orders=0,rootid="&maxrootid&",parentid=0,parentstr='0' where boardid="&newboardid)
ParentStr=ParentStr & ","
set rs=Dvbbs.Execute("select count(*) from dv_board where ParentStr like '%"&ParentStr&"%'")
boardcount=rs(0)
if isnull(boardcount) then
boardcount=1
else
boardcount=boardcount+1
end if
'更新其原来所属论坛版面数
Dvbbs.Execute("update dv_board set child=child-"&boardcount&" where boardid="&iparentid)
'更新其原来所属论坛数据,排序相当于剪枝而不需考虑
for i=1 to depth
'得到其父类的父类的版面ID
set rs=Dvbbs.Execute("select parentid from dv_board where boardid="&iparentid)
if not (rs.eof and rs.bof) then
iparentid=rs(0)
Dvbbs.Execute("update dv_board set child=child-"&boardcount&" where boardid="&iparentid)
end if
next
if child>0 then
'更新其下属论坛数据
'有下属论坛,排序不需考虑,更新下属论坛深度和一级排序ID(rootid)数据
'更新当前版面数据
'ParentStr=ParentStr & ","
i=0
set rs=Dvbbs.Execute("select * from dv_board where ParentStr like '%"&ParentStr&"%'")
do while not rs.eof
i=i+1
mParentStr=replace(rs("ParentStr"),ParentStr,"")
Dvbbs.Execute("update dv_board set depth=depth-"&depth&",rootid="&maxrootid&",ParentStr='"&mParentStr&"' where boardid="&rs("boardid"))
rs.movenext
loop
end if
elseif iparentid>0 and cint(request("class"))>0 then
'将一个分论坛移动到其他分论坛下
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -