]> git.wh0rd.org - tt-rss.git/blobdiff - opml.php
simplepie: enable https and digest auth
[tt-rss.git] / opml.php
index b1a62ab8c739365452112ddbffea9bf51d967a71..35d7a070c8ae1a17896df8e52cc66a652fd6cffc 100644 (file)
--- a/opml.php
+++ b/opml.php
        if (DB_TYPE == "pgsql") {
                pg_query($link, "set client_encoding = 'utf-8'");
                pg_set_client_encoding("UNICODE");
+       } else {
+               if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) {
+                       db_query($link, "SET NAMES " . MYSQL_CHARSET);
+//                     db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET);
+               }
        }
 
        login_sequence($link);
                        <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";