diff options
author | Andrew Dolgov <[email protected]> | 2010-06-29 14:26:10 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-06-29 14:26:10 +0400 |
commit | e955834551d3ef496bd05c76826363d40b730ea4 (patch) | |
tree | 689b523cfcad597d51d5c3c350b42683806c000a /opml.php | |
parent | 50e7dd7d01de742006ebbac9322bc775d0f564a3 (diff) |
support import and export of tt-rss preferences in OPML with DOMDocument OPML path
Diffstat (limited to 'opml.php')
-rw-r--r-- | opml.php | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; print "<opml version=\"1.0\">"; @@ -88,6 +92,26 @@ print "</outline>\n"; } + # export tt-rss settings + + print "<outline title=\"tt-rss-prefs\" schema-version=\"".SCHEMA_VERSION."\">"; + + $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 "<outline pref-name=\"$name\" value=\"$value\">"; + + print "</outline>"; + + } + + print "</outline>"; + print "</body></opml>"; } @@ -125,10 +149,13 @@ login_sequence($link); $owner_uid = $_SESSION["uid"]; + header('Content-Type: text/html; charset=utf-8'); + print "<html> <head> <link rel=\"stylesheet\" href=\"utility.css\" type=\"text/css\"> <title>".__("OPML Utility")."</title> + <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/> </head> <body> <div class=\"floatingLogo\"><img src=\"images/ttrss_logo.png\"></div> |