From c03cf250e8cef7f6d49e1b1980c40de7eebf9b89 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 17 Nov 2007 10:23:44 +0100 Subject: place imported feeds in a separate category unless otherwise specified (closes #162) --- opml.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'opml.php') diff --git a/opml.php b/opml.php index 883ddd0d9..35d7a070c 100644 --- a/opml.php +++ b/opml.php @@ -111,6 +111,24 @@

".__('OPML Utility')."

"; + db_query($link, "BEGIN"); + + /* create Imported feeds category just in case */ + + $result = db_query($link, "SELECT id FROM + ttrss_feed_categories WHERE title = 'Imported feeds' AND + owner_uid = '$owner_uid' LIMIT 1"); + + if (db_num_rows($result) == 0) { + db_query($link, "INSERT INTO ttrss_feed_categories + (title,owner_uid) + VALUES ('Imported feeds', '$owner_uid')"); + } + + db_query($link, "COMMIT"); + + /* Handle OPML import by DOMXML/DOMDocument */ + if (function_exists('domxml_open_file')) { print "

".__("Importing OPML (using DOMXML extension)...")."

"; require_once "modules/opml_domxml.php"; -- cgit v1.2.3-54-g00ecf