Changeset 5540
- Timestamp:
- 09/30/2014 11:16:56 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/converters/Drupal7.php
r5536 r5540 205 205 ); 206 206 207 // Topic status (Publish or Unpublished, Drupal v7.x publish = 1, pending = 0) 208 $this->field_map[] = array( 209 'from_tablename' => 'node', 210 'from_fieldname' => 'status', 211 'join_tablename' => 'forum_index', 212 'join_type' => 'INNER', 213 'join_expression' => 'ON node.nid = forum_index.nid', 214 'to_type' => 'topic', 215 'to_fieldname' => 'post_status', 216 'callback_method' => 'callback_status' 217 ); 218 207 219 // Sticky status (Stored in postmeta) 208 220 $this->field_map[] = array( … … 369 381 ); 370 382 383 // Reply status (Publish or Unpublished, Drupal v7.x publish = 1, pending = 0) 384 $this->field_map[] = array( 385 'from_tablename' => 'comment', 386 'from_fieldname' => 'status', 387 'to_type' => 'reply', 388 'to_fieldname' => 'post_status', 389 'callback_method' => 'callback_status' 390 ); 391 371 392 // Reply content. 372 393 // Note: We join the 'field_data_comment_body' table because 'comment' table does not include reply content. … … 528 549 $pass_array = unserialize( $serialized_pass ); 529 550 return ( $pass_array['hash'] == md5( md5( $password ). $pass_array['salt'] ) ); 551 } 552 553 /** 554 * Translate the post status from Drupal v7.x numeric's to WordPress's 555 * strings. 556 * 557 * @param int $status Drupal v7.x numeric post status 558 * @return string WordPress safe 559 */ 560 public function callback_status( $status = 1 ) { 561 switch ( $status ) { 562 case 0 : 563 $status = 'pending'; // bbp_get_pending_status_id() 564 break; 565 566 case 1 : 567 default : 568 $status = 'publish'; // bbp_get_public_status_id() 569 break; 570 } 571 return $status; 530 572 } 531 573
Note: See TracChangeset
for help on using the changeset viewer.