OPML export
This commit is contained in:
parent
10c5820d08
commit
9a4506c87d
4 changed files with 37 additions and 14 deletions
|
@ -572,10 +572,9 @@
|
||||||
href=\"javascript:updateFeedList()\">Refresh</a>
|
href=\"javascript:updateFeedList()\">Refresh</a>
|
||||||
OPML:
|
OPML:
|
||||||
<a class=\"button\"
|
<a class=\"button\"
|
||||||
href=\"javascript:exportOPML()\">Import</a>
|
href=\"opml.php?op=import\">Import</a>
|
||||||
<a class=\"button\"
|
<a class=\"button\"
|
||||||
href=\"javascript:exportOPML()\">Export</a>";
|
href=\"opml.php?op=export\">Export</a>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
34
opml.php
Normal file
34
opml.php
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?
|
||||||
|
// FIXME there are some brackets issues here
|
||||||
|
|
||||||
|
$op = $_GET["op"];
|
||||||
|
if ($op == "export") {
|
||||||
|
header("Content-type: application/xml");
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once "config.php";
|
||||||
|
require_once "functions.php";
|
||||||
|
|
||||||
|
$link = pg_connect(DB_CONN);
|
||||||
|
|
||||||
|
pg_query($link, "set client_encoding = 'utf-8'");
|
||||||
|
|
||||||
|
if ($op == "export") {
|
||||||
|
print "<?xml version=\"1.0\"?>";
|
||||||
|
print "<opml version=\"1.0\">";
|
||||||
|
print "<head><dateCreated>" . date("r", time()) . "</dateCreated></head>";
|
||||||
|
print "<body>";
|
||||||
|
|
||||||
|
$result = pg_query("SELECT * FROM ttrss_feeds ORDER BY title");
|
||||||
|
|
||||||
|
while ($line = pg_fetch_assoc($result)) {
|
||||||
|
$title = $line["title"];
|
||||||
|
$url = $line["feed_url"];
|
||||||
|
|
||||||
|
print "<outline text=\"$title\" xmlUrl=\"$url\"/>";
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</body></opml>";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
11
prefs.js
11
prefs.js
|
@ -297,17 +297,6 @@ function localPiggieFunction(enable) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportOPML() {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function importOPML() {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
// IE kludge
|
// IE kludge
|
||||||
|
|
|
@ -36,6 +36,7 @@ create table ttrss_entries (id serial not null primary key,
|
||||||
content text not null,
|
content text not null,
|
||||||
content_hash varchar(250) not null,
|
content_hash varchar(250) not null,
|
||||||
last_read timestamp,
|
last_read timestamp,
|
||||||
|
marked boolean not null default false,
|
||||||
date_entered timestamp not null default NOW(),
|
date_entered timestamp not null default NOW(),
|
||||||
no_orig_date boolean not null default false,
|
no_orig_date boolean not null default false,
|
||||||
comments varchar(250) not null default '',
|
comments varchar(250) not null default '',
|
||||||
|
|
Loading…
Reference in a new issue