b_admin.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:6k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <%
  4. stats="帖子管理"
  5. dim id,replyid
  6. Dim canlocktopic,candeltopic,canmovetopic,cantoptopic,canbesttopic,canawardtopic
  7. Dim Topic,TopicUsername,TopicUserID
  8. canlocktopic=false
  9. candeltopic=false
  10. cantoptopic=false
  11. canbesttopic=false
  12. canawardtopic=false
  13. if not founduser then
  14. founderr=true
  15. Errmsg=Errmsg+"<br>"+"<li>请登陆后进行操作。"
  16. end if
  17. if Cint(GroupSetting(29))=1 then
  18. Errmsg=Errmsg+"<br>"+"<li>您没有班级论坛管理的权限,请<a href=login.asp>登陆</a>或者同管理员联系。"
  19. founderr=true
  20. end if
  21. if request("id")="" then
  22. founderr=true
  23. Errmsg=Errmsg+"<br>"+"<li>请指定相关贴子。"
  24. elseif not isInteger(request("id")) then
  25. founderr=true
  26. Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
  27. else
  28. id=request("id")
  29. end if
  30. if isInteger(request("replyid")) then
  31. replyid=request("replyid")
  32. end if
  33. if not founderr then
  34. set rs=conn.execute("select title,postuser,postuserid from topic where topicid="&id)
  35. if rs.eof and rs.bof then
  36. Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
  37. founderr=true
  38. else
  39. Topic=CheckStr(rs(0))
  40. Topicusername=CheckStr(rs(1))
  41. Topicuserid=rs(2)
  42. end if
  43. '判断用户是否权限
  44. if (master or supermaster) and Cint(GroupSetting(29))=0 then
  45. canlocktopic=true
  46. canbesttopic=true
  47. canawardtopic=true
  48. cantoptopic=true
  49. candeltopic=true
  50. else
  51. canlocktopic=false
  52. canbesttopic=false
  53. canawardtopic=false
  54. cantoptopic=false
  55. candeltopic=false
  56. end if
  57. end if
  58. if founderr then
  59. call head()
  60. call head_var("错误信息",Request.ServerVariables("HTTP_REFERER"))
  61. call txl_error()
  62. else
  63. call head()
  64. call head_var("","")
  65. select case request("action")
  66. case "lock"
  67. if not canlocktopic then
  68. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  69. founderr=true
  70. else
  71. call lock()
  72. end if
  73. case "unlock"
  74. if not canlocktopic then
  75. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  76. founderr=true
  77. else
  78. call unlock()
  79. end if
  80. case "uptopic"
  81. if not canlocktopic then
  82. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  83. founderr=true
  84. else
  85. call uptopic()
  86. end if
  87. case "delet"
  88. if not candeltopic then
  89. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  90. founderr=true
  91. else
  92. call delete()
  93. end if
  94. case "istop"
  95. if not cantoptopic then
  96. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  97. founderr=true
  98. else
  99. call istop()
  100. end if
  101. case "notop"
  102. if not cantoptopic then
  103. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  104. founderr=true
  105. else
  106. call notop()
  107. end if
  108. case "dele"
  109. call dele()
  110. case "isbest"
  111. if not canbesttopic then
  112. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  113. founderr=true
  114. else
  115. call isbest()
  116. end if
  117. case "nobest"
  118. if not canbesttopic then
  119. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  120. founderr=true
  121. else
  122. call nobest()
  123. end if
  124. case "award"
  125. if not canawardtopic then
  126. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  127. founderr=true
  128. else
  129. call award()
  130. end if
  131. case "punish"
  132. if not canawardtopic then
  133. Errmsg=Errmsg+"<br><li>您没有执行此操作的权限。"
  134. founderr=true
  135. else
  136. call punish()
  137. end if
  138. case else
  139. call txl_error()
  140. end select
  141. if founderr then call txl_error()
  142. end if
  143. call foot()
  144. sub lock()
  145. sql="update topic set islock=1 where topicid="&id
  146. conn.Execute(sql)
  147. sucmsg=sucmsg+"<br>"+"<li>锁定帖子《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
  148. call txl_suc()
  149. end sub
  150. sub unlock()
  151. sql="update topic set islock=0 where topicid="&id
  152. conn.Execute(sql)
  153. sucmsg=sucmsg+"<br>"+"<li>解除锁定《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
  154. call txl_suc()
  155. end sub
  156. sub uptopic()
  157. sql="update topic set LastTime=Now() where topicid="&id
  158. conn.Execute(sql)
  159. sucmsg=sucmsg+"<br>"+"<li>提升主题《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
  160. call txl_suc()
  161. end sub
  162. sub istop()
  163. sql="update topic set istop=1 where topicid="&id
  164. conn.Execute(sql)
  165. sucmsg=sucmsg+"<br>"+"<li>固顶帖子《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
  166. call txl_suc()
  167. end sub
  168. sub notop()
  169. sql="update topic set istop=0 where topicid="&id
  170. conn.Execute(sql)
  171. sucmsg=sucmsg+"<br>"+"<li>解除固顶《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
  172. call txl_suc()
  173. end sub
  174. sub isbest()
  175. set rs=conn.execute("select * from bbs where bbsid="&cstr(replyid))
  176. if rs.eof and rs.bof then
  177. Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
  178. founderr=true
  179. exit sub
  180. end if
  181. topic=rs("title")
  182. topicusername=rs("postuser")
  183. topicuserid=rs("postuserid")
  184. sql="update bbs set isbest=1 where bbsid="&cstr(replyid)
  185. conn.Execute(sql)
  186. conn.execute("update topic set isbest=1 where topicid="&id)
  187. conn.execute("update [user] set usermoney=usermoney+"&txl_user(5)&" where userid="&topicuserid)
  188. sucmsg=sucmsg+"<br>"+"<li>加入精华《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
  189. call txl_suc()
  190. end sub
  191. sub nobest()
  192. sql="update bbs set isbest=0 where bbsid="&cstr(replyid)
  193. conn.Execute(sql)
  194. conn.execute("update topic set isbest=0 where topicid="&id)
  195. sucmsg=sucmsg+"<br>"+"<li>解除精华《"&topic&"》成功。</li><li>请慎重使用论坛的管理职能。"
  196. call txl_suc()
  197. end sub
  198. sub award()
  199. conn.execute("update [user] set usermoney=usermoney+"&txl_user(12)&" where userid="&TopicUserID)
  200. sucmsg=sucmsg+"<br>"+"<li>奖励帖子《"&topic&"》成功,并奖励用户财产+"&txl_user(12)&"</li><li>请慎重使用论坛的管理职能。"
  201. call txl_suc()
  202. end sub
  203. sub punish()
  204. conn.execute("update [user] set usermoney=usermoney-"&txl_user(12)&" where userid="&TopicUserID)
  205. sucmsg=sucmsg+"<br>"+"<li>惩罚帖子《"&topic&"》成功,并惩罚用户财产-"&txl_user(12)&"</li><li>请慎重使用论坛的管理职能。"
  206. call txl_suc()
  207. end sub
  208. sub delete()
  209. conn.execute("delete from topic where topicid="&id)
  210. conn.execute("delete from bbs where rootid="&id)
  211. conn.execute("update [user] set usermoney=usermoney-"&txl_user(4)&" where userid="&topicuserid)
  212. sucmsg=sucmsg+"<br>"+"<li>删除帖子《"&topic&"》成功,并删除了其所有回帖</li><li>请慎重使用论坛的管理职能。"
  213. call txl_suc()
  214. end sub
  215. sub dele()
  216. set rs=conn.execute("select * from bbs where bbsid="&cstr(replyid))
  217. if rs.eof and rs.bof then
  218. Errmsg=Errmsg+"<br><li>没有找到相关帖子!"
  219. founderr=true
  220. exit sub
  221. end if
  222. topic=rs("title")
  223. topicusername=rs("postuser")
  224. topicuserid=rs("postuserid")
  225. conn.execute("delete from bbs where bbsid="&cstr(replyid))
  226. conn.execute("update [user] set usermoney=usermoney-"&txl_user(4)&" where userid="&topicuserid)
  227. sucmsg=sucmsg+"<br>"+"<li>删除跟帖《"&topic&"》成功.</li><li>请慎重使用论坛的管理职能。"
  228. call txl_suc()
  229. end sub
  230. %>