diff options
author | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
---|---|---|
committer | Barak Korren <[email protected]> | 2013-04-02 20:38:07 +0300 |
commit | 58a2577d48790c79adfd44bcfd662c980ce6cfe4 (patch) | |
tree | 523d814ea0b7b6f617fe515b186099c6e83fed72 /plugins/import_export/init.php | |
parent | e470a273cf09562fb2f9c0c899002303f19c8d16 (diff) | |
parent | cc332603431102a682feda22b9cf0093a29f0176 (diff) |
Merge branch 'master' of https://github.com/gothfox/Tiny-Tiny-RSS.git
Diffstat (limited to 'plugins/import_export/init.php')
-rw-r--r-- | plugins/import_export/init.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php index 5a3051edb..ab47288b3 100644 --- a/plugins/import_export/init.php +++ b/plugins/import_export/init.php @@ -9,7 +9,7 @@ class Import_Export extends Plugin implements IHandler { $this->host = $host; $host->add_hook($host::HOOK_PREFS_TAB, $this); - $host->add_command("xml-import", "USER FILE: import articles from XML", $this); + $host->add_command("xml-import", "import articles from XML", $this, ":", "FILE"); } function about() { @@ -19,21 +19,18 @@ class Import_Export extends Plugin implements IHandler { } function xml_import($args) { - array_shift($args); - $username = $args[count($args) - 2]; - $filename = $args[count($args) - 1]; - - if (!$username) { - print "error: please specify username.\n"; - return; - } + $filename = $args['xml_import']; if (!is_file($filename)) { print "error: input filename ($filename) doesn't exist.\n"; return; } + _debug("please enter your username:"); + + $username = db_escape_string($this->link, trim(read_stdin())); + _debug("importing $filename for user $username...\n"); $result = db_query($this->link, "SELECT id FROM ttrss_users WHERE login = '$username'"); @@ -382,7 +379,7 @@ class Import_Export extends Plugin implements IHandler { } print "<p>" . - vsprintf(__("Finished: ")). + __("Finished: "). vsprintf(ngettext("%d article processed, ", "%d articles processed, ", $num_processed), $num_processed). vsprintf(ngettext("%d imported, ", "%d imported, ", $num_imported), $num_imported). vsprintf(ngettext("%d feed created.", "%d feeds created.", $num_feeds_created), $num_feeds_created). |