summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-12-28 19:34:05 +0300
committerAndrew Dolgov <[email protected]>2009-12-28 19:34:05 +0300
commit8056ec5011775d1751660ba956f166b28378d073 (patch)
tree146637209755aadcee766a78dd74844cb288a8e0 /functions.php
parent16fdac16c0bc21a6c3acac50faf2851ab63441d7 (diff)
properly initialize archived_feed info when removing feed
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index e8682ca37..de35b3274 100644
--- a/functions.php
+++ b/functions.php
@@ -6376,6 +6376,18 @@
db_query($link, "BEGIN");
+ /* prepare feed if necessary */
+
+ $result = db_query($link, "SELECT id FROM ttrss_archived_feeds
+ WHERE id = '$id'");
+
+ if (db_num_rows($result) == 0) {
+ db_query($link, "INSERT INTO ttrss_archived_feeds
+ (id, owner_uid, title, feed_url, site_url)
+ SELECT id, owner_uid, title, feed_url, site_url from ttrss_feeds
+ WHERE id = '$id'");
+ }
+
db_query($link, "UPDATE ttrss_user_entries SET feed_id = NULL
WHERE feed_id = '$id' AND
marked = true AND owner_uid = $owner_uid");