diff options
Diffstat (limited to 'wp-admin/import')
-rw-r--r-- | wp-admin/import/mt.php | 43 | ||||
-rw-r--r-- | wp-admin/import/wordpress.php | 8 |
2 files changed, 12 insertions, 39 deletions
diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index 014529e..b86ae33 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -52,25 +52,8 @@ class MT_Import { function checkauthor($author) { global $wpdb; //mtnames is an array with the names in the mt import file - $pass = 'changeme'; - if (!(in_array($author, $this->mtnames))) { //a new mt author name is found - ++ $this->j; - $this->mtnames[$this->j] = $author; //add that new mt author name to an array - $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user - if (!$user_id) { //banging my head against the desk now. - if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname - $user_id = wp_create_user($author, $pass); - $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. - } else { - $user_id = wp_create_user($this->newauthornames[$this->j], $pass); - } - } else { - return $user_id; // return pre-existing wp username if it exists - } - } else { - $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array - $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames - } + $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array + $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames return $user_id; } @@ -112,13 +95,6 @@ class MT_Import { $formnames = array (); $selectnames = array (); - foreach ($_POST['user'] as $key => $line) { - $newname = trim(stripslashes($line)); - if ($newname == '') - $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form. - array_push($formnames, "$newname"); - } // $formnames is the array with the form entered names - foreach ($_POST['userselect'] as $user => $key) { $selected = trim(stripslashes($key)); array_push($selectnames, "$selected"); @@ -150,12 +126,12 @@ class MT_Import { $j = -1; foreach ($authors as $author) { ++ $j; - echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />'); + echo '<li><i>'.$author.'</i><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">'; $this->users_form($j); echo '</li>'; } - echo '<input type="submit" value="'.__('Submit').'">'.'<br/>'; + echo '<input type="submit" value="Submit">'.'<br/>'; echo '</form>'; echo '</ol></div>'; @@ -164,10 +140,7 @@ class MT_Import { function select_authors() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { - $this->header(); - echo '<p>'.__('Sorry, there has been an error').'.</p>'; - echo '<p><strong>' . $file['error'] . '</strong></p>'; - $this->footer(); + echo $file['error']; return; } $this->file = $file['file']; @@ -199,7 +172,7 @@ class MT_Import { // We want the excerpt preg_match("|-----\nEXCERPT:(.*)|s", $post, $excerpt); - $post_excerpt = $wpdb->escape(trim($excerpt[1])); + $excerpt = $wpdb->escape(trim($excerpt[1])); $post = preg_replace("|(-----\nEXCERPT:.*)|s", '', $post); // We're going to put extended body into main body with a more tag @@ -336,7 +309,7 @@ class MT_Import { } } if ( $num_comments ) - printf(' '.__('(%s comments)'), $num_comments); + printf(__(' (%s comments)'), $num_comments); // Finally the pings // fix the double newline on the first one @@ -384,7 +357,7 @@ class MT_Import { } } if ( $num_pings ) - printf(' '.__('(%s pings)'), $num_pings); + printf(__(' (%s pings)'), $num_pings); echo "</li>"; } diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php index 5c67eec..46f5892 100644 --- a/wp-admin/import/wordpress.php +++ b/wp-admin/import/wordpress.php @@ -26,7 +26,7 @@ class WP_Import { function greet() {
echo '<div class="narrow">';
- echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts and comments into this blog.').'</p>';
+ echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, comments, custom fields, and categories into this blog.').'</p>';
wp_import_upload_form("admin.php?import=wordpress&step=1");
echo '</div>';
}
@@ -150,8 +150,8 @@ class WP_Import { $j = -1;
foreach ($authors as $author) {
++ $j;
- echo '<li>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');
- $this->users_form($j);
+ echo '<li>Current author: <strong>'.$author.'</strong><br />'.'Map to existing: ';
+ $this->users_form($author);
echo '</li>';
}
@@ -308,6 +308,6 @@ class WP_Import { $wp_import = new WP_Import();
-register_importer('wordpress', 'WordPress', __('Import posts from a WordPress export file'), array ($wp_import, 'dispatch'));
+register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch'));
?>
|