summaryrefslogtreecommitdiffstats
path: root/wp-admin/import/mt.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-10-09 11:39:17 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-10-09 11:39:17 +0000
commit75e0ccc3a64e164d036da4f71f458520ddea3b24 (patch)
tree94f00db692e25c95030f7984c27178e1bd7e1bcd /wp-admin/import/mt.php
parentca036ad95fc44c318275ab539a52f1eb6fddf060 (diff)
downloadwordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.tar.gz
wordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.tar.xz
wordpress-mu-75e0ccc3a64e164d036da4f71f458520ddea3b24.zip
WP Merge - needs testing.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@797 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/import/mt.php')
-rw-r--r--wp-admin/import/mt.php43
1 files changed, 8 insertions, 35 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>";
}