href=\"javascript:updateFeedList()\">Refresh</a>
OPML:
<a class=\"button\"
- href=\"javascript:exportOPML()\">Import</a>
+ href=\"opml.php?op=import\">Import</a>
<a class=\"button\"
- href=\"javascript:exportOPML()\">Export</a>";
+ href=\"opml.php?op=export\">Export</a>";
-
}
}
--- /dev/null
+<?
+ // 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>";
+ }
+
+?>
content text not null,
content_hash varchar(250) not null,
last_read timestamp,
+ marked boolean not null default false,
date_entered timestamp not null default NOW(),
no_orig_date boolean not null default false,
comments varchar(250) not null default '',