<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% option explicit response.buffer=true Const PurviewLevel=2 Const CheckChannelID=2 Const PurviewLevel_Article=2 %> <% dim ArticleID,ClassID,TargetClassID,SpecialID dim Action,FoundErr,ErrMsg dim SkinID,LayoutID,SkinCount,LayoutCount,ClassMaster,BrowsePurview,AddPurview dim strComeUrl if trim(request("strComeUrl"))="" then strComeUrl=Request.ServerVariables("HTTP_REFERER") else strComeUrl=trim(request("strComeUrl")) end if ArticleID=trim(request("ArticleID")) TargetClassID=trim(request("TargetClassID")) SpecialID=trim(request("SpecialID")) Action=Trim(Request("Action")) if Action="MoveToClass" then call MoveToClass() elseif Action="MoveToSpecial" then call MoveToSpecial() elseif Action="Move" then call MoveArticle() else call main() end if if FoundErr=True then call WriteErrMsg() end if call CloseConn() sub main() if ArticleID="" then FoundErr=True ErrMsg=ErrMsg & "
  • 请选择要移动的文章!
  • " exit sub else ArticleID=CLng(ArticleID) end if dim sqlArticle,rsArticle dim Title,ClassName,ParentPath,Depth sqlArticle="select Article.ClassID,Article.Title,ArticleClass.ClassName,ArticleClass.ParentPath,ArticleClass.Depth,Article.SpecialID from Article" sqlArticle=sqlArticle & " inner join ArticleClass on Article.ClassID=ArticleClass.ClassID where Article.ArticleID=" & ArticleID set rsArticle=Server.CreateObject("ADODB.Recordset") rsArticle.open sqlArticle,conn,1,1 if rsArticle.bof and rsArticle.eof then FoundErr=True ErrMsg=ErrMsg & "
  • 找不到要移到的文章
  • " else ClassID=rsArticle(0) Title=rsArticle(1) ClassName=rsArticle(2) ParentPath=rsArticle(3) Depth=rsArticle(4) SpecialID=rsArticle(5) %> 文章移动
    文 章 移 动
    所属栏目: <%call Admin_ShowPath2(ParentPath,ClassName,Depth)%>
    所属专题: <%call Admin_ShowSpecial_Option(1,SpecialID)%>
    文章标题: <%=Title%>
    移动到:
    不能指定为含有子栏目的栏目
    不能指定为外部栏目
     
    <% end if rsArticle.close set rsArticle=nothing end sub sub MoveArticle() dim tClass if ArticleID="" then FoundErr=True ErrMsg=ErrMsg & "
  • 请选择要移动的文章!
  • " end if if TargetClassID="" then FoundErr=True ErrMsg=ErrMsg & "
  • 请指定目标栏目!
  • " else TargetClassID=CLng(TargetClassID) set tClass=conn.execute("select Child from ArticleClass where ClassID=" & TargetClassID) if tClass.bof and tClass.eof then FoundErr=True ErrMsg=ErrMsg & "
  • 找不到指定的目标栏目!
  • " else if tClass(0)>0 then FoundErr=True ErrMsg=ErrMsg & "
  • 不能将文章移到有子栏目的栏目中!
  • " end if end if end if if FoundErr=True then exit sub if SpecialID="" then SpecialID=0 else SpecialID=Clng(SpecialID) end if ArticleID=replace(ArticleID," ","") conn.execute("update Article set ClassID=" & TargetClassID & ",SpecialID=" & SpecialID & ",Passed=False where ArticleId in (" & ArticleID & ")") conn.execute("update ArticleComment set ClassID=" & TargetClassID & " where ArticleId in (" & ArticleID & ")") call CloseConn() response.Redirect strComeUrl end sub sub MoveToClass() dim tClass if ArticleID="" then FoundErr=True ErrMsg=ErrMsg & "
  • 请选择要移动的文章!
  • " end if if TargetClassID="" then FoundErr=True ErrMsg=ErrMsg & "
  • 请指定目标栏目!
  • " else TargetClassID=CLng(TargetClassID) set tClass=conn.execute("select Child from ArticleClass where ClassID=" & TargetClassID) if tClass.bof and tClass.eof then FoundErr=True ErrMsg=ErrMsg & "
  • 找不到指定的目标栏目!
  • " else if tClass(0)>0 then FoundErr=True ErrMsg=ErrMsg & "
  • 不能将文章移到有子栏目的栏目中!
  • " end if end if end if if FoundErr=True then exit sub ArticleID=replace(ArticleID," ","") conn.execute("update Article set ClassID=" & TargetClassID & " where ArticleId in (" & ArticleID & ")") conn.execute("update ArticleComment set ClassID=" & TargetClassID & " where ArticleId in (" & ArticleID & ")") call CloseConn() response.Redirect strComeUrl end sub sub MoveToSpecial() if SpecialID="" then FoundErr=True ErrMsg=ErrMsg & "
  • 请指定目标专题!
  • " exit sub else SpecialID=CLng(SpecialID) end if ArticleID=replace(ArticleID," ","") conn.execute("update Article set SpecialID=" & SpecialID & " where ArticleID in (" & ArticleID & ")") call CloseConn() response.Redirect strComeUrl end sub %>