📄 admin_board.asp
字号:
'response.write "select boardid,orders from board where ParentID="&ParentID&" and orders<"&orders&" order by orders desc<br>"
if child>0 then
set rs=conn.execute("select count(*) from board where ParentStr like '%"&ParentStr&"%'")
oldorders=rs(0)
else
oldorders=0
end if
'和该论坛同级且排序在其之上的论坛-更新其排序,最末者为当前论坛排序号
set rs=conn.execute("select boardid,orders,child,ParentStr from board where ParentID="&ParentID&" and orders<"&orders&" order by orders desc")
do while not rs.eof
i=i+1
if Cint(request("uporders"))>=i then
'response.write "update board set orders="&orders&" where boardid="&rs(0)&"<br>"
if rs(2)>0 then
ii=0
set trs=conn.execute("select boardid,orders from board where ParentStr like '%"&rs(3)&","&rs(0)&"%' order by orders")
if not (trs.eof and trs.bof) then
do while not trs.eof
ii=ii+1
conn.execute("update board set orders="&orders&"+"&oldorders&"+"&ii&" where boardid="&trs(0))
trs.movenext
loop
end if
end if
conn.execute("update board set orders="&orders&"+"&oldorders&" where boardid="&rs(0))
if Cint(request("uporders"))=i then uporders=rs(1)
end if
orders=rs(1)
rs.movenext
loop
'response.write "update board set orders="&uporders&" where boardid="&request("editID")
'更新所要排序的论坛的序号
conn.execute("update board set orders="&uporders&" where boardid="&request("editID"))
'如果有下属论坛,则更新其下属论坛排序
if child>0 then
i=uporders
set rs=conn.execute("select boardid from board where ParentStr like '%"&ParentStr&"%' order by orders")
do while not rs.eof
i=i+1
conn.execute("update board set orders="&i&" where boardid="&rs(0))
rs.movenext
loop
end if
'response.end
set rs=nothing
set trs=nothing
elseif request("doorders")<>"" then
if not isnumeric(request("doorders")) then
response.write "非法的参数!"
exit sub
elseif Cint(request("doorders"))=0 then
response.write "请选择要下降的数字!"
exit sub
end if
set rs=conn.execute("select ParentID,orders,ParentStr,child from board where boardid="&request("editID"))
ParentID=rs(0)
orders=rs(1)
ParentStr=rs(2) & "," & request("editID")
child=rs(3)
i=0
if child>0 then
set rs=conn.execute("select count(*) from board where ParentStr like '%"&ParentStr&"%'")
oldorders=rs(0)
else
oldorders=0
end if
set rs=conn.execute("select boardid,orders,child,ParentStr from board where ParentID="&ParentID&" and orders>"&orders&" order by orders")
do while not rs.eof
i=i+1
if Cint(request("doorders"))>=i then
if rs(2)>0 then
ii=0
set trs=conn.execute("select boardid,orders from board where ParentStr like '%"&rs(3)&","&rs(0)&"%' order by orders")
if not (trs.eof and trs.bof) then
do while not trs.eof
ii=ii+1
'response.write "update board set orders="&orders&"+"&ii&" where boardid="&trs(0)&"-a<br>"
conn.execute("update board set orders="&orders&"+"&ii&" where boardid="&trs(0))
trs.movenext
loop
end if
end if
'response.write "update board set orders="&orders&" where boardid="&rs(0)&"<br>"
conn.execute("update board set orders="&orders&" where boardid="&rs(0))
if Cint(request("doorders"))=i then doorders=rs(1)
end if
orders=rs(1)
rs.movenext
loop
'response.write "update board set orders="&doorders&" where boardid="&request("editID")&"<br>"
conn.execute("update board set orders="&doorders&" where boardid="&request("editID"))
'如果有下属论坛,则更新其下属论坛排序
if child>0 then
i=doorders
set rs=conn.execute("select boardid from board where ParentStr like '%"&ParentStr&"%' order by orders")
do while not rs.eof
i=i+1
'response.write "update board set orders="&i&" where boardid="&rs(0)&"-b<br>"
conn.execute("update board set orders="&i&" where boardid="&rs(0))
rs.movenext
loop
end if
'response.end
set rs=nothing
set trs=nothing
end if
call cache_board()
response.redirect "admin_board.asp?action=boardorders"
end sub
sub addmaster(s,o,n)
dim arr,pw,oarr
dim classname,titlepic
set rs=conn.execute("select title from usergroups where usergroupid=3")
classname=rs(0)
set rs=conn.execute("select titlepic from usertitle where usergroupid=3 order by Minarticle desc")
if not (rs.eof and rs.bof) then
titlepic=rs(0)
end if
randomize
pw=Cint(rnd*9000)+1000
arr=split(s,"|")
oarr=split(o,"|")
set rs=server.createobject("adodb.recordset")
for i=0 to Ubound(arr)
sql="select * from [user] where username='"& arr(i) &"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs("username")=arr(i)
rs("userpassword")=md5(pw)
rs("userclass")=classname
rs("UserGroupID")=3
rs("titlepic")=titlepic
rs("userWealth")=100
rs("userep")=30
rs("usercp")=30
rs("userisbest")=0
rs("userdel")=0
rs("userpower")=0
rs("lockuser")=0
rs.update
str=str&"你添加了以下用户:<b>" &arr(i) &"</b> 密码:<b>"& pw &"</b><br><br>"
else
if rs("UserGroupID")>3 then
rs("userclass")=classname
rs("UserGroupID")=3
rs("titlepic")=titlepic
rs.update
end if
end if
rs.close
next
'判断原版主在其他版面是否还担任版主,如没有担任则撤换该用户职位
if n=1 then
dim iboardmaster
dim UserGrade,article
iboardmaster=false
for i=0 to ubound(oarr)
set rs=conn.execute("select boardmaster from board")
do while not rs.eof
if instr("|"&trim(rs("boardmaster"))&"|","|"&trim(oarr(i))&"|")>0 then
iboardmaster=true
exit do
end if
rs.movenext
loop
if not iboardmaster then
set rs=conn.execute("select userid,UserGroupID,article from [user] where username='"&trim(oarr(i))&"'")
if not (rs.eof and rs.bof) then
if rs(1)>2 then
if not isnumeric(rs(2)) then article=0
set UserGrade=conn.execute("select top 1 usertitle,titlepic,UserGroupID from usertitle where Minarticle<="&rs(2)&" and not MinArticle=-1 order by MinArticle desc,usertitleid")
if not (UserGrade.eof and UserGrade.bof) then
conn.execute("update [user] set UserGroupID="&UserGrade(2)&",titlepic='"&UserGrade(1)&"',userclass='"&UserGrade(0)&"' where userid="&rs(0))
end if
end if
end if
end if
iboardmaster=false
next
end if
set rs=nothing
end sub
sub boardpermission()
dim iUserGroupID(20),UserTitle(20)
dim trs,ars,k,ii
ii=0
set trs=conn.execute("select title,usergroupid from usergroups order by usergroupid")
do while not trs.eof
UserTitle(ii)=trs(0)
iUserGroupID(ii)=trs(1)
ii=ii+1
trs.movenext
loop
%>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align=center class="tableBorder">
<tr>
<th height="25">编辑论坛权限</th>
</tr>
<tr>
<td class=forumrow>①您可以设置不同用户组在不同论坛内的权限,红色表示为该论坛该用户组使用的是用户定义属性<BR>②该权限不能继承,比如您设置了一个包含下级论坛的版面,那么只对您设置的版面生效而不对其下属论坛生效<BR>③如果您想设置生效,必须在设置页面<B>选择自定义设置</B>,选择了自定义设置后,这里设置的权限将<B>优先</B>于用户组设置,比如用户组默认不能管理帖子,而这里设置了该用户组可管理帖子,那么该用户组在这个版面就可以管理帖子
</td>
</tr>
</table><BR>
<table width="95%" cellspacing="1" cellpadding="1" align=center class="tableBorder">
<tr>
<th width="35%" class="tableHeaderText" height=25>论坛版面
</th>
<th width="35%" class="tableHeaderText" height=25>设置用户组权限
</th>
</tr>
<%
sql="select * from board order by rootid,orders"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
%>
<tr>
<td height="25" width=40% class="forumrow">
<%if rs("depth")>0 then%>
<%for i=1 to rs("depth")%>
<%next%>
<%end if%>
<%if rs("child")>0 then%><img src="pic/plus.gif"><%else%><img src="pic/nofollow.gif"><%end if%>
<%if rs("parentid")=0 then%><b><%end if%><%=rs("boardtype")%><%if rs("child")>0 then%>(<%=rs("child")%>)<%end if%>
</td>
<FORM METHOD=POST ACTION="?action=editpermission">
<td width=60% class="forumrow">
<select name="groupid" size=1>
<%
for k=0 to ii-1
set ars=conn.execute("select pid from BoardPermission where BoardID="&rs("boardid")&" and GroupID="&iUserGroupID(k))
if ars.eof and ars.bof then
response.write "<option value="""&iUserGroupID(k)&""">" & UserTitle(k) & "</option>"
else
response.write "<option value="""&iUserGroupID(k)&""">" & UserTitle(k) & "(自定义)</option>"
end if
next
%>
</select>
<input type=hidden value="<%=rs("boardid")%>" name=reboardid>
<input type=submit name=submit value="设置">
<%
dim percount
set trs=conn.execute("select count(*) from BoardPermission where boardid="&rs("boardid"))
percount=trs(0)
if not isnull(percount) and percount>0 then response.write "(有自定义版面)"
%>
</td>
</FORM>
</tr>
<%
rs.movenext
loop
set rs=nothing
%>
</table><BR><BR>
<%
set trs=nothing
set ars=nothing
end sub
sub editpermission()
if not isnumeric(request("groupid")) then
response.write "错误的参数!"
exit sub
end if
if request("groupaction")="yes" then
dim GroupSetting
GroupSetting=Request.Form("canview") & "," & Request.Form("canviewuserinfo") & "," & Request.Form("canviewpost") & "," & Request.Form("cannewpost") & "," & Request.Form("canreplymytopic") & "," & Request.Form("canreplytopic") & "," & Request.Form("canpostagree") & "," & Request.Form("canupload") & "," & Request.Form("canpostvote") & "," & Request.Form("canvote") & "," & Request.Form("caneditmytopic") & "," & Request.Form("candelmytopic") & "," & Request.Form("canmovemytopic") & "," & Request.Form("canclosemytopic") & "," & Request.Form("cansearch") & "," & Request.Form("canmailtopic") & "," & Request.Form("canmodify") & "," & Request.Form("cansmallpaper") & "," & Request.Form("candeltopic") & "," & Request.Form("canmovetopic") & "," & Request.Form("canclosetopic") & "," & Request.Form("cantoptopic") & "," & Request.Form("canawardtopic") & "," & Request.Form("canmodifytopic") & "," & Request.Form("canbesttopic") & "," & Request.Form("canAnnounce") & "," & Request.Form("canAdminAnnounce") & "," & Request.Form("canAdminPaper") & "," & Request.Form("canAdminUser") & "," & Request.Form("canDelUserTopic") & "," & Request.Form("canviewip") & "," & Request.Form("canadminip") & "," & Request.Form("cansendsms") & "," & Request.Form("Maxsendsms") & "," & Request.Form("Maxsmsbody") & "," & Request.Form("Maxsmsbox") & "," & Request.Form("canusetitle") & "," & Request.Form("canuseface") & "," & Request.Form("canusesign") & "," & Request.Form("canvieweven") & "," & Request.Form("canuploadnum") & "," & Request.Form("canviewbest") & "," & Request.Form("adminpermission") & "," & request.form("canaward") & "," & request.form("MaxUploadSize") & "," & request.form("canbatchtopic") & "," & request.form("smallpapermoney") & "," & request.form("postagreemoney") & "," & request.form("canadminfile") & "," & request.form("ba1") & "," & request.form("ba2") & "," & request.form("ba3") & "," & request.form("ba4") & "," & request.form("ba5") & "," & request.form("ba6") & "," & request.form("ba7")
Set rs= Server.CreateObject("ADODB.Recordset")
if request("isdefault")=1 then
conn.execute("delete from BoardPermission where BoardID="&request("reBoardID")&" and GroupID="&request("GroupID"))
else
if request("pid")<>"" then
sql="update BoardPermission set PSetting='"&GroupSetting&"' where pid="&request("pid")
else
sql="insert into BoardPermission (BoardID,GroupID,PSetting) values ("&request("reBoardID")&","&request("GroupID")&",'"&GroupSetting&"')"
end if
conn.execute(sql)
end if
set rs=nothing
response.write "修改成功!返回<a href=?action=permission>论坛权限管理</a>"
else
Dim reGroupSetting,reBoardID,groupid
Dim Groupname,Boardname,founduserper
founduserper=false
if request("GroupID")<>"" then
set rs=conn.execute("select * from BoardPermission where boardid="&request("reBoardID")&" and GroupID="&request("GroupID"))
if rs.eof and rs.bof then
founduserper=false
else
groupid=rs("groupid")
reGroupSetting=split(rs("PSetting"),",")
reBoardID=rs("boardid")
set rs=conn.execute("select title from UserGroups where usergroupid="&groupid)
groupname=rs("title")
founduserper=true
end if
if not founduserper then
set rs=conn.execute("select * from usergroups where usergroupid="&request("groupid"))
if rs.eof and rs.bof then
response.write "未找到该用户组!"
exit sub
end if
groupid=request("groupid")
reGroupSetting=split(rs("GroupSetting"),",")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -