?? editannounce.asp
字號:
<!--#include file="conn.asp"-->
<!-- #include file="inc/char.asp" -->
<!-- #include file="inc/const.asp" -->
<!--#include file="inc/form2.asp"-->
<!--#include file="inc/theme.asp"-->
<!-- #include file="chkuser.asp" -->
<%
dim AnnounceID
dim RootID
dim BoardID
dim username
dim rs
dim sql
dim rsBoard
dim boardsql,sel
dim old_user
dim con,content
dim topic
dim olduser,oldpass
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")
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
AnnounceID=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
if membername="" then
Errmsg=Errmsg+"<br>"+"<li>您沒有<a href=login.asp>登錄</a>,沒有權限編輯貼子!"
founderr=true
end if
if founderr then
call nav()
call headline(2)
call error()
else
stats=boardtype & "編輯帖子"
call nav()
call headline(2)
call edit()
if founderr then
call error()
else
call showeditForm()
end if
end if
sub edit()
set rs=server.createobject("adodb.recordset")
set rs_old = server.CreateObject ("adodb.recordset")
sql="select bbs1.username,bbs1.topic,bbs1.body,[user].userclass from bbs1,[user] where bbs1.username=[user].username and bbs1.AnnounceID="&AnnounceID
rs.open sql,conn,1,1
if rs.eof and rs.bof then
Errmsg=Errmsg+"<br>"+"<li>沒有找到相應的帖子。"
Founderr=true
else
topic=rs("topic")
con=rs("body")
old_user=rs("username")
if rs("username")<>Trim(membername) then
if chkboardmaster(boardid)=false then
Errmsg=Errmsg+"<br>"+"<li>版主只能編輯所在版面帖子。"
Founderr=true
elseif boardmaster and cint(rs("userclass"))=19 then
Errmsg=Errmsg+"<br>"+"<li>同等級用戶不能修改。"
Founderr=true
elseif master and cint(rs("userclass"))=20 then
Errmsg=Errmsg+"<br>"+"<li>同等級用戶不能修改。"
Founderr=true
elseif boardmaster and cint(rs("userclass"))=20 then
Errmsg=Errmsg+"<br>"+"<li>不能修改等級比你高的用戶貼子。"
Founderr=true
elseif not (boardmaster or master) then
Errmsg=Errmsg+"<br>"+"<li>您的等級不足以修改別人的貼子。"
Founderr=true
end if
end if
end if
rs.Close
set rs=nothing
end sub
call endline()
%>
<!--#include file="footer.asp"-->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -