]> git.wh0rd.org - tt-rss.git/commitdiff
fix opml import (attribute title was not recognized for feeds)
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 23 Dec 2005 05:04:38 +0000 (06:04 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 23 Dec 2005 05:04:38 +0000 (06:04 +0100)
opml.php

index 21af43f7b9ab1bf597f67272d31b6b2ce7308c41..b0107e428837f93e2ed29b033358c269612ac18e 100644 (file)
--- a/opml.php
+++ b/opml.php
                                        print "<table>";
 
                                        foreach ($outlines as $outline) {
+
                                                $feed_title = db_escape_string($outline->get_attribute('text'));
+
+                                               if (!$feed_title) {
+                                                       $feed_title = db_escape_string($outline->get_attribute('title'));
+                                               }
+                                       
                                                $cat_title = db_escape_string($outline->get_attribute('title'));
                                                $feed_url = db_escape_string($outline->get_attribute('xmlUrl'));
                                                $site_url = db_escape_string($outline->get_attribute('htmlUrl'));
                                                                print "Adding category <b>$cat_title</b>...<br>";
 
                                                                db_query($link, "INSERT INTO ttrss_feed_categories
-                                                                       (title,owner_uid,site_url
-                                                               VALUES ('$cat_title', '$owner_uid', '$site_url')");
+                                                                       (title,owner_uid) 
+                                                               VALUES ('$cat_title', '$owner_uid')");
                                                        }
 
                                                        db_query($link, "COMMIT");
                                                }
 
-//                                             print "$active_category : $feed_title : $xmlurl<br>";
+//                                             print "$active_category : $feed_title : $feed_url<br>";
 
                                                if (!$feed_title || !$feed_url) continue;
 
 
                                                        if ($cat_id) {
                                                                $add_query = "INSERT INTO ttrss_feeds 
-                                                                       (title, feed_url, owner_uid, cat_id) VALUES
-                                                                       ('$feed_title', '$feed_url', '$owner_uid', '$cat_id')";
+                                                                       (title, feed_url, owner_uid, cat_id, site_url) VALUES
+                                                                       ('$feed_title', '$feed_url', '$owner_uid', 
+                                                                               '$cat_id', '$site_url')";
 
                                                        } else {
                                                                $add_query = "INSERT INTO ttrss_feeds 
-                                                                       (title, feed_url, owner_uid) VALUES
-                                                                       ('$feed_title', '$feed_url', '$owner_uid')";
+                                                                       (title, feed_url, owner_uid, site_url) VALUES
+                                                                       ('$feed_title', '$feed_url', '$owner_uid', '$site_url')";
 
                                                        }