Make WordPress Core

Changeset 3204


Ignore:
Timestamp:
11/23/2005 10:02:23 AM (19 years ago)
Author:
ryan
Message:

MT importer work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import/mt.php

    r3141 r3204  
    11<?php
    2 
    3 
    4 // enter the relative path of the import.txt file containing the mt entries. If the file is called import.txt and it is /wp-admin, then this line
    5 //should be define('MTEXPORT', 'import.txt');
    6 define('MTEXPORT', 'import.txt');
    72
    83class MT_Import {
     
    3126<p>The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&#8212;for whatever reason&#8212;it doesn't finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces. </p>
    3227<?php
    33 
    34 
    3528        $this->footer();
    3629    }
     
    6861                    $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank.
    6962                } else {
    70                     $wpdb->query("INSERT INTO $wpdb->users (user_level, user_login, user_pass, user_nickname) VALUES ('1', '{$this->newauthornames[$this->j]}', '$md5pass', '{$this->newauthornames[$this->j]}')"); //if not left_blank, insert the user specified name
    7163                    $user_id = wp_create_user($this->newauthornames[$this->j], $pass);
    7264                }
     
    178170        $this->get_entries();
    179171        $this->mt_authors_form();
    180         wp_import_cleanup($this->id);
    181172    }
    182173
     
    382373
    383374        echo '</ol>';
     375
     376        wp_import_cleanup($this->id);
     377
    384378        echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3>';
    385379    }
    386380
    387381    function import() {
     382        $this->id = (int) $_GET['id'];
     383        $this->file = get_attached_file($this->id);
    388384        $this->get_authors_from_post();
    389385        $this->get_entries();
     
    405401                break;
    406402            case 2:
    407                 echo "ID: {$_GET['id']}<br/>";
     403                $this->import();
    408404                break;
    409405        }
Note: See TracChangeset for help on using the changeset viewer.