Changeset 4495 for trunk/wp-admin/import/textpattern.php
- Timestamp:
- 11/19/2006 07:56:05 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/textpattern.php
r4349 r4495 5 5 if(!function_exists('get_catbynicename')) 6 6 { 7 function get_catbynicename($category_nicename) 7 function get_catbynicename($category_nicename) 8 8 { 9 9 global $wpdb; … … 71 71 72 72 // Get Categories 73 return $txpdb->get_results('SELECT 74 75 76 77 FROM '.$prefix.'txp_category78 WHERE type = "article"',79 73 return $txpdb->get_results('SELECT 74 id, 75 name, 76 title 77 FROM '.$prefix.'txp_category 78 WHERE type = "article"', 79 ARRAY_A); 80 80 } 81 81 … … 91 91 92 92 return $txpdb->get_results('SELECT 93 94 95 96 97 98 93 user_id, 94 name, 95 RealName, 96 email, 97 privs 98 FROM '.$prefix.'txp_users', ARRAY_A); 99 99 } 100 100 … … 107 107 108 108 // Get Posts 109 return $txpdb->get_results('SELECT 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 109 return $txpdb->get_results('SELECT 110 ID, 111 Posted, 112 AuthorID, 113 LastMod, 114 Title, 115 Body, 116 Excerpt, 117 Category1, 118 Category2, 119 Status, 120 Keywords, 121 url_title, 122 comments_count 123 FROM '.$prefix.'textpattern 124 ', ARRAY_A); 125 125 } 126 126 … … 144 144 $prefix = get_option('tpre'); 145 145 146 return $txpdb->get_results('SELECT 147 148 149 150 151 152 153 FROM '.$prefix.'txp_link',154 ARRAY_A);155 } 156 157 function cat2wp($categories='') 146 return $txpdb->get_results('SELECT 147 id, 148 date, 149 category, 150 url, 151 linkname, 152 description 153 FROM '.$prefix.'txp_link', 154 ARRAY_A); 155 } 156 157 function cat2wp($categories='') 158 158 { 159 159 // General Housekeeping … … 165 165 { 166 166 echo '<p>'.__('Importing Categories...').'<br /><br /></p>'; 167 foreach ($categories as $category) 167 foreach ($categories as $category) 168 168 { 169 169 $count++; … … 227 227 ); 228 228 } 229 else 229 else 230 230 { 231 231 $ret_id = wp_insert_user(array( … … 303 303 { 304 304 $ret_id = wp_insert_post(array( 305 306 307 308 309 310 311 312 313 314 315 316 317 318 } 319 else 305 'ID' => $pinfo, 306 'post_date' => $Posted, 307 'post_date_gmt' => $post_date_gmt, 308 'post_author' => $authorid, 309 'post_modified' => $LastMod, 310 'post_modified_gmt' => $post_modified_gmt, 311 'post_title' => $Title, 312 'post_content' => $Body, 313 'post_excerpt' => $Excerpt, 314 'post_status' => $post_status, 315 'post_name' => $url_title, 316 'comment_count' => $comments_count) 317 ); 318 } 319 else 320 320 { 321 321 $ret_id = wp_insert_post(array( 322 323 324 325 326 327 328 329 330 331 332 333 322 'post_date' => $Posted, 323 'post_date_gmt' => $post_date_gmt, 324 'post_author' => $authorid, 325 'post_modified' => $LastMod, 326 'post_modified_gmt' => $post_modified_gmt, 327 'post_title' => $Title, 328 'post_content' => $Body, 329 'post_excerpt' => $Excerpt, 330 'post_status' => $post_status, 331 'post_name' => $url_title, 332 'comment_count' => $comments_count) 333 ); 334 334 } 335 335 $txpposts2wpposts[$ID] = $ret_id; … … 380 380 // Update comments 381 381 $ret_id = wp_update_comment(array( 382 383 384 385 386 387 388 389 390 391 } 392 else 382 'comment_ID' => $cinfo, 383 'comment_post_ID' => $comment_post_ID, 384 'comment_author' => $name, 385 'comment_author_email' => $email, 386 'comment_author_url' => $web, 387 'comment_date' => $posted, 388 'comment_content' => $message, 389 'comment_approved' => $comment_approved) 390 ); 391 } 392 else 393 393 { 394 394 // Insert comments 395 395 $ret_id = wp_insert_comment(array( 396 397 398 399 400 401 402 403 404 396 'comment_post_ID' => $comment_post_ID, 397 'comment_author' => $name, 398 'comment_author_email' => $email, 399 'comment_author_url' => $web, 400 'comment_author_IP' => $ip, 401 'comment_date' => $posted, 402 'comment_content' => $message, 403 'comment_approved' => $comment_approved) 404 ); 405 405 } 406 406 $txpcm2wpcm[$comment_ID] = $ret_id; … … 451 451 ); 452 452 } 453 else 453 else 454 454 { 455 455 $ret_id = wp_insert_link(array( … … 473 473 } 474 474 475 function import_categories() 475 function import_categories() 476 476 { 477 477 // Category Import … … 491 491 { 492 492 // User Import 493 $users = $this->get_txp_users(); 493 $users = $this->get_txp_users(); 494 494 $this->users2wp($users); 495 495 … … 579 579 } 580 580 581 function dispatch() 581 function dispatch() 582 582 { 583 583 … … 588 588 $this->header(); 589 589 590 if ( $step > 0 ) 590 if ( $step > 0 ) 591 591 { 592 592 if($_POST['dbuser']) … … 613 613 if(get_option('txphost')) 614 614 delete_option('txphost'); 615 add_option('txphost',$_POST['dbhost']); 615 add_option('txphost',$_POST['dbhost']); 616 616 } 617 617 if($_POST['dbprefix']) … … 619 619 if(get_option('tpre')) 620 620 delete_option('tpre'); 621 add_option('tpre',$_POST['dbprefix']); 621 add_option('tpre',$_POST['dbprefix']); 622 622 } 623 623 … … 625 625 } 626 626 627 switch ($step) 627 switch ($step) 628 628 { 629 629 default: … … 654 654 } 655 655 656 function Textpattern_Import() 656 function Textpattern_Import() 657 657 { 658 658 // Nothing.
Note: See TracChangeset
for help on using the changeset viewer.