📄 admin_articlemodify.asp
字号:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=5 '操作权限
%>
<!--#include file="Admin_ChkPurview.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/admin_code.asp"-->
<%
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 & "<br><li>请指定要修改的文章ID</li>"
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 & "<br><li>找不到文章</li>"
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
FounErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的栏目</li>"
else
ClassName=tClass(0)
RootID=tClass(1)
ParentID=tClass(2)
Depth=tClass(3)
ParentPath=tClass(4)
ClassMaster=tClass(5)
end if
if rsArticle("Editor")=session("Admin") then
PurviewChecked=True
else
if rsArticle("Editor")=session("admin") then
PurviewChecked=True
else
if session("purview")<=3 then
PurviewChecked=True
elseif session("purview")>=5 then
PurviewChecked=False
else
if ParentID>0 then
set tClass=conn.execute("select ClassMaster from ArticleClass where ClassID in (" & ParentPath & ")")
do while not tClass.eof
if tClass(0)<>"" then
if ClassMaster="" then
ClassMaster=tClass(0)
else
ClassMaster=ClassMaster & "|" & tClass(0)
end if
end if
tClass.movenext
loop
end if
PurviewChecked=CheckClassPurview(ClassMaster,session("Admin"))
end if
end if
if PurviewChecked=False then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>对不起,您的权限不够,不能修改此文!</li>"
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,"|")-1)
else
AuthorName=Author
AuthorEmail=""
end if
if instr(CopyFrom,"|")>0 then
CopyFromName=left(CopyFrom,instr(CopyFrom,"|")-1)
CopyFromUrl=right(CopyFrom,len(CopyFrom)-instr(CopyFrom,"|")-1)
else
CopyFromName=CopyFrom
CopyFromUrl=""
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改文章</title>
<link rel="stylesheet" type="text/css" href="Admin_Style.css">
<script language = "JavaScript">
function CheckForm()
{
if (editor.EditMode.checked==true)
document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
else
document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML;
if (document.myform.Title.value=="")
{
alert("文章标题不能为空!");
document.myform.Title.focus();
return false;
}
if (document.myform.Key.value=="")
{
alert("关键字不能为空!");
document.myform.Key.focus();
return false;
}
if (document.myform.Content.value=="")
{
alert("文章内容不能为空!");
editor.HtmlEdit.focus();
return false;
}
if (document.myform.Content.value.length>64000)
{
alert("文章内容太长,超出了ACCESS数据库的限制(64K)!建议将文章分成几部分录入。");
editor.HtmlEdit.focus();
return false;
}
return true;
}
function loadForm()
{
editor.HtmlEdit.document.body.innerHTML=document.myform.Content.value;
return true
}
</script>
</head>
<body leftmargin="5" topmargin="10" onLoad="javascipt:setTimeout('loadForm()',2000);">
<form method="POST" name="myform" onSubmit="return CheckForm();" action="Admin_ArticleSave.asp?action=Modify">
<table border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr class="title">
<td height="22" align="center"><b>修 改 文 章</b></td>
</tr>
<tr align="center">
<td>
<table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr class="tdbg">
<td width="100" align="right"><strong>所属栏目:</strong></td>
<td>
<%
if session("purview")<=3 then
response.write "<select name='ClassID'>"
call Admin_ShowClass_Option(3,rsArticle("ClassID"))
response.write "</select> <font color='#FF0000'>*</font> <font color='#0000FF'>不能指定为含有子栏目的栏目</font>"
else
call Admin_ShowPath2(ParentPath,ClassName,Depth)
response.write "<input type='hidden' name='ClassID' value='" & rsArticle("ClassID") & "'>"
end if
%>
</td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>所属专题:</strong></td>
<td>
<%
if session("purview")<=3 then
call Admin_ShowSpecial_Option(1,rsArticle("SpecialID"))
else
if rsArticle("SpecialID")>0 then
dim rsSpecial
set rsSpecial=conn.execute("select * from Special where SpecialID=" & rsArticle("SpecialID"))
if rsSpecial.bof and rsSpecial.eof then
response.write "找不到所属专题!可能所属专题已经被删除!"
else
response.write rsSpecial("SpecialName")
end if
set rsSpecial=nothing
end if
response.write "<input type='hidden' name='SpecialID' value='" & rsArticle("SpecialID") & "'>"
end if%>
</td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>文章标题:</strong></td>
<td><input name="Title" type="text"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -