?? 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 + -