From e955834551d3ef496bd05c76826363d40b730ea4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 29 Jun 2010 14:26:10 +0400 Subject: support import and export of tt-rss preferences in OPML with DOMDocument OPML path --- opml.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'opml.php') diff --git a/opml.php b/opml.php index d808c8f9e..d3a352fa2 100644 --- a/opml.php +++ b/opml.php @@ -13,7 +13,11 @@ init_connection($link); function opml_export($link, $owner_uid, $hide_private_feeds=False) { - header("Content-type: application/xml+opml"); + if (!$_REQUEST["debug"]) { + header("Content-type: application/xml+opml"); + } else { + header("Content-type: text/xml"); + } print ""; print ""; @@ -88,6 +92,26 @@ print "\n"; } + # export tt-rss settings + + print ""; + + $result = db_query($link, "SELECT pref_name, value FROM ttrss_user_prefs WHERE + profile IS NULL AND owner_uid = " . $_SESSION["uid"]); + + while ($line = db_fetch_assoc($result)) { + + $name = $line["pref_name"]; + $value = htmlspecialchars($line["value"]); + + print ""; + + print ""; + + } + + print ""; + print ""; } @@ -125,10 +149,13 @@ login_sequence($link); $owner_uid = $_SESSION["uid"]; + header('Content-Type: text/html; charset=utf-8'); + print " ".__("OPML Utility")." +
-- cgit v1.2.3-54-g00ecf