diff options
Diffstat (limited to 'plugins/import_export')
-rw-r--r-- | plugins/import_export/import_export.js | 2 | ||||
-rw-r--r-- | plugins/import_export/init.php | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/plugins/import_export/import_export.js b/plugins/import_export/import_export.js index b3b760f15..86b0458be 100644 --- a/plugins/import_export/import_export.js +++ b/plugins/import_export/import_export.js @@ -37,7 +37,7 @@ function exportData() { } else { $("export_status_message").innerHTML = - __("Finished, exported %d articles. You can download the data <a class='visibleLink' href='%u'>here</a>.") + ngettext("Finished, exported %d article. You can download the data <a class='visibleLink' href='%u'>here</a>.", "Finished, exported %d articles. You can download the data <a class='visibleLink' href='%u'>here</a>.", exported) .replace("%d", exported) .replace("%u", "backend.php?op=pluginhandler&plugin=import_export&subop=exportget"); diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php index de21dbf32..5a3051edb 100644 --- a/plugins/import_export/init.php +++ b/plugins/import_export/init.php @@ -49,7 +49,7 @@ class Import_Export extends Plugin implements IHandler { } function save() { - $example_value = db_escape_string($_POST["example_value"]); + $example_value = db_escape_string($this->link, $_POST["example_value"]); echo "Value set to $example_value (not really)"; } @@ -122,7 +122,7 @@ class Import_Export extends Plugin implements IHandler { } function exportrun() { - $offset = (int) db_escape_string($_REQUEST['offset']); + $offset = (int) db_escape_string($this->link, $_REQUEST['offset']); $exported = 0; $limit = 250; @@ -238,7 +238,7 @@ class Import_Export extends Plugin implements IHandler { foreach ($article_node->childNodes as $child) { if ($child->nodeName != 'label_cache') - $article[$child->nodeName] = db_escape_string($child->nodeValue); + $article[$child->nodeName] = db_escape_string($this->link, $child->nodeValue); else $article[$child->nodeName] = $child->nodeValue; } @@ -346,7 +346,7 @@ class Import_Export extends Plugin implements IHandler { $score = (int) $article['score']; $tag_cache = $article['tag_cache']; - $label_cache = db_escape_string($article['label_cache']); + $label_cache = db_escape_string($this->link, $article['label_cache']); $note = $article['note']; //print "Importing " . $article['title'] . "<br/>"; @@ -382,8 +382,10 @@ class Import_Export extends Plugin implements IHandler { } print "<p>" . - T_sprintf("Finished: %d articles processed, %d imported, %d feeds created.", - $num_processed, $num_imported, $num_feeds_created) . + vsprintf(__("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). "</p>"; } else { @@ -421,8 +423,7 @@ class Import_Export extends Plugin implements IHandler { $this->perform_data_import($this->link, $_FILES['export_file']['tmp_name'], $_SESSION['uid']); } else { - print "<p>" . 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.</p>"; + print "<p>" . 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.</p>"; } |