📄 admin_postings.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/char.asp"-->
<!--#include file="inc/theme.asp"-->
<!--#include file="chkuser.asp"-->
<%
stats="帖子管理"
dim boardid
dim rootid
dim id
dim Lasttopic,Lastpost
dim lastrootid,lastpostuser
if founduser=false then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请登陆后进行操作。"
end if
if request("boardid")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定论坛版面。"
elseif not isInteger(request("boardid")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"
else
boardid=request("boardid")
if chkboardmaster(boardid)=false then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>您不是该版面斑竹或者系统管理员。"
end if
end if
if request("id")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
elseif not isInteger(request("id")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
id=request("id")
end if
if request("rootid")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
elseif not isInteger(request("rootid")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
else
rootid=request("rootid")
end if
call nav()
call headline(1)
if founderr=true then
call Error()
else
set rs=server.createobject("adodb.recordset")
if request("action")="lock" then
call lock()
elseif request("action")="unlock" then
call unlock()
elseif request("action")="delete" then
call delete()
elseif request("action")="move" then
call Tmove()
elseif request("action")="copy" then
call copy()
elseif request("action")="istop" then
call istop()
elseif request("action")="notop" then
call notop()
elseif request("action")="dele" then
call dele()
elseif request("action")="isbest" then
call isbest()
elseif request("action")="nobest" then
call nobest()
else
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请选择相应操作。"
end if
if founderr=true then
call error()
end if
set rs=nothing
call endline()
sub lock()
sql="update bbs1 set locktopic=1 where boardid="&boardid&" and rootid="&cstr(rootid)
conn.Execute(sql)
url="dispbbs.asp?boardid="&boardid&"&rootid="&rootid&"&id="&rootid
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','锁定帖子','"&url&"')"
conn.execute(sql)
call success()
end sub
sub unlock()
sql="update bbs1 set locktopic=0 where boardid="&boardid&" and rootid="&cstr(rootid)
conn.Execute(sql)
url="dispbbs.asp?boardid="&boardid&"&rootid="&rootid&"&id="&rootid
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','解除锁定','"&url&"')"
conn.execute(sql)
call success()
end sub
sub istop()
sql="update bbs1 set istop=1 where boardid="&boardid&" and rootid="&cstr(rootid)
conn.Execute(sql)
url="dispbbs.asp?boardid="&boardid&"&rootid="&rootid&"&id="&rootid
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','固顶帖子','"&url&"')"
conn.execute(sql)
call success()
end sub
sub notop()
sql="update bbs1 set istop=0 where boardid="&boardid&" and rootid="&cstr(rootid)
conn.Execute(sql)
url="dispbbs.asp?boardid="&boardid&"&rootid="&rootid&"&id="&rootid
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','解除固顶','"&url&"')"
conn.execute(sql)
call success()
end sub
sub isbest()
sql="update bbs1 set isbest=1 where boardid="&boardid&" and announceid="&cstr(id)
conn.Execute(sql)
url="showannounce.asp?boardid="&boardid&"&rootid="&rootid&"&id="&id
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','加入精华','"&url&"')"
conn.execute(sql)
call success()
end sub
sub nobest()
sql="update bbs1 set isbest=0 where boardid="&boardid&" and announceid="&cstr(id)
conn.Execute(sql)
url="showannounce.asp?boardid="&boardid&"&rootid="&rootid&"&id="&id
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','解除精华','"&url&"')"
conn.execute(sql)
call success()
end sub
sub dele()
sql="update bbs1 set locktopic=2 where boardid="&boardid&" and ParentID<>0 and announceid="&cstr(id)
conn.Execute(sql)
sql="select Max(announceid) from bbs1 where not locktopic=2 and rootid="&rootid&" and boardid="&boardid
set rs=conn.Execute(sql)
LastPostime=rs(0)
rs.close
dim todaynum
sql="select count(*) from bbs1 where announceid="&id&" and dateandtime>#"&date()&"#"
set rs=conn.execute(sql)
todaynum=rs(0)
rs.close
call LastCount(boardid)
call BoardNumSub(boardid,0,1,todayNum)
call AllboardNumSub(todayNum,1,0)
sql="update bbs1 set times="&LastPostime&" where rootid="&rootid&" and boardid="&boardid
conn.execute(sql)
sql="update bbs1 set child=child-1 where announceid="&rootid&" and boardid="&boardid
conn.execute(sql)
sql="update [user] set article=article-1,userWealth=userWealth-"&wealthDel&",userEP=userEP-"&epDel&",userCP=userCP-"&cpDel&" where username='"&request("username")&"'"
'response.write sql
conn.execute (sql)
url="showannounce.asp?boardid="&boardid&"&rootid="&rootid&"&id="&id
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','删除帖子','"&url&"')"
conn.execute(sql)
call success()
end sub
sub delete()
dim todaynum,postnum
sql="select count(*) from bbs1 where rootid="&rootid
set rs=conn.execute(sql)
postNum=rs(0)
sql="select count(*) from bbs1 where rootid="&rootid&" and dateandtime>#"&date()&"#"
set rs=conn.execute(sql)
todayNum=rs(0)
set rs=server.createobject("adodb.recordset")
sql="select username from bbs1 where rootid="&rootid
rs.open sql,conn,0,1
do while not rs.eof
sql="update [user] set article=article-1,userWealth=userWealth-"&wealthDel&",userEP=userEP-"&epDel&" where username='"&rs(0)&"'"
conn.execute (sql)
rs.movenext
loop
set rs=nothing
sql="update bbs1 set locktopic=2 where rootid="&cstr(rootid)
conn.Execute(sql)
call LastCount(boardid)
call BoardNumSub(boardid,1,postNum,todayNum)
call AllboardNumSub(todayNum,postNum,1)
url="dispbbs.asp?boardid="&boardid&"&rootid="&rootid&"&id="&rootid
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','删除主题','"&url&"')"
conn.execute(sql)
call success()
end sub
sub Tmove()
dim newboardid
if request("checked")="yes" then
if request("boardid")=request("newboardid") then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>不能在相同版面内进行转移操作。"
elseif not isInteger(request("newboardid")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的版面参数。"
exit sub
else
newboardid=request("newboardid")
sql="select boardid,announceid,Parentid from bbs1 where announceid="&id&" and boardid="&cstr(boardid)
rs.open sql,conn,0,1
if rs.eof and rs.bof then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>您选择的贴子并不存在。"
else
if rs("Parentid")<>0 then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>您必须选择一个主题,而不是贴子。"
end if
end if
rs.close
end if
if founderr=false then
if request("leavemessage")="yes" then
'ON ERROR RESUME NEXT
elseif request("leavemessage")="no" then
dim newtopic
sql="select topic from bbs1 where announceid="&rootid
rs.open sql,conn,0,1
newtopic=rs("topic") & "-->" & membername & "转移"
rs.close
sql="update bbs1 set topic='"&newtopic&"' where announceid="&rootid
conn.execute(sql)
sql="update bbs1 set boardid="&newboardid&" where rootid="&rootid
conn.Execute(sql)
dim postNum,todayNum
sql="select count(*) from bbs1 where rootid="&rootid
rs.open sql,conn,0,1
postNum=rs(0)
rs.close
sql="select count(*) from bbs1 where rootid="&rootid&" and dateandtime>=#"&date()&"#"
rs.open sql,conn,0,1
todayNum=rs(0)
rs.close
'更新论坛贴子数据
call LastCount(boardid)
call BoardNumSub(boardid,1,postNum,todayNum)
call LastCount(newboardid)
call BoardNumAdd(newboardid,1,postNum,todayNum)
'更新论坛数据结束
url="dispbbs.asp?boardid="&newboardid&"&rootid="&rootid&"&id="&rootid
sql="insert into log (l_username,l_content,l_url) values ('"&membername&"','转移主题','"&url&"')"
conn.execute(sql)
call success()
else
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请选择相应操作。"
end if
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -