Changeset 5136 for trunk/includes/admin/converters/bbPress1.php
- Timestamp:
- 11/04/2013 04:38:03 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/includes/admin/converters/bbPress1.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/converters/bbPress1.php
r4824 r5136 108 108 ); 109 109 110 // Forum type (bbPress v1.x Forum > 0 or Category = 0, Stored in postmeta) 111 $this->field_map[] = array( 112 'from_tablename' => 'meta', 113 'from_fieldname' => 'meta_value', 114 'join_tablename' => 'forums', 115 'join_type' => 'LEFT', 116 'join_expression' => 'ON meta.object_id = forums.forum_id AND meta.meta_key = "forum_is_category"', 117 'to_type' => 'forum', 118 'to_fieldname' => '_bbp_forum_type', 119 'callback_method' => 'callback_forum_type' 120 ); 121 110 122 // Forum dates. 111 123 $this->field_map[] = array( … … 149 161 ); 150 162 163 // Topic total reply count (Includes unpublished replies, Stored in postmeta) 164 $this->field_map[] = array( 165 'from_tablename' => 'topics', 166 'from_fieldname' => 'topic_posts', 167 'to_type' => 'topic', 168 'to_fieldname' => '_bbp_total_reply_count', 169 'callback_method' => 'callback_topic_reply_count' 170 ); 171 151 172 // Topic parent forum id (If no parent, then 0. Stored in postmeta) 152 173 $this->field_map[] = array( … … 178 199 $this->field_map[] = array( 179 200 'from_tablename' => 'topics', 180 'from_fieldname' => 'topic_ title',201 'from_fieldname' => 'topic_slug', 181 202 'to_type' => 'topic', 182 203 'to_fieldname' => 'post_name', … … 185 206 186 207 // Topic content. 187 // Note: We join the posts table because topics do not have content.208 // Note: We join the 'posts' table because 'topics' table does not include content. 188 209 $this->field_map[] = array( 189 210 'from_tablename' => 'posts', … … 197 218 ); 198 219 199 // Topic status (Spam, Trash or Publish )220 // Topic status (Spam, Trash or Publish, bbPress v1.x publish = 0, trash = 1 & spam = 2) 200 221 $this->field_map[] = array( 201 222 'from_tablename' => 'posts', … … 210 231 211 232 // Topic author ip (Stored in postmeta) 233 // Note: We join the 'posts' table because 'topics' table does not include author ip. 212 234 $this->field_map[] = array( 213 235 'from_tablename' => 'posts', … … 323 345 324 346 // Reply title. 325 // Note: We join the topics table because posttable does not include topic title.347 // Note: We join the 'topics' table because 'posts' table does not include topic title. 326 348 $this->field_map[] = array( 327 349 'from_tablename' => 'topics', … … 335 357 ); 336 358 359 // Reply slug (Clean name to avoid conflicts) 360 // Note: We join the 'topics' table because 'posts' table does not include topic title. 361 $this->field_map[] = array( 362 'from_tablename' => 'topics', 363 'from_fieldname' => 'topic_slug', 364 'join_tablename' => 'posts', 365 'join_type' => 'INNER', 366 'join_expression' => 'USING (topic_id) WHERE posts.post_position NOT IN (0,1)', 367 'to_type' => 'reply', 368 'to_fieldname' => 'post_name', 369 'callback_method' => 'callback_slug' 370 ); 371 337 372 // Reply author ip (Stored in postmeta) 338 373 $this->field_map[] = array( … … 352 387 ); 353 388 354 // Reply status (Spam, Trash or Publish )389 // Reply status (Spam, Trash or Publish, bbPress v1.x publish = 0, trash = 1 & spam = 2) 355 390 $this->field_map[] = array( 356 391 'from_tablename' => 'posts', … … 500 535 * strings. 501 536 * 502 * @param int $status bbPress 1.x numeric status537 * @param int $status bbPress 1.x numeric post status 503 538 * @return string WordPress safe 504 539 */ … … 522 557 523 558 /** 559 * Translate the forum type from bbPress 1.x numeric's to WordPress's strings. 560 * 561 * @param int $status bbPress 1.x numeric forum type 562 * @return string WordPress safe 563 */ 564 public function callback_forum_type( $status = 0 ) { 565 if ( $status == 1 ) { 566 $status = 'category'; 567 } else { 568 $status = 'forum'; 569 } 570 return $status; 571 } 572 573 /** 524 574 * Verify the topic reply count. 525 575 *
Note: See TracChangeset
for help on using the changeset viewer.