X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=opml.php;h=709cfd4ccb79fbffc9e23ad10f14f243255d4e51;hb=404e2e3603c852a3f82a21c14b8888005e2b3f99;hp=f29b19023758597f8d888e56bf17fc870aa66fc1;hpb=9f311df6262c206a56f47a593244336e6ba1f54c;p=tt-rss.git
diff --git a/opml.php b/opml.php
index f29b1902..709cfd4c 100644
--- a/opml.php
+++ b/opml.php
@@ -1,119 +1,39 @@
-
- // FIXME there are some brackets issues here
+";
- print "
";
-
- } else {
-
- $result = pg_query("INSERT INTO ttrss_feeds (title, feed_url) VALUES
- ('$title', '$url')");
-
- print "Done.
";
-
- }
-
- }
- }
-
- function endElement($parser, $name) {
-
-
- }
-
- if ($op == "Import") {
- print "
-
- Return to preferences";
+ $op = $_REQUEST['op'];
- return;
+ if ($op == "publish"){
+ $key = db_escape_string($link, $_REQUEST["key"]);
- }
- }
+ $result = db_query($link, "SELECT owner_uid
+ FROM ttrss_access_keys WHERE
+ access_key = '$key' AND feed_id = 'OPML:Publish'");
- xml_parser_free($xml_parser);
- fclose($fp);
+ if (db_num_rows($result) == 1) {
+ $owner_uid = db_fetch_result($result, 0, "owner_uid");
- } else {
- print("Error: Could not open OPML input.");
- }
+ $opml = new Opml($link, $_REQUEST);
+ $opml->opml_export("", $owner_uid, true, false);
- } else {
- print "Error: please upload OPML file.";
+ } else {
+ print "
- Return to preferences"; - - print "