Changeset 5531
- Timestamp:
- 05/23/2007 07:36:35 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/mt.php
r5404 r5531 23 23 ?> 24 24 <div class="narrow"> 25 <p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, choose a file to upload and click Upload file and import.'); ?></p>25 <p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click "Upload file and import," or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p> 26 26 <?php wp_import_upload_form( add_query_arg('step', 1) ); ?> 27 <p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p> 27 <form method="post" action="<?php echo add_query_arg('step', 1); ?>" class="import-upload-form"> 28 <?php wp_nonce_field('import-upload'); ?> 29 <p> 30 <input type="hidden" name="upload_type" value="ftp" /> 31 <?php _e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory'); ?></p> 32 <p class="submit"> 33 <input type="submit" value="<?php _e(sprintf('Import %s', 'mt-export.txt »')); ?>" /> 34 </p> 35 </form> 36 <p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p> 28 37 </div> 29 38 <?php … … 139 148 <div class="wrap"> 140 149 <h2><?php _e('Assign Authors'); ?></h2> 141 <p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>150 <p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin\'s entries.'); ?></p> 142 151 <p><?php _e('Below, you can see the names of the authors of the MovableType posts in <i>italics</i>. 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.'); ?></p> 143 152 <p><?php _e('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)'); ?></p> … … 164 173 165 174 function select_authors() { 166 $file = wp_import_handle_upload(); 175 if ( $_POST['upload_type'] === 'ftp' ) { 176 $file['file'] = @file(ABSPATH . '/wp-content/mt-export.txt'); 177 if ( !$file['file'] || !count($file['file']) ) 178 $file['error'] = __('<code>mt-export.txt</code> does not exist</code>'); 179 else 180 $file['file'] = ABSPATH . '/wp-content/mt-export.txt'; 181 } else { 182 $file = wp_import_handle_upload(); 183 } 167 184 if ( isset($file['error']) ) { 168 185 $this->header(); … … 401 418 function import() { 402 419 $this->id = (int) $_GET['id']; 403 404 $this->file = get_attached_file($this->id); 420 if ( $this->id == 0 ) 421 $this->file = ABSPATH . '/wp-content/mt-export.txt'; 422 else 423 $this->file = get_attached_file($this->id); 405 424 $this->get_authors_from_post(); 406 425 $this->get_entries();
Note: See TracChangeset
for help on using the changeset viewer.