📄 board.asp
字号:
<div class="th jz">分类排序</div>
<%
do while not rs.eof
response.write"<div class=""td1 h30""> "&rs(1)&"</div><div class=""td2 h30""><input name='boardid' type='hidden' value='"&rs(0)&"'><input name='rootid' type='hidden' value='"&rs(2)&"'><input type=text name='newrootid' value='"&rs(2)&"' size=4 ></div>"
rs.movenext
loop
%><div style="clear: both;"></div><div class="tf jz"><input type="submit" value=" 修 改 "> <input type="reset" value=" 重 置 "></div>
</div></form>
<%rs.close
end sub
sub saveclassorders
dim boardid,rootid,newrootid,temp,i
temp=","
for i=1 to request.form("boardid").count
boardid = request.form("boardid")(i)
rootid = request.form("rootid")(i)
newrootid = request.form("newrootid")(i)
if instr(temp,","&newrootid&",")>0 then
call goback("排序错误","各分类排序的数字不能一样!")
exit sub
end if
temp=temp&newrootid&","
if not isnumeric(boardid) or not isnumeric(newrootid) then
call goback("排序错误","请用数字填写!")
exit sub
end if
next
for i=1 to request.form("boardid").count
boardid = request.form("boardid")(i)
rootid = request.form("rootid")(i)
newrootid = request.form("newrootid")(i)
if rootid<>newrootid then
yxbbs.execute("update [yx_board]set rootid="&newrootid&" where boardid="&boardid)
temp=boardid
yxbbs.execute("update [yx_board] set rootid="&newrootid&" where parentstr like '%"&temp&"%' and rootid="&rootid&"")
end if
next
call suc("","排序成功!","?")
end sub
sub addmaster(s,o,n)
dim arr,oarr,i,sql
dim gradenum,gradename,gradepic
set rs=conn.execute("select gradenum,gradename,gradepic from yx_usergrade where classid = 3 order by userminpostnum desc")
if not (rs.eof and rs.bof) then
gradenum = rs(0)
gradename = rs(1)
gradepic = rs(2)
end if
randomize
arr = split(s,"@@")
oarr = split(o,"@@")
set rs = server.createobject("adodb.recordset")
for i = 0 to ubound(arr)
sql = "select * from [yx_user] where name = '" & arr(i) & "'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
call goback("",arr(i) &"这个用户还没有注册!")
else
if rs("classid") = 5 then
rs("gradenum") = gradenum
rs("classid") = 3
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 = yxbbs.execute("select boardadmin from yx_board")
do while not rs.eof
if instr("|" & trim(rs(0)) & "|","|" & trim(oarr(i)) & "|") > 0 then
iboardmaster = true
exit do
end if
rs.movenext
loop
if not iboardmaster then
set rs = yxbbs.execute("select id,classid,essaynum from [yx_user] where name='" & trim(oarr(i)) & "' or classid=3")
if not (rs.eof and rs.bof) then
'if rs(1) > 2 then
if not isnumeric(rs(2)) or rs(2) = "" then
article = 0
else
article = cstr(rs(2))
end if
'取对应注册会员的等级
set usergrade = yxbbs.execute("select top 1 gradenum,gradename,gradepic from yx_usergrade where userminpostnum <= " & article & " and not userminpostnum = -1 and classid = 5 order by userminpostnum desc")
if not (usergrade.eof and usergrade.bof) then
yxbbs.execute("update [yx_user] set gradenum="&usergrade(0)&",classid=5 where id="&rs(0))
end if
usergrade.close:set usergrade = nothing
'end if
end if
end if
iboardmaster = false
next
end if
set rs = nothing
end sub
sub boardunite
%><form method=post style="margin:0" action="?action=saveboardunite">
<div class="ta">
<div class="th jz">论坛合并</div>
<div class="td w772">将论坛:
<select size="1" name="boardid"><option value='0'>请选择原论坛</option><%=yxbbs.boardidlist(0,0)%></select> 合并到论坛: <select size="1" name="newboardid"><option value='0'>请选择目标论坛</option><%=yxbbs.boardidlist(0,0)%></select> 中 <input type="submit" onclick=checkclick('操作后将不能恢复!您确定要合并吗?') value=" 论坛合并 ">
<br /><br /><b>注意事项:</b><font color=red>此操作不可恢复,请慎重操作!</font><br />
分类不能操作,不能和其属下的论坛合并。<br />
合并后原论坛(包括属下论坛)将被删除,所有帖子(包括属下论坛的帖子)将转移到指定的目标论坛中</div>
<div style="clear: both;"></div></div></form>
<%
end sub
sub saveboardunite
dim boardid,newboardid,tempparentstr,tempparentid,rs1
dim i,alltable
dim parentstr,depth,parentid,child,rootid
boardid=yxbbs.fun.getstr("boardid")
newboardid=yxbbs.fun.getstr("newboardid")
if boardid="" or newboardid="" then
call goback("","请先指定论坛后再进行合并!")
exit sub
elseif boardid=newboardid then
call goback("","同一个论坛不用合并了!")
exit sub
end if
set rs=yxbbs.execute("select parentstr,boardid,depth,parentid,child,rootid from yx_board where boardid="&boardid)
if rs(2)="0" then
call goback("系统错误","分类不能做合并操作!")
exit sub
end if
parentstr=rs(0) & "," & rs(1)
parentid=rs(3)
tempparentstr=rs(1)
depth=rs(2)
child=rs(4)+1
rootid=rs(5)
rs.close
tempparentid=parentid
'判断是否合并到下属论坛
set rs=yxbbs.execute("select boardid from [yx_board] where boardid="&newboardid&" and parentstr like '%"&parentstr&"%'")
if not (rs.eof and rs.bof) then
call goback("","不能将论坛合并到其下属论坛中!")
exit sub
end if
rs.close
'得到全部下属论坛id
i=0
set rs=yxbbs.execute("select boardid from [yx_board] where rootid="&rootid&" and parentstr like '%"&parentstr&"%'")
do while not rs.eof
if i=0 then
tempparentstr=rs(0)
else
tempparentstr=tempparentstr & "," & rs(0)
end if
i=i+1
rs.movenext
loop
if i>0 then
parentstr=tempparentstr & "," & boardid
else
parentstr=boardid
end if
'更新其原来所属论坛版面数
yxbbs.execute("update [yx_board] set child=child-"&child&" where boardid="&tempparentid)
'更新其原来所属论坛数据,排序相当于剪枝而不需考虑
for i=1 to depth
'得到其父类的父类的版面id
set rs=yxbbs.execute("select parentid from [yx_board] where boardid="&tempparentid)
if not (rs.eof and rs.bof) then
tempparentid=rs(0)
yxbbs.execute("update [yx_board] set child=child-"&child&" where boardid="&tempparentid)
end if
next
'更新论坛帖子数据
alltable=split(yxbbs.bbstable(0),",")
for i=0 to ubound(alltable)
yxbbs.execute("update [yx_bbs"&alltable(i)&"] set boardid="&newboardid&" where boardid in ("&parentstr&")")
next
yxbbs.execute("update [yx_topic] set boardid="&newboardid&" where boardid in ("&parentstr&")")
'删除被合并论坛
set rs=yxbbs.execute("select sum(essaynum),sum(topicnum),sum(todaynum) from [yx_board] where rootid="&rootid&" and boardid in ("&parentstr&")")
yxbbs.execute("delete from [yx_board] where rootid="&rootid&" and boardid in ("&parentstr&")")
'更新新论坛帖子计数
yxbbs.execute("update [yx_board] set essaynum=essaynum+"&rs(0)&",topicnum=topicnum+"&rs(1)&",todaynum=todaynum+"&rs(2)&" where boardid ="&newboardid&"")
'更新上级版块
set rs1=yxbbs.execute("select depth,parentstr,boardid from [yx_board] where boardid="&newboardid)
if rs1(0)>1 then
parentstr=rs1(0)
yxbbs.execute("update [yx_board] set essaynum=essaynum+"&rs(0)&",topicnum=topicnum+"&rs(1)&",todaynum=todaynum+"&rs(2)&" where boardid in ("&parentstr&")")
end if
rs1.close:set rs1=nothing
rs.close
call suc("","合并成功!已经将原论坛(包括属下)的所有帖子合并到目标论坛。","?")
end sub
sub ordersboard
dim boardid,parentid,rootid,orders,parentstr,i,boardnum,p_rs,boardname
boardid=yxbbs.boardid
set rs=yxbbs.execute("select orders,parentid,parentstr,boardname from[yx_board] where boardid="&yxbbs.boardid)
if rs.eof or rs.bof then
call goback("系统出错!","该版面不存在,可能已经删除了!")
exit sub
end if
orders=rs(0)
parentid=rs(1)
parentstr=rs(2)
rs.close
'当版面为类时
if parentid=0 then call goback("系统出错!","版面id出错。"):exit sub
'得到其下属版面数
parentstr=parentstr & ","
boardnum=yxbbs.execute("select count(*) from [yx_board] where parentstr like '%"&parentstr & boardid&"%'")(0)
if isnull(boardnum) then boardnum=1
'获得父级信息
set p_rs=yxbbs.execute("select * from [yx_board] where boardid="&parentid)
'在获得移动过来的版面数后更新排序在指定论坛之后的论坛排序数据
yxbbs.execute("update [yx_board] set orders=orders + "&boardnum&"+1 where rootid="&p_rs("rootid")&" and orders>"&p_rs("orders")&"")
'更新当前版面数据
yxbbs.execute("update [yx_board] set orders="&p_rs("orders")&"+1 where boardid="&boardid)
dim tempparentstr
i=1
'更新下属,同时获得移动总数i
'如果有则更新下属版面数据
set rs=yxbbs.execute("select * from [yx_board] where parentstr like '%"&parentstr & boardid&"%' order by orders")
do while not rs.eof
i=i+1
if p_rs("parentstr")="0" then'如果其父级为类,那么其下属的版面数据
tempparentstr=p_rs("boardid") & "," & replace(rs("parentstr"),parentstr,"")
else
tempparentstr=p_rs("parentstr") & "," & p_rs("boardid") & "," & replace(rs("parentstr"),parentstr,"")
end if
yxbbs.execute("update [yx_board] set orders="&p_rs("orders")&"+"&i&",parentstr='"&tempparentstr&"' where boardid="&rs("boardid"))
rs.movenext
loop
rs.close
p_rs.close
set p_rs=nothing
call suc("","成功的将该版面置前!","?")
response.end
end sub
sub passuser
set rs=yxbbs.execute("select passuser,boardname from [yx_board] where boardid="&yxbbs.boardid&" and parentid<>0")
if rs.eof then
call goback("","此论坛的类型不是认证论坛,不能设置认证用户。")
exit sub
end if%>
<form method=post style='margin:0' action="?action=savepassuser">
<div class="ta">
<div class="th jz">修改论坛认证用户</div>
<div class="td1">所在论坛:</div>
<div class="td2"><input name="boardid" value="<%=yxbbs.boardid%>" type="hidden"><%=rs("boardname")%></div>
<div class="td1 h50"><b>通过认证的用户:</b><br />各用户之间用“|”隔开<br />请不要使用回车键enter</div>
<div class="td2 h50 w446"><textarea name="passuser" rows="2"><%=rs("passuser")%></textarea></div>
<div style="clear: both;"></div><div class="tf"><input type="submit" value=" 提 交 "> <input type="reset" name="submit" value=" 重 置 "></div></div></form>
<%rs.close
end sub
sub savepassuser
dim passusers,boardid
boardid=yxbbs.fun.getstr("boardid")
passusers=trim(replace(request.form("passuser"),"'",""))
passusers=replace(passusers,chr(10), "")
passusers=replace(passusers,chr(13), "")
yxbbs.execute("update [yx_board] set passuser='"&passusers&"' where boardid="&boardid&" and parentid<>0")
cache.name="boardinfo"
cache.clean()
call suc("","成功的更新了该论坛的认证会员!","?")
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -