"; ++$num_imported; - $result = db_query($link, + $result = db_query( "INSERT INTO ttrss_user_entries (ref_id, owner_uid, feed_id, unread, last_read, marked, published, score, tag_cache, label_cache, uuid, note) @@ -363,15 +362,15 @@ class Import_Export extends Plugin implements IHandler { if (is_array($label_cache) && $label_cache["no-labels"] != 1) { foreach ($label_cache as $label) { - label_create($link, $label[1], + label_create( $label[1], $label[2], $label[3], $owner_uid); - label_add_article($link, $ref_id, $label[1], $owner_uid); + label_add_article( $ref_id, $label[1], $owner_uid); } } - //db_query($link, "COMMIT"); + //db_query( "COMMIT"); } } } @@ -415,13 +414,35 @@ class Import_Export extends Plugin implements IHandler { print "
" . T_sprintf("Could not upload file. You might need to adjust upload_max_filesize in PHP.ini (current value = %s)", ini_get("upload_max_filesize")) . " or use CLI import tool.
"; + print_error(__('Error: please upload OPML file.')); + return; + } + if (is_file($tmp_file)) { + $this->perform_data_import( $tmp_file, $_SESSION['uid']); + unlink($tmp_file); + } else { + print_error(__('No file uploaded.')); + return; } print "