% 'dBlog 2.0 CMS Open Source 'Versione file 2.0.0 %> <% Dim SQLFotografia, RSFotografia, SQLCommenti, RSCommenti, SQLSezioneFotografie, RSSezioneFotografie, FilSezioneFotografie, SezioneFotografie, FID, NomeFile, FSO If Request.QueryString("id") <> "" AND Request.QueryString("id") <> "0" AND IsNumeric(Request.QueryString("id")) = True Then FID = Request.QueryString("id") Else FID = 0 End If SQLRecuperaNome = " SELECT NomeFile FROM [Fotografie] WHERE [ID] = "& cInt(FID) &"" If Session("BLOGAdmin") = False Then SQLRecuperaNome = SQLRecuperaNome & " AND [Autore] = '"& Session("BLOGNick") &"' " End If Set RSRecuperaNome = Server.CreateObject("ADODB.Recordset") RSRecuperaNome.Open SQLRecuperaNome, Conn, 1, 3 If NOT RSRecuperaNome.EOF Then RSRecuperaNome.MoveFirst NomeFile = RSRecuperaNome("NomeFile") Else NomeFile = "" End If Set RSRecuperaNome = Nothing SQLFotografia = " DELETE * FROM [Fotografie] WHERE [ID] = "& cInt(FID) &"" If Session("BLOGAdmin") = False Then SQLFotografia = SQLFotografia & " AND [Autore] = '"& Session("BLOGNick") &"' " End If Set RSFotografia = Server.CreateObject("ADODB.Recordset") RSFotografia.Open SQLFotografia, Conn, 1, 3 SQLCommenti = " DELETE * FROM [Commenti] WHERE [IDFotografia] = "& cInt(FID) &" " Set RSCommenti = Server.CreateObject("ADODB.Recordset") RSCommenti.Open SQLCommenti, Conn, 1, 3 If NomeFile <> "" Then Set FSO = CreateObject("Scripting.FileSystemObject") If FSO.FileExists(Server.MapPath(Path_DirPublic & NomeFile)) Then FSO.DeleteFile(Server.MapPath(Path_DirPublic & NomeFile)) End If If FSO.FileExists(Server.MapPath(Path_DirPublic & "T-" & NomeFile)) Then FSO.DeleteFile(Server.MapPath(Path_DirPublic & "T-" & NomeFile)) End If Set FSO = Nothing End If %>
|