📄 article_del.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../../Conn.asp"-->
<!--#include file="../../SysCls/KS_CommonCls.asp"-->
<!--#include file="../Inc/Session.asp"-->
<%
'===================================================================================================================
'软件名称:科汛网站管理系统
'当前版本:科汛网站管理系统 V2.2 SP2 Free
'Copyright (C) 2006-2008 Kesion.Com All rights reserved.
'产品咨询QQ:9537636,41904294
'技术支持QQ:111394,54004407
'程序版权:科汛网络
'程序开发:科汛网络开发组(总策划:林文仲)
'E-Mail :kesioncms@hotmail.com webmaster@kesion.com
'官方网站:http://www.kesion.com
'演示站点:http://test.kesion.com
'郑重声明:
' ①、免费版本请在程序首页保留版权信息,并做上本站LOGO友情连接,商业版本无此要求;
' ②、任何个人或组织不得在授权允许的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息;
' ③、科汛网络保留此软件的法律追究权利
'===================================================================================================================
Dim KSCls
Set KSCls = New Article_Del
KSCls.Execute()
Set KSCls = Nothing
Class Article_Del
Private KSCMS
Private Sub Class_Initialize()
Set KSCMS=New CommonCls
End Sub
Private Sub Class_Terminate()
Call KSCMS.CloseConn()
Set KSCMS=Nothing
End Sub
'主体部分
Public Sub Execute()
Dim K, NewsID, CurrPath, ArticleDir, FolderID, Page, DisplayMode
Dim ArticleContentArr, TotalPage, I, CurrPathAndName, FExt, Fname
Dim KeyWord, SearchType, StartDate, EndDate
'收集搜索参数
KeyWord = Request.QueryString("KeyWord")
SearchType = Request.QueryString("SearchType")
StartDate = Request.QueryString("StartDate")
EndDate = Request.QueryString("EndDate")
Page = Trim(Request("Page"))
DisplayMode = Request.QueryString("DisplayMode")
NewsID = Trim(Request.QueryString("NewsID"))
NewsID = Split(NewsID, ",")
Dim RS
Set RS=Server.CreateObject("ADODB.Recordset")
For K = LBound(NewsID) To UBound(NewsID)
'删除评论
conn.Execute ("Delete From KS_Comment Where ChannelID=1 and InfoID='" & NewsID(K) & "'")
RS.Open "Select * FROM [KS_Article] Where NewsID='" & NewsID(K) & "'", conn, 1, 3
If RS.EOF And RS.BOF Then
Call KSCMS.AlertHistory("参数传递出错!", -1)
Set KSCMS = Nothing
Response.End
Else
FolderID = Trim(RS("Tid"))
If Not KSCMS.ReturnPowerResult(1, "KMA10014") Then '检查是否有删除文章的权限
Call KSCMS.ReturnErr(2, "Article_Main.asp?DisplayMode=" & DisplayMode & "&Page=" & DisplayMode & "&ID=" & FolderID)
Exit Sub
End If
FExt = Mid(Trim(RS("Fname")), InStrRev(Trim(RS("Fname")), ".")) '分离出扩展名
Fname = Replace(Trim(RS("Fname")), FExt, "") '分离出文件名 如 2005/9-10/1254ddd
'删除物理文件
Dim FolderRS
Set FolderRS=Server.CreateObject("ADODB.Recordset")
FolderRS.Open "Select Folder From [KS_Class] WHERE ID='" & FolderID & "'", conn, 1, 1
ArticleDir = KSCMS.GetConfig("ArticleDir")
If Left(ArticleDir, 1) = "/" Or Left(ArticleDir, 1) = "\" Then ArticleDir = Right(ArticleDir, Len(ArticleDir) - 1)
CurrPath = KSCMS.GetConfig("InstallDir") & ArticleDir & FolderRS("Folder")
ArticleContentArr = Split(RS("ArticleContent"), "[NextPage]")
TotalPage = UBound(ArticleContentArr) + 1
If TotalPage > 1 Then
For I = LBound(ArticleContentArr) To UBound(ArticleContentArr)
If I = 0 Then
CurrPathAndName = CurrPath & RS("Fname")
Else
CurrPathAndName = CurrPath & Fname & "_" & (I + 1) & FExt
End If
Call KSCMS.DeleteFile(CurrPathAndName)
Next
Else
CurrPathAndName = CurrPath & RS("Fname")
Call KSCMS.DeleteFile(CurrPathAndName)
End If
FolderRS.Close
End If
RS.Delete: RS.Close
Next
Set RS = Nothing
If KeyWord = "" Then
If KSCMS.GetConfig("ShowDetail") = 1 Then '判断是否左栏显示详细信息
Response.Write ("<script>location.href='Article_Main.asp?ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';parent.frames['LeftFrame'].LeftInfoFrame.location.href='Article_Left.asp?Type=0&ID=" & FolderID & "';</script>")
Else
Response.Write ("<script>location.href='Article_Main.asp?ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';</script>")
End If
Else
Response.Write ("<script>location.href='Article_Main.asp?KeyWord=" & KeyWord & "&SearchType=" & SearchType & "&StartDate=" & StartDate & "&EndDate=" & EndDate & "&ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';</script>")
End If
End Sub
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -