From 7d926cfcf216ef2ecfb852eda0f1df7e2b1eb8c1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 27 Dec 2011 16:52:36 +0400 Subject: [PATCH] support export of filters using OPML --- opml.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/opml.php b/opml.php index 6e5a4996..e8ae163a 100644 --- a/opml.php +++ b/opml.php @@ -303,6 +303,40 @@ } + print ""; + + print ""; + + $result = db_query($link, "SELECT filter_type, + reg_exp, + action_id, + enabled, + action_param, + inverse, + filter_param, + cat_filter, + ttrss_feeds.title AS feed_title, + ttrss_feed_categories.title AS cat_title + FROM ttrss_filters + LEFT JOIN ttrss_feeds ON (feed_id = ttrss_feeds.id) + LEFT JOIN ttrss_feed_categories ON (ttrss_filters.cat_id = ttrss_feed_categories.id) + WHERE + ttrss_filters.owner_uid = " . $_SESSION['uid']); + + while ($line = db_fetch_assoc($result)) { + $name = htmlspecialchars($line['reg_exp']); + + foreach (array('enabled', 'inverse', 'cat_filter') as $b) { + $line[$b] = sql_bool_to_bool($line[$b]); + } + + $filter = json_encode($line); + + print "$filter"; + + } + + print ""; } -- 2.39.5