From 1380f8eed4015a2759f9f49e9c90145c464ecd0c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 18 Jan 2009 15:36:50 +0100 Subject: allow adding/removing labels from frontend --- modules/pref-labels.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'modules/pref-labels.php') diff --git a/modules/pref-labels.php b/modules/pref-labels.php index 797d2de3f..c645b12a1 100644 --- a/modules/pref-labels.php +++ b/modules/pref-labels.php @@ -50,30 +50,10 @@ $ids = split(",", db_escape_string($_GET["ids"])); - db_query($link, "BEGIN"); - foreach ($ids as $id) { - $result = db_query($link, "SELECT caption FROM ttrss_labels2 - WHERE id = '$id'"); - - $caption = db_fetch_result($result, 0, "caption"); - - $result = db_query($link, "DELETE FROM ttrss_labels2 WHERE id = '$id' - AND owner_uid = " . $_SESSION["uid"]); - - if (db_affected_rows($link, $result) != 0 && $caption) { - - /* Disable filters that reference label being removed */ - - db_query($link, "UPDATE ttrss_filters SET - enabled = false WHERE action_param = '$caption' - AND action_id = 7 - AND owner_uid = " . $_SESSION["uid"]); - } + label_remove($link, $id, $_SESSION["uid"]); } - db_query($link, "COMMIT"); - } if ($subop == "add") { -- cgit v1.2.3