mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 20:15:55 +00:00
fix opml import (attribute title was not recognized for feeds)
This commit is contained in:
21
opml.php
21
opml.php
@@ -126,7 +126,13 @@
|
|||||||
print "<table>";
|
print "<table>";
|
||||||
|
|
||||||
foreach ($outlines as $outline) {
|
foreach ($outlines as $outline) {
|
||||||
|
|
||||||
$feed_title = db_escape_string($outline->get_attribute('text'));
|
$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'));
|
$cat_title = db_escape_string($outline->get_attribute('title'));
|
||||||
$feed_url = db_escape_string($outline->get_attribute('xmlUrl'));
|
$feed_url = db_escape_string($outline->get_attribute('xmlUrl'));
|
||||||
$site_url = db_escape_string($outline->get_attribute('htmlUrl'));
|
$site_url = db_escape_string($outline->get_attribute('htmlUrl'));
|
||||||
@@ -144,14 +150,14 @@
|
|||||||
print "Adding category <b>$cat_title</b>...<br>";
|
print "Adding category <b>$cat_title</b>...<br>";
|
||||||
|
|
||||||
db_query($link, "INSERT INTO ttrss_feed_categories
|
db_query($link, "INSERT INTO ttrss_feed_categories
|
||||||
(title,owner_uid,site_url)
|
(title,owner_uid)
|
||||||
VALUES ('$cat_title', '$owner_uid', '$site_url')");
|
VALUES ('$cat_title', '$owner_uid')");
|
||||||
}
|
}
|
||||||
|
|
||||||
db_query($link, "COMMIT");
|
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 (!$feed_title || !$feed_url) continue;
|
||||||
|
|
||||||
@@ -191,13 +197,14 @@
|
|||||||
|
|
||||||
if ($cat_id) {
|
if ($cat_id) {
|
||||||
$add_query = "INSERT INTO ttrss_feeds
|
$add_query = "INSERT INTO ttrss_feeds
|
||||||
(title, feed_url, owner_uid, cat_id) VALUES
|
(title, feed_url, owner_uid, cat_id, site_url) VALUES
|
||||||
('$feed_title', '$feed_url', '$owner_uid', '$cat_id')";
|
('$feed_title', '$feed_url', '$owner_uid',
|
||||||
|
'$cat_id', '$site_url')";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$add_query = "INSERT INTO ttrss_feeds
|
$add_query = "INSERT INTO ttrss_feeds
|
||||||
(title, feed_url, owner_uid) VALUES
|
(title, feed_url, owner_uid, site_url) VALUES
|
||||||
('$feed_title', '$feed_url', '$owner_uid')";
|
('$feed_title', '$feed_url', '$owner_uid', '$site_url')";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user