1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 03:15:56 +00:00

add --opml-export to update.php

This commit is contained in:
Andrew Dolgov
2020-05-13 12:07:31 +03:00
parent 5e77d0062b
commit 7a2e9bef77
2 changed files with 53 additions and 27 deletions

View File

@@ -125,15 +125,16 @@ class Opml extends Handler_Protected {
return $out;
}
function opml_export($name, $owner_uid, $hide_private_feeds = false, $include_settings = true) {
function opml_export($filename, $owner_uid, $hide_private_feeds = false, $include_settings = true, $file_output = false) {
if (!$owner_uid) return;
if (!isset($_REQUEST["debug"])) {
header("Content-type: application/xml+opml");
header("Content-Disposition: attachment; filename=" . $name );
} else {
header("Content-type: text/xml");
}
if (!$file_output)
if (!isset($_REQUEST["debug"])) {
header("Content-type: application/xml+opml");
header("Content-Disposition: attachment; filename=$filename");
} else {
header("Content-type: text/xml");
}
$out = "<?xml version=\"1.0\" encoding=\"utf-8\"?".">";
@@ -288,7 +289,10 @@ class Opml extends Handler_Protected {
'return str_repeat("\t", intval(strlen($matches[0])/2));'),
$res); */
print $res;
if ($file_output)
return file_put_contents($filename, $res) > 0;
else
print $res;
}
// Import