From 12bf118b6210815adb0f1d39082f8dcf905bc6d3 Mon Sep 17 00:00:00 2001 From: Git Date: Sun, 11 Mar 2012 08:00:18 +0000 Subject: [PATCH] Empty commit --- sections/bookmarks/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sections/bookmarks/index.php b/sections/bookmarks/index.php index 435c1f3e..92d4c7b5 100644 --- a/sections/bookmarks/index.php +++ b/sections/bookmarks/index.php @@ -18,7 +18,9 @@ case 'remove_snatched': authorize(); - $DB->query("DELETE b FROM bookmarks_torrents AS b WHERE b.UserID='".$LoggedUser['ID']."' AND b.GroupID IN(SELECT DISTINCT t.GroupID FROM torrents AS t INNER JOIN xbt_snatched AS s ON s.fid=t.ID AND s.uid='".$LoggedUser['ID']."')"); + $DB->query("CREATE TEMPORARY TABLE snatched_groups_temp (GroupID int PRIMARY KEY)"); + $DB->query("INSERT INTO snatched_groups_temp SELECT DISTINCT GroupID FROM torrents AS t JOIN xbt_snatched AS s ON s.fid=t.ID WHERE s.uid='$LoggedUser[ID]'"); + $DB->query("DELETE b FROM bookmarks_torrents AS b JOIN snatched_groups_temp AS s USING(GroupID) WHERE b.UserID='$LoggedUser[ID]'"); $Cache->delete_value('bookmarks_torrent_'.$UserID); $Cache->delete_value('bookmarks_torrent_'.$UserID.'_full'); header('Location: bookmarks.php');