Changeset 3098 for trunk/wp-admin/import/mt.php
- Timestamp:
- 11/16/2005 02:07:56 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/import/mt.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/mt.php
r3062 r3098 9 9 10 10 var $posts = array (); 11 var $file; 12 var $id; 11 13 var $mtnames = array (); 12 14 var $newauthornames = array (); … … 25 27 $this->header(); 26 28 ?> 27 <p>Howdy! We’re about to begin the process to import all of your Movable Type entries into WordPress. Before we get started, you need to edit this file (<code>import/mt.php</code>) and change one line so we know where to find your MT export file. To make this easy put the import file into the <code>wp-admin/import</code> directory. Look for the line that says:</p> 28 <p><code>define('MTEXPORT', '');</code></p> 29 <p>and change it to</p> 30 <p><code>define('MTEXPORT', 'import.txt');</code></p> 31 <p>You have to do this manually for security reasons.</p> 32 <p>If you've done that and you’re all ready, <a href="<?php echo add_query_arg('step', 1) ?>">let's go</a>! Remember that the import process may take a minute or so if you have a large number of entries and comments. Think of all the rebuilding time you'll be saving once it's done. :)</p> 29 <p>Howdy! We’re about to begin the process to import all of your Movable Type entries into WordPress. To begin, select a file to upload and click Import.</p> 30 <?php wp_import_upload_form( add_query_arg('step', 1) ); ?> 33 31 <p>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> 34 32 <?php … … 86 84 function get_entries() { 87 85 set_magic_quotes_runtime(0); 88 $importdata = file( MTEXPORT); // Read the file into an array86 $importdata = file($this->file); // Read the file into an array 89 87 $importdata = implode('', $importdata); // squish it 90 88 $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata); … … 153 151 $authors = $this->get_mt_authors(); 154 152 echo '<ol id="authors">'; 155 echo '<form action="?import=mt&step=2 " method="post">';153 echo '<form action="?import=mt&step=2&id=' . $this->id . '" method="post">'; 156 154 $j = -1; 157 155 foreach ($authors as $author) { … … 170 168 171 169 function select_authors() { 172 if ('' != MTEXPORT && !file_exists(MTEXPORT)) 173 die("The file you specified does not seem to exist. Please check the path you've given."); 174 if ('' == MTEXPORT) 175 die("You must edit the MTEXPORT line as described on the <a href='import-mt.php'>previous page</a> to continue."); 170 $file = wp_import_handle_upload(); 171 if ( isset($file['error']) ) { 172 echo $file['error']; 173 return; 174 } 175 $this->file = $file['file']; 176 $this->id = $file['id']; 176 177 177 178 $this->get_entries(); 178 179 $this->mt_authors_form(); 180 wp_import_cleanup($this->id); 179 181 } 180 182 … … 402 404 $this->select_authors(); 403 405 break; 406 case 2: 407 echo "ID: {$_GET['id']}<br/>"; 408 break; 404 409 } 405 410 }
Note: See TracChangeset
for help on using the changeset viewer.