diff options
author | Andrew Dolgov <[email protected]> | 2009-01-18 15:36:50 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2009-01-18 15:36:50 +0100 |
commit | 1380f8eed4015a2759f9f49e9c90145c464ecd0c (patch) | |
tree | 9d06a0c84920ea6491cb04953ecd904d23dae48d /functions.php | |
parent | b2531a28a63fe23ddb0d0c518f8405d4d5e4eb25 (diff) |
allow adding/removing labels from frontend
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/functions.php b/functions.php index 5bcfa3e35..1d5210677 100644 --- a/functions.php +++ b/functions.php @@ -6102,4 +6102,29 @@ (label_id, article_id) VALUES ('$label_id', '$id')"); } } + + function label_remove($link, $id, $owner_uid) { + + db_query($link, "BEGIN"); + + $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"]); + } + + db_query($link, "COMMIT"); + } ?> |