From: Andrew Dolgov Date: Fri, 23 Dec 2005 05:04:38 +0000 (+0100) Subject: fix opml import (attribute title was not recognized for feeds) X-Git-Tag: 1.1.1~9 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=8ddf4cdc72e8f6327837558d1b1c71f216fcbff5;p=tt-rss.git fix opml import (attribute title was not recognized for feeds) --- diff --git a/opml.php b/opml.php index 21af43f7..b0107e42 100644 --- a/opml.php +++ b/opml.php @@ -126,7 +126,13 @@ print ""; 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')); @@ -144,14 +150,14 @@ print "Adding category $cat_title...
"; 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
"; +// print "$active_category : $feed_title : $feed_url
"; if (!$feed_title || !$feed_url) continue; @@ -191,13 +197,14 @@ 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')"; }