Changeset 860
- Timestamp:
- 08/30/08 17:35:19 (3 months ago)
- Files:
-
- 1 modified
-
plugins/mtimport/trunk/mtimport.plugin.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/mtimport/trunk/mtimport.plugin.php
r859 r860 1 1 <?php 2 2 /** 3 * MovableType Importer 3 * Movable Type Importer 4 * Import Movable Type Database 4 5 * 5 6 * @package mtimport … … 8 9 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 9 10 * @link http://habariproject.org/ 11 * 12 * Tested with Movable Type Ver 4.12 (MySQL) 10 13 */ 11 14 define('MT_IMPORT_BATCH', 100); … … 23 26 { 24 27 return array( 25 'name' => 'Movable Type Importer',28 'name' => 'Movable Type Importer', 26 29 'version' => '0.01-alpha', 27 30 'url' => 'http://habariproject.org/', … … 63 66 * Plugin filter that supplies the UI for the MT importer 64 67 * 68 * @access public 65 69 * @param string $stageoutput The output stage UI 66 70 * @param string $import_name The name of the selected importer … … 103 107 'db_pass' => '', 104 108 'db_prefix' => 'mt_', 105 'warning' => '', 106 'category_import' => 1, 107 'utw_import' => 0, 109 'warning' => '' 108 110 ); 109 111 $inputs= array_merge( $default_values, $inputs ); … … 141 143 private function stage_2($inputs) 142 144 { 143 $valid_fields= array( 'db_name','db_host','db_user','db_pass','db_prefix', 'category_import', 'utw_import');145 $valid_fields= array('db_name','db_host','db_user','db_pass','db_prefix'); 144 146 $inputs= array_intersect_key($_POST, array_flip($valid_fields)); 145 147 extract($inputs); … … 156 158 <table> 157 159 <tr><td><?php echo _t('Import Blog', 'mtimport'); ?></td><td> 158 <select name="blog_id" size="1">159 <?php while (list(, $blog) = @each($blogs)): ?>160 <option value="<?php echo $blog->blog_id; ?>"><?php echo htmlspecialchars($blog->blog_name); ?></option>161 <?php endwhile; ?>162 </select>163 </td></tr>160 <select name="blog_id" size="1"> 161 <?php while (list(, $blog) = @each($blogs)): ?> 162 <option value="<?php echo $blog->blog_id; ?>"><?php echo htmlspecialchars($blog->blog_name); ?></option> 163 <?php endwhile; ?> 164 </select> 165 </td></tr> 164 166 </table> 165 167 <input type="hidden" name="stage" value="3"> … … 341 343 LEFT JOIN {$db_prefix}category ON entry_category_id = category_id 342 344 WHERE entry_blog_id = '{$blog_id}' 343 ORDER BY id DESC LIMIT {$min}," . MT_IMPORT_BATCH . ';',345 ORDER BY id DESC LIMIT {$min}," . MT_IMPORT_BATCH . ';', 344 346 array(), 'Post'); 345 347 … … 448 450 echo sprintf(_t('<p>Importing comments %d-%d of %d.</p>'), $min, $max, $commentcount); 449 451 450 $post_info= DB::get_results("SELECT post_id, value FROM " . DB::table('postinfo') . " WHERE name= 'm p_id';");452 $post_info= DB::get_results("SELECT post_id, value FROM " . DB::table('postinfo') . " WHERE name= 'mt_id';"); 451 453 @reset($post_info); 452 454 while (list(, $info) = @each($post_info)) { … … 484 486 $carray['status']= Comment::STATUS_UNAPPROVED; 485 487 } 488 unset($carray['comment_junk_status']); 486 489 487 490 if (!isset($post_map[$carray['mt_post_id']] ) ) { … … 555 558 echo sprintf(_t('<p>Importing trackbacks %d-%d of %d.</p>'), $min, $max, $trackbackcount); 556 559 557 $post_info= DB::get_results("SELECT post_id, value FROM " . DB::table('postinfo') . " WHERE name= 'm p_id';");560 $post_info= DB::get_results("SELECT post_id, value FROM " . DB::table('postinfo') . " WHERE name= 'mt_id';"); 558 561 @reset($post_info); 559 562 while (list(, $info) = @each($post_info)) { … … 584 587 $carray['status']= Comment::STATUS_UNAPPROVED; 585 588 } 589 unset($carray['trackback_is_disabled']); 586 590 587 591 if (!isset($post_map[$carray['mt_post_id']] ) ) {
