X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;ds=sidebyside;f=opml.php;h=b8c9fb6c5c483dd6d9ebc52bb89f444252f85399;hb=35a86757d80ba9bd1a16ba4a0c2f1843e11769ed;hp=f29b19023758597f8d888e56bf17fc870aa66fc1;hpb=9f311df6262c206a56f47a593244336e6ba1f54c;p=tt-rss.git
diff --git a/opml.php b/opml.php
index f29b1902..b8c9fb6c 100644
--- a/opml.php
+++ b/opml.php
@@ -1,119 +1,38 @@
-
- // 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 "