📄 b_admin.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<%
stats="帖子管理"
dim id,replyid
Dim canlocktopic,candeltopic,canmovetopic,cantoptopic,canbesttopic,canawardtopic
Dim Topic,TopicUsername,TopicUserID
canlocktopic=false
candeltopic=false
cantoptopic=false
canbesttopic=false
canawardtopic=false
if not founduser then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>请登陆后进行操作。"
end if
if Cint(GroupSetting(29))=1 then
Errmsg=Errmsg+"<br>"+"<li>您没有班级论坛管理的权限,请<a href=login.asp>登陆</a>或者同管理员联系。"
founderr=true
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 isInteger(request("replyid")) then
replyid=request("replyid")
end if
if not founderr then
set rs=conn.execute("select title,postuser,postuserid from topic where topicid="&id)
if rs.eof and rs.bof then
Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
founderr=true
else
Topic=CheckStr(rs(0))
Topicusername=CheckStr(rs(1))
Topicuserid=rs(2)
end if
'判断用户是否权限
if (master or supermaster) and Cint(GroupSetting(29))=0 then
canlocktopic=true
canbesttopic=true
canawardtopic=true
cantoptopic=true
candeltopic=true
else
canlocktopic=false
canbesttopic=false
canawardtopic=false
cantoptopic=false
candeltopic=false
end if
end if
if founderr then
call head()
call head_var("错误信息",Request.ServerVariables("HTTP_REFERER"))
call txl_error()
else
call head()
call head_var("","")
select case request("action")
case "lock"
if not canlocktopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call lock()
end if
case "unlock"
if not canlocktopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call unlock()
end if
case "uptopic"
if not canlocktopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call uptopic()
end if
case "delet"
if not candeltopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call delete()
end if
case "istop"
if not cantoptopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call istop()
end if
case "notop"
if not cantoptopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call notop()
end if
case "dele"
call dele()
case "isbest"
if not canbesttopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call isbest()
end if
case "nobest"
if not canbesttopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call nobest()
end if
case "award"
if not canawardtopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call award()
end if
case "punish"
if not canawardtopic then
Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
founderr=true
else
call punish()
end if
case else
call txl_error()
end select
if founderr then call txl_error()
end if
call foot()
sub lock()
sql="update topic set islock=1 where topicid="&id
conn.Execute(sql)
sucmsg=sucmsg+"<br>"+"<li>锁定帖子《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub unlock()
sql="update topic set islock=0 where topicid="&id
conn.Execute(sql)
sucmsg=sucmsg+"<br>"+"<li>解除锁定《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub uptopic()
sql="update topic set LastTime=Now() where topicid="&id
conn.Execute(sql)
sucmsg=sucmsg+"<br>"+"<li>提升主题《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub istop()
sql="update topic set istop=1 where topicid="&id
conn.Execute(sql)
sucmsg=sucmsg+"<br>"+"<li>固顶帖子《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub notop()
sql="update topic set istop=0 where topicid="&id
conn.Execute(sql)
sucmsg=sucmsg+"<br>"+"<li>解除固顶《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub isbest()
set rs=conn.execute("select * from bbs where bbsid="&cstr(replyid))
if rs.eof and rs.bof then
Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
founderr=true
exit sub
end if
topic=rs("title")
topicusername=rs("postuser")
topicuserid=rs("postuserid")
sql="update bbs set isbest=1 where bbsid="&cstr(replyid)
conn.Execute(sql)
conn.execute("update topic set isbest=1 where topicid="&id)
conn.execute("update [user] set usermoney=usermoney+"&txl_user(5)&" where userid="&topicuserid)
sucmsg=sucmsg+"<br>"+"<li>加入精华《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub nobest()
sql="update bbs set isbest=0 where bbsid="&cstr(replyid)
conn.Execute(sql)
conn.execute("update topic set isbest=0 where topicid="&id)
sucmsg=sucmsg+"<br>"+"<li>解除精华《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub award()
conn.execute("update [user] set usermoney=usermoney+"&txl_user(12)&" where userid="&TopicUserID)
sucmsg=sucmsg+"<br>"+"<li>奖励帖子《"&topic&"》成功,并奖励用户财产+"&txl_user(12)&"</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub punish()
conn.execute("update [user] set usermoney=usermoney-"&txl_user(12)&" where userid="&TopicUserID)
sucmsg=sucmsg+"<br>"+"<li>惩罚帖子《"&topic&"》成功,并惩罚用户财产-"&txl_user(12)&"</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub delete()
conn.execute("delete from topic where topicid="&id)
conn.execute("delete from bbs where rootid="&id)
conn.execute("update [user] set usermoney=usermoney-"&txl_user(4)&" where userid="&topicuserid)
sucmsg=sucmsg+"<br>"+"<li>删除帖子《"&topic&"》成功,并删除了其所有回帖</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
sub dele()
set rs=conn.execute("select * from bbs where bbsid="&cstr(replyid))
if rs.eof and rs.bof then
Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
founderr=true
exit sub
end if
topic=rs("title")
topicusername=rs("postuser")
topicuserid=rs("postuserid")
conn.execute("delete from bbs where bbsid="&cstr(replyid))
conn.execute("update [user] set usermoney=usermoney-"&txl_user(4)&" where userid="&topicuserid)
sucmsg=sucmsg+"<br>"+"<li>删除跟帖《"&topic&"》成功.</li><li>请慎重使用论坛的管理职能。"
call txl_suc()
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -