X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=opml.php;h=bdee88e081694a516cc711290023b3a7d0e09854;hb=e2b8c9273e09091c235959c25d8e4d8122aa6ca8;hp=05ad1943c558f407c2de5b6b8e1ee05b7633f99a;hpb=9a4506c87de04bcde0d6da3da7c289f58d69312b;p=tt-rss.git diff --git a/opml.php b/opml.php index 05ad1943..bdee88e0 100644 --- a/opml.php +++ b/opml.php @@ -1,34 +1,37 @@ -"; - print ""; - print "" . date("r", time()) . ""; - print ""; + $op = $_REQUEST['op']; - $result = pg_query("SELECT * FROM ttrss_feeds ORDER BY title"); + if ($op == "publish"){ + $key = $_REQUEST["key"]; + $pdo = Db::pdo(); - while ($line = pg_fetch_assoc($result)) { - $title = $line["title"]; - $url = $line["feed_url"]; + $sth = $pdo->prepare( "SELECT owner_uid + FROM ttrss_access_keys WHERE + access_key = ? AND feed_id = 'OPML:Publish'"); + $sth->execute([$key]); - print ""; - } + if ($row = $sth->fetch()) { + $owner_uid = $row['owner_uid']; + + $opml = new Opml($_REQUEST); + $opml->opml_export("", $owner_uid, true, false); - print ""; + } else { + print "User not found"; + } } ?>