📄 manage.asp
字号:
<%response.buffer=true%>
<!--#include file="conn.asp"-->
<!--#include file="const.asp"-->
<!--#include file="char.asp"-->
<!--#include file="function.asp"-->
<%
set rs=server.createobject("adodb.recordset")
sql="select boardmaster from board"
rs.open sql,conn,1,1
do while not rs.eof
boardmaster=boardmaster+rs("boardmaster")
rs.movenext
loop
rs.close
if (instr(boardmaster,Request.Cookies("bookbaby")("username"))>0 and Request.Cookies("bookbaby")("username")<>"") or session("IsAdmin")="club" then
act=request("act")
boardid=request("boardid")
if request("action")<>"bbs" and request("action")<>"reply" then
errmsg="<li>操作错误!"
call error()
response.end
else
action=request("action")
end if
if request("id")="" and request("act")<>"announceadd" then
errmsg="<li>请选择要操作的帖子!"
call error()
response.end
else
id=request("id")
end if
if Request("act")="announceadd" or Request("act")="announceedit" then
if trim(Request.Form("title"))="" then
errmsg="<li>公告主题不能为空"
call error()
Response.End
else
title=htmlencode(Request.Form("title"))
end if
if trim(Request.Form("content"))="" then
errmsg="<li>公告内容不能为空"
call error()
Response.End
else
content=htmlencode(Request.Form("content"))
end if
end if
select case (act)
case "del" call del()
case "best" call best()
case "top" call top()
case "nodel" call nodel()
case "nobest" call nobest()
case "notop" call notop()
case "announceadd" call announceadd()
case "announceedit" call announceedit()
case "announcedel" call announcedel()
case else
errmsg="<li>参数错误!"
call error()
response.end
end select
response.redirect "success.asp?act=edit&boardid="&boardid
else
errmsg="<li>您没有操作的权限"
call error
end if
set rs=nothing
set conn=nothing
'sub del()
'conn.execute "update "&action&" set del=true where "&action&"id="&id
'if action="bbs" then conn.execute "update reply set del=true where "&action&"id="&id
'end sub
sub del()
conn.execute "delete * from "&action&" where "&action&"id="&id
if action="bbs" then conn.execute "delete * from reply where "&action&"id="&id
end sub
sub best()
dim best
best=101
conn.execute "update bbs set best=true where bbsid="&id
conn.execute "update bbs set face="&best&" where bbsid="&id
end sub
sub top()
sql="select count(istop) from bbs where istop=true and boardid="&boardid
rs.open sql,conn,1,1
if rs(0)>=10 and not rs.eof then
response.write "<script>javascript:alert('该论坛固顶数目已满,请整理部分后再来进行此操作');window.close();</script>"
response.end
else
dim top
top=100
conn.execute "update bbs set istop=true where bbsid="&id
conn.execute "update bbs set face="&top&" where bbsid="&id
end if
rs.close
end sub
sub nodel()
conn.execute "update "&action&" set del=false where "&action&"id="&id
if action="bbs" then conn.execute "update reply set del=false where "&action&"id="&id
end sub
sub nobest()
dim nobest
nobest=1
conn.execute "update bbs set best=false where bbsid="&id
conn.execute "update bbs set face="&nobest&" where bbsid="&id
end sub
sub notop()
dim notop
notop=1
conn.execute "update bbs set istop=false where bbsid="&id
conn.execute "update bbs set face="¬op&" where bbsid="&id
end sub
sub announceadd()
sql="select * from announce where id is null"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("content")=content
rs("boardid")=request("boardid")
rs("username")=Request.Cookies("bookbaby")("username")
rs("dateandtime")=now()
rs.update
rs.close
end sub
sub announceedit()
sql="select title,content from announce where id="&id
rs.open sql,conn,1,3
rs("title")=title
rs("content")=content
rs.update
rs.close
end sub
sub announcedel()
conn.execute "delete * from announce where id="&id
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -