]> git.wh0rd.org Git - tt-rss.git/commitdiff
more opml export tweaks, tiny category detection tweak on import
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 25 Nov 2005 17:34:34 +0000 (18:34 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 25 Nov 2005 17:34:34 +0000 (18:34 +0100)
opml.php

index 9609af1d29d9e1981dc3a608001915f01f347106..f00be657dab768a5cd82164484c8dd064749ed30 100644 (file)
--- a/opml.php
+++ b/opml.php
@@ -36,8 +36,7 @@
                if (get_pref($link, 'ENABLE_FEED_CATS')) {
                        $cat_mode = true;
                        $result = db_query($link, "SELECT 
-                                       ttrss_feeds.feed_url AS feed_url,
-                                       ttrss_feeds.title AS title,
+                                       title,feed_url,site_url,
                                        (SELECT title FROM ttrss_feed_categories WHERE id = cat_id) as cat_title
                                        FROM ttrss_feeds
                                WHERE
@@ -53,6 +52,7 @@
                while ($line = db_fetch_assoc($result)) {
                        $title = htmlspecialchars($line["title"]);
                        $url = htmlspecialchars($line["feed_url"]);
+                       $site_url = htmlspecialchars($line["site_url"]);
 
                        if ($cat_mode) {
                                $cat_title = htmlspecialchars($line["cat_title"]);
                                }
                        }
 
-                       print "<outline text=\"$title\" xmlUrl=\"$url\"/>\n";
+                       if ($site_url) {
+                               $html_url_qpart = "htmlUrl=\"$site_url\"";
+                       } else {
+                               $html_url_qpart = "";
+                       }
+
+                       print "<outline text=\"$title\" xmlUrl=\"$url\" $html_url_qpart/>\n";
                }
 
                if ($cat_mode && $old_cat_title) {
                                                $cat_title = db_escape_string($outline->get_attribute('title'));
                                                $feed_url = db_escape_string($outline->get_attribute('xmlUrl'));
 
-                                               if ($cat_title) {
+                                               if ($cat_title && !$feed_url) {
 
                                                        db_query($link, "BEGIN");