mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>
+
mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>
-
-
out of memory error try splitting up the import file into pieces.'); ?>
+
out of memory error try splitting up the import file into pieces.'); ?>
footer();
}
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,10 +192,11 @@ 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.'); ?>