summaryrefslogtreecommitdiff
path: root/opml.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-12-27 16:52:36 +0400
committerAndrew Dolgov <[email protected]>2011-12-27 16:52:36 +0400
commit7d926cfcf216ef2ecfb852eda0f1df7e2b1eb8c1 (patch)
tree2440a7a7a33d7b7a78e74ae1c57ce31ea71625ec /opml.php
parentbbefea90a7f05fd02398fe2deb1e9c7d234b5b82 (diff)
support export of filters using OPML
Diffstat (limited to 'opml.php')
-rw-r--r--opml.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/opml.php b/opml.php
index 6e5a49966..e8ae163a6 100644
--- a/opml.php
+++ b/opml.php
@@ -304,6 +304,40 @@
}
print "</outline>";
+
+ print "<outline title=\"tt-rss-filters\">";
+
+ $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 "<outline filter-name=\"$name\">$filter</outline>";
+
+ }
+
+
+ print "</outline>";
}
print "</body></opml>";