diff --git a/modules/opml_domdoc.php b/modules/opml_domdoc.php new file mode 100644 index 000000000..459841022 --- /dev/null +++ b/modules/opml_domdoc.php @@ -0,0 +1,127 @@ +getElementsByTagName('body'); + + $xpath = new DOMXpath($doc); + $query = "/opml/body//outline"; + + $outlines = $xpath->query($query); + + print "
$feed_title + (rss) | "; + + if (db_num_rows($result) > 0) { + print "Already imported. | "; + } else { + + if ($cat_id) { + $add_query = "INSERT INTO ttrss_feeds + (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, site_url) VALUES + ('$feed_title', '$feed_url', '$owner_uid', '$site_url')"; + + } + + db_query($link, $add_query); + + print "Done. | "; + } + + print "
$feed_title + (rss) | "; + + if (db_num_rows($result) > 0) { + print ""._("Already imported.")." | "; + } else { + + if ($cat_id) { + $add_query = "INSERT INTO ttrss_feeds + (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, site_url) VALUES + ('$feed_title', '$feed_url', '$owner_uid', '$site_url')"; + + } + + db_query($link, $add_query); + + print ""._('Done.')." | "; + } + + print "
$feed_title - (rss) | "; - - if (db_num_rows($result) > 0) { - print ""._("Already imported.")." | "; - } else { - - if ($cat_id) { - $add_query = "INSERT INTO ttrss_feeds - (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, site_url) VALUES - ('$feed_title', '$feed_url', '$owner_uid', '$site_url')"; - - } - - db_query($link, $add_query); - - print ""._('Done.')." | "; - } - - print "
Using DOMXML library
"; + require_once "modules/opml_domxml.php"; + opml_import_domxml($link, $owner_uid); } else { - print "Using DOMDocument library (PHP5)
"; + require_once "modules/opml_domdoc.php"; + opml_import_domdoc($link, $owner_uid); } print "