summaryrefslogtreecommitdiff
path: root/opml.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-11-17 10:23:44 +0100
committerAndrew Dolgov <[email protected]>2007-11-17 10:23:44 +0100
commitc03cf250e8cef7f6d49e1b1980c40de7eebf9b89 (patch)
treec3eb5ffb17c6ec2ec4cf8b1fc85fba484f55c618 /opml.php
parent5a68dec1df36446de39829838e914bad23c34949 (diff)
place imported feeds in a separate category unless otherwise specified (closes #162)
Diffstat (limited to 'opml.php')
-rw-r--r--opml.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/opml.php b/opml.php
index 883ddd0d9..35d7a070c 100644
--- a/opml.php
+++ b/opml.php
@@ -111,6 +111,24 @@
<div class=\"floatingLogo\"><img src=\"images/ttrss_logo.png\"></div>
<h1>".__('OPML Utility')."</h1>";
+ 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 "<p>".__("Importing OPML (using DOMXML extension)...")."</p>";
require_once "modules/opml_domxml.php";