📄 picture_del.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../../Conn.asp"-->
<!--#include file="../../SysCls/KS_CommonCls.asp"-->
<!--#include file="../../SysCls/KS_RefreshFunctionCls.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 Picture_Del
KSCls.Execute()
Set KSCls = Nothing
Class Picture_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, PicID, CurrPath, PicDir, FolderID, Page, DisplayMode
Dim PictureContentArr, TotalPage, I, CurrPathAndName, FExt, Fname
Dim KeyWord, SearchType, StartDate, EndDate
'收集搜索参数
KeyWord = KSCMS.G("KeyWord")
SearchType = KSCMS.G("SearchType")
StartDate = KSCMS.G("StartDate")
EndDate = KSCMS.G("EndDate")
Page = Trim(KSCMS.G("Page"))
DisplayMode = KSCMS.G("DisplayMode")
PicID = Trim(KSCMS.G("PicID"))
PicID = Split(PicID, ",")
Dim RS
Set RS=Server.CreateObject("ADODB.Recordset")
For K = LBound(PicID) To UBound(PicID)
'删除评论
conn.Execute ("Delete From KS_Comment Where ChannelID=2 and InfoID='" & PicID(K) & "'")
RS.Open "Select * FROM [KS_Photo] Where PicID='" & Trim(PicID(K)) & "'", conn, 1, 3
If RS.EOF And RS.BOF Then
Call KSCMS.AlertHistory("参数传递出错!", -1)
Set KSCMS = Nothing
Exit Sub
Else
FolderID = Trim(RS("Tid"))
If Not KSCMS.ReturnPowerResult(2, "KMP10014") Then '检查是否有删除图片的权限
Call KSCMS.ReturnErr(2, "Picture_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
PicDir = KSCMS.GetConfig("PicDir")
If Left(PicDir, 1) = "/" Or Left(PicDir, 1) = "\" Then PicDir = Right(PicDir, Len(PicDir) - 1)
CurrPath = KSCMS.GetConfig("InstallDir") & PicDir & FolderRS("Folder")
PictureContentArr = Split(RS("PicUrls"), "|||")
TotalPage = UBound(PictureContentArr) + 1
If TotalPage > 1 Then
For I = LBound(PictureContentArr) To UBound(PictureContentArr)
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='Picture_Main.asp?ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';parent.frames['LeftFrame'].LeftInfoFrame.location.href='Picture_Left.asp?Type=0&ID=" & FolderID & "';</script>")
Else
Response.Write ("<script>location.href='Picture_Main.asp?ID=" & FolderID & "&DisplayMode=" & DisplayMode & "&Page=" & Page & "';</script>")
End If
Else
Response.Write ("<script>location.href='Picture_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 + -