Changeset 5150
- Timestamp:
- 11/08/2013 03:47:31 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/includes/admin/converters/phpBB.php ¶
r4726 r5150 24 24 public function setup_globals() { 25 25 26 /** Forum Section ***************************************************** */26 /** Forum Section *****************************************************/ 27 27 28 28 // Forum id (Stored in postmeta) … … 66 66 ); 67 67 68 // Forum total reply count ( Stored in postmeta)68 // Forum total reply count (Includes unpublished replies, Stored in postmeta) 69 69 $this->field_map[] = array( 70 70 'from_tablename' => 'forums', … … 108 108 ); 109 109 110 // Forum status (Locked =1 Unlocked =0, Stored in postmeta) 110 // Forum type (Category = 0 or Forum = 1, Stored in postmeta) 111 $this->field_map[] = array( 112 'from_tablename' => 'forums', 113 'from_fieldname' => 'forum_type', 114 'to_type' => 'forum', 115 'to_fieldname' => '_bbp_forum_type', 116 'callback_method' => 'callback_forum_type' 117 ); 118 119 // Forum status (Unlocked = 0 or Locked = 1, Stored in postmeta) 111 120 $this->field_map[] = array( 112 121 'from_tablename' => 'forums', … … 139 148 ); 140 149 141 /** Topic Section ***************************************************** */150 /** Topic Section *****************************************************/ 142 151 143 152 // Topic id (Stored in postmeta) … … 186 195 187 196 // Topic content. 188 // Note: We join the posts table because topicsdo not have content.197 // Note: We join the 'posts' table because 'topics' do not have content. 189 198 $this->field_map[] = array( 190 199 'from_tablename' => 'posts', … … 280 289 'to_fieldname' => '_bbp_author_ip' 281 290 ); 282 283 // Sticky Status284 291 285 292 /** Tags Section ******************************************************/ … … 346 353 // Reply title. 347 354 $this->field_map[] = array( 348 'from_tablename' => 'posts', 349 'from_fieldname' => 'post_subject', 350 'to_type' => 'reply', 351 'to_fieldname' => 'post_title' 355 'from_tablename' => 'posts', 356 'from_fieldname' => 'post_subject', 357 'to_type' => 'reply', 358 'to_fieldname' => 'post_title', 359 'callback_method' => 'callback_reply_title' 352 360 ); 353 361 … … 692 700 693 701 /** 702 * Translate the forum type from phpBB v3.x numeric's to WordPress's strings. 703 * 704 * @param int $status phpBB v3.x numeric forum type 705 * @return string WordPress safe 706 */ 707 public function callback_forum_type( $status = 1 ) { 708 switch ( $status ) { 709 case 0 : 710 $status = 'category'; 711 break; 712 713 case 1 : 714 default : 715 $status = 'forum'; 716 break; 717 } 718 return $status; 719 } 720 721 /** 694 722 * Translate the forum status from phpBB v3.x numeric's to WordPress's strings. 695 723 * … … 723 751 break; 724 752 725 case 0 753 case 0 : 726 754 default : 727 755 $status = 'publish'; … … 740 768 $count = absint( (int) $count - 1 ); 741 769 return $count; 770 } 771 772 /** 773 * Set the reply title 774 * 775 * @param string $title phpBB v3.x topic title of this reply 776 * @return string Prefixed topic title, or empty string 777 */ 778 public function callback_reply_title( $title = '' ) { 779 $title = !empty( $title ) ? __( 'Re: ', 'bbpress' ) . html_entity_decode( $title ) : ''; 780 return $title; 742 781 } 743 782
Note: See TracChangeset
for help on using the changeset viewer.