summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-18 15:36:50 +0100
committerAndrew Dolgov <[email protected]>2009-01-18 15:36:50 +0100
commit1380f8eed4015a2759f9f49e9c90145c464ecd0c (patch)
tree9d06a0c84920ea6491cb04953ecd904d23dae48d /modules
parentb2531a28a63fe23ddb0d0c518f8405d4d5e4eb25 (diff)
allow adding/removing labels from frontend
Diffstat (limited to 'modules')
-rw-r--r--modules/pref-feeds.php2
-rw-r--r--modules/pref-labels.php22
2 files changed, 3 insertions, 21 deletions
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php
index ee4e4d1f8..8b715e48f 100644
--- a/modules/pref-feeds.php
+++ b/modules/pref-feeds.php
@@ -717,6 +717,8 @@
if (file_exists($icons_dir . "/$id.ico")) {
unlink($icons_dir . "/$id.ico");
}
+ } else {
+ label_remove($link, -11-$id, $_SESSION["uid"]);
}
}
}
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") {