%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=2
Const PurviewLevel_Article=3
%>
<%
dim ArticleID,sql,rsArticle,FoundErr,ErrMsg,PurviewChecked
dim Author,AuthorName,AuthorEmail,CopyFrom,CopyFromName,CopyFromUrl
dim ClassID,tClass,ClassName,RootID,ParentID,Depth,ParentPath,ClassMaster
dim SkinID,LayoutID,SkinCount,LayoutCount,BrowsePurview,AddPurview
ArticleID=trim(request("ArticleID"))
FoundErr=False
PurviewChecked=False
if ArticleID="" then
FoundErr=True
ErrMsg=ErrMsg & "
请指定要修改的文章ID
"
call WriteErrMsg()
call CloseConn()
response.end
else
ArticleID=Clng(ArticleID)
end if
sql="select * from article where ArticleID=" & ArticleID & ""
Set rsArticle= Server.CreateObject("ADODB.Recordset")
rsArticle.open sql,conn,1,1
if rsArticle.bof and rsArticle.eof then
FoundErr=True
ErrMsg=ErrMsg & "
找不到文章
"
else
ClassID=rsArticle("ClassID")
set tClass=conn.execute("select ClassName,RootID,ParentID,Depth,ParentPath,ClassMaster From ArticleClass where ClassID=" & ClassID)
if tClass.bof and tClass.eof then
founderr=True
ErrMsg=ErrMsg & "
找不到指定的栏目
"
else
ClassName=tClass(0)
RootID=tClass(1)
ParentID=tClass(2)
Depth=tClass(3)
ParentPath=tClass(4)
ClassMaster=tClass(5)
end if
if rsArticle("Editor")=AdminName and rsArticle("Passed")=False then
PurviewChecked=True
else
if AdminPurview=1 or AdminPurview_Article<=2 then
PurviewChecked=True
else
PurviewChecked=CheckClassMaster(ClassMaster,AdminName)
if PurviewChecked=False and ParentID>0 then
set tClass=conn.execute("select ClassMaster from ArticleClass where ClassID in (" & ParentPath & ")")
do while not tClass.eof
PurviewChecked=CheckClassMaster(tClass(0),AdminName)
if PurviewChecked=True then exit do
tClass.movenext
loop
end if
end if
if PurviewChecked=False then
FoundErr=True
ErrMsg=ErrMsg & "
对不起,您的权限不够,不能修改此文!
"
end if
end if
end if
if FoundErr=True then
call WriteErrMsg()
else
Author=rsArticle("Author")
CopyFrom=rsarticle("CopyFrom")
if instr(Author,"|")>0 then
AuthorName=left(Author,instr(Author,"|")-1)
AuthorEmail=right(Author,len(Author)-instr(Author,"|"))
else
AuthorName=Author
AuthorEmail=""
end if
if instr(CopyFrom,"|")>0 then
CopyFromName=left(CopyFrom,instr(CopyFrom,"|")-1)
CopyFromUrl=right(CopyFrom,len(CopyFrom)-instr(CopyFrom,"|"))
else
CopyFromName=CopyFrom
CopyFromUrl=""
end if
%>
修改文章
<%
end if
rsArticle.close
set rsArticle=nothing
call CloseConn()
%>