X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/76aea3697c6043c1613370f172395b4f65ee71f0..11be8dc178e77d0b46189bbd8e33a216a9b90942:/wp-admin/import/mt.php diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index 5968095c..48d4de3b 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -1,5 +1,18 @@ '; + screen_icon(); echo '
/wp-content/
directory'); ?>
- +
out of memory error try splitting up the import file into pieces.'); ?>
@@ -42,7 +56,7 @@ class MT_Import { } function users_form($n) { - global $wpdb, $testing; + global $wpdb; $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID"); ?> has_gzip() ) + return gzopen($filename, $mode); + return fopen($filename, $mode); + } + + function feof($fp) { + if ( $this->has_gzip() ) + return gzeof($fp); + return feof($fp); + } + function fgets($fp, $len=8192) { + if ( $this->has_gzip() ) + return gzgets($fp, $len); + return fgets($fp, $len); } + function fclose($fp) { + if ( $this->has_gzip() ) + return gzclose($fp); + return fclose($fp); + } + //function to check the authorname and do the mapping function checkauthor($author) { - global $wpdb; //mtnames is an array with the names in the mt import file $pass = wp_generate_password(); if (!(in_array($author, $this->mtnames))) { //a new mt author name is found @@ -69,7 +109,7 @@ class MT_Import { $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 + if ($this->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 { @@ -90,12 +130,12 @@ class MT_Import { $temp = array(); $authors = array(); - $handle = fopen($this->file, 'r'); + $handle = $this->fopen($this->file, 'r'); if ( $handle == null ) return false; $in_comment = false; - while ( $line = fgets($handle) ) { + while ( $line = $this->fgets($handle) ) { $line = trim($line); if ( 'COMMENT:' == $line ) @@ -118,7 +158,7 @@ class MT_Import { array_push($authors, "$next"); } - fclose($handle); + $this->fclose($handle); return $authors; } @@ -152,6 +192,7 @@ class MT_Import { function mt_authors_form() { ?>italics. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?>
@@ -171,7 +212,7 @@ class MT_Import { echo ''; } - echo ''.'