?? admin_articlemodify.asp
字號:
<%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
Const PurviewLevel=2
Const CheckChannelID=2
Const PurviewLevel_Article=3
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="Admin_ChkPurview.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="inc/admin_code_article.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
founderr=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")=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 & "<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,"|"))
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
%>
<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 AddItem(strFileName){
document.myform.IncludePic.checked=true;
document.myform.DefaultPicUrl.value=strFileName;
document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
document.myform.DefaultPicList.selectedIndex+=1;
if(document.myform.UploadFiles.value==''){
document.myform.UploadFiles.value=strFileName;
}
else{
document.myform.UploadFiles.value=document.myform.UploadFiles.value+"|"+strFileName;
}
}
function selectPaginationType()
{
document.myform.PaginationType.selectedIndex=2;
}
function CheckForm()
{
var CurrentMode=editor.CurrentMode;
if (CurrentMode==0){
document.myform.Content.value=editor.HtmlEdit.document.body.innerHTML;
}
else if(CurrentMode==1){
document.myform.Content.value=editor.HtmlEdit.document.body.innerText;
}
else
{
alert("預覽狀態不能保存!請先回到編輯狀態后再保存");
editor.HtmlEdit.focus();
return false;
}
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>65536)
{
alert("文章內容太長,超出了ACCESS數據庫的限制(64K)!建議將文章分成幾部分錄入。");
editor.HtmlEdit.focus();
return false;
}
return true;
}
</script>
</head>
<body leftmargin="5" topmargin="10">
<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>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%
if AdminPurview=1 or AdminPurview_Article<=2 then
response.write "<select name='ClassID'>"
call Admin_ShowClass_Option(3,rsArticle("ClassID"))
response.write "</select></td><td>"
response.write "<font color='#FF0000'><strong>注意:</strong></font><font color='#0000FF'>1、不能指定為含有子欄目的欄目,或者外部欄目"
else
call Admin_ShowPath2(ParentPath,ClassName,Depth)
response.write "<input type='hidden' name='ClassID' value='" & rsArticle("ClassID") & "'>"
end if
%>
</td>
</tr>
</table>
</td>
</tr>
<tr class="tdbg">
<td width="100" align="right"><strong>所屬專題:</strong></td>
<td>
<%
if AdminPurview=1 or AdminPurview_Article<=2 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>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -