⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad_infomodify.asp

📁 该软件是帮助大学生更好的生活
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@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="ad_ChkPurview.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="inc/ad_code_info.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="ad_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()
{
  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>6553600)
  {
    alert("文章内容太长,超出了ACCESS数据库的限制(6400K)!建议将文章分成几部分录入。");
	editor.HtmlEdit.focus();
	return false;
  }
  return true;  
}
</script>
</head>
<body leftmargin="5" topmargin="10">
<form method="POST" name="myform" onSubmit="return CheckForm();" action="ad_infoSave.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>
          </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 + -