# HG changeset patch # User Matti Hamalainen # Date 1447959299 -7200 # Node ID 3a8c016c50fcb3f29e4311982e0d434a5d9bfb5a # Parent 35a00a986f7951cfa6c310903d9ecc7d95ddd4b9 Mark related files to be deleted when deleting an entry. diff -r 35a00a986f79 -r 3a8c016c50fc admajax.php --- a/admajax.php Thu Nov 19 20:11:30 2015 +0200 +++ b/admajax.php Thu Nov 19 20:54:59 2015 +0200 @@ -1669,6 +1669,10 @@ $sql = stPrepareSQL("DELETE FROM votes WHERE entry_id=%d", $id); stExecSQLCond($sql, "OK, entry ".$id." votes deleted."); + + // Mark files to be deleted + $sql = stPrepareSQL("UPDATE files SET deleted=%d WHERE entry_id=%d", 1, $id); + stExecSQLCond($sql, "OK, entry ".$id." files marked."); } else if ($type == "compo")