diff --git a/bbPress/admin/converters/vBulletin3.php b/bbPress/admin/converters/vBulletin3.php
index 0396a48..f77c7fe 100644
a
|
b
|
class vBulletin3 extends BBP_Converter_Base { |
57 | 57 | 'to_fieldname' => '_bbp_reply_count' |
58 | 58 | ); |
59 | 59 | |
| 60 | // Forum total topic count (Includes unpublished topics, Stored in postmeta) |
| 61 | $this->field_map[] = array( |
| 62 | 'from_tablename' => 'forum', |
| 63 | 'from_fieldname' => 'threadcount', |
| 64 | 'to_type' => 'forum', |
| 65 | 'to_fieldname' => '_bbp_total_topic_count' |
| 66 | ); |
| 67 | |
| 68 | // Forum total reply count (Includes unpublished replies, Stored in postmeta) |
| 69 | $this->field_map[] = array( |
| 70 | 'from_tablename' => 'forum', |
| 71 | 'from_fieldname' => 'replycount', |
| 72 | 'to_type' => 'forum', |
| 73 | 'to_fieldname' => '_bbp_total_reply_count' |
| 74 | ); |
| 75 | |
60 | 76 | // Forum title. |
61 | 77 | $this->field_map[] = array( |
62 | 78 | 'from_tablename' => 'forum', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
91 | 107 | 'to_fieldname' => 'menu_order' |
92 | 108 | ); |
93 | 109 | |
| 110 | // Forum type (Category = -1 or Forum > 0, Stored in postmeta) |
| 111 | $this->field_map[] = array( |
| 112 | 'from_tablename' => 'forum', |
| 113 | 'from_fieldname' => 'parentid', |
| 114 | 'to_type' => 'forum', |
| 115 | 'to_fieldname' => '_bbp_forum_type', |
| 116 | 'callback_method' => 'callback_forum_type' |
| 117 | ); |
| 118 | |
94 | 119 | // Forum dates. |
95 | 120 | $this->field_map[] = array( |
96 | 121 | 'to_type' => 'forum', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
141 | 166 | 'callback_method' => 'callback_topic_reply_count' |
142 | 167 | ); |
143 | 168 | |
| 169 | // Topic total reply count (Includes unpublished replies, Stored in postmeta) |
| 170 | $this->field_map[] = array( |
| 171 | 'from_tablename' => 'thread', |
| 172 | 'from_fieldname' => 'replycount', |
| 173 | 'to_type' => 'topic', |
| 174 | 'to_fieldname' => '_bbp_total_reply_count', |
| 175 | 'callback_method' => 'callback_topic_reply_count' |
| 176 | ); |
| 177 | |
144 | 178 | // Topic author. |
145 | 179 | $this->field_map[] = array( |
146 | 180 | 'from_tablename' => 'thread', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
150 | 184 | 'callback_method' => 'callback_userid' |
151 | 185 | ); |
152 | 186 | |
| 187 | // Topic Author ip (Stored in postmeta) |
| 188 | // Note: We join the 'post' table because 'thread' table does not include topic content. |
| 189 | $this->field_map[] = array( |
| 190 | 'from_tablename' => 'post', |
| 191 | 'from_fieldname' => 'ipaddress', |
| 192 | 'join_tablename' => 'thread', |
| 193 | 'join_type' => 'INNER', |
| 194 | 'join_expression' => 'USING (threadid) WHERE post.parentid = 0', |
| 195 | 'to_type' => 'topic', |
| 196 | 'to_fieldname' => '_bbp_author_ip' |
| 197 | ); |
| 198 | |
153 | 199 | // Topic title. |
154 | 200 | $this->field_map[] = array( |
155 | 201 | 'from_tablename' => 'thread', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
177 | 223 | ); |
178 | 224 | |
179 | 225 | // Topic content. |
180 | | // Note: We join the posts table because topics do not have content. |
| 226 | // Note: We join the 'post' table because 'thread' table does not include topic content. |
181 | 227 | $this->field_map[] = array( |
182 | 228 | 'from_tablename' => 'post', |
183 | 229 | 'from_fieldname' => 'pagetext', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
276 | 322 | ); |
277 | 323 | |
278 | 324 | // Reply parent forum id (If no parent, then 0. Stored in postmeta) |
| 325 | // Note: We join the 'thread' table because 'post' table does not include forum id. |
279 | 326 | $this->field_map[] = array( |
280 | 327 | 'from_tablename' => 'thread', |
281 | 328 | 'from_fieldname' => 'forumid', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
314 | 361 | ); |
315 | 362 | |
316 | 363 | // Reply title. |
317 | | // Note: We join the thread table because post table does not include topic title. |
| 364 | // Note: We join the 'thread' table because 'post' table does not include reply title. |
318 | 365 | $this->field_map[] = array( |
319 | 366 | 'from_tablename' => 'thread', |
320 | 367 | 'from_fieldname' => 'title', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
326 | 373 | 'callback_method' => 'callback_reply_title' |
327 | 374 | ); |
328 | 375 | |
| 376 | // Reply slug (Clean name to avoid conflicts) |
| 377 | // Note: We join the 'thread' table because 'post' table does not include reply slug. |
| 378 | $this->field_map[] = array( |
| 379 | 'from_tablename' => 'thread', |
| 380 | 'from_fieldname' => 'title', |
| 381 | 'join_tablename' => 'post', |
| 382 | 'join_type' => 'INNER', |
| 383 | 'join_expression' => 'USING (threadid) WHERE post.parentid != 0', |
| 384 | 'to_type' => 'reply', |
| 385 | 'to_fieldname' => 'post_name', |
| 386 | 'callback_method' => 'callback_slug' |
| 387 | ); |
| 388 | |
329 | 389 | // Reply content. |
330 | 390 | $this->field_map[] = array( |
331 | 391 | 'from_tablename' => 'post', |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
405 | 465 | $this->field_map[] = array( |
406 | 466 | 'to_type' => 'user', |
407 | 467 | 'to_fieldname' => '_bbp_class', |
408 | | 'default' => 'vBulletin' |
| 468 | 'default' => 'vBulletin3' |
409 | 469 | ); |
410 | 470 | |
411 | 471 | // User name. |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
462 | 522 | 'from_tablename' => 'user', |
463 | 523 | 'from_fieldname' => 'icq', |
464 | 524 | 'to_type' => 'user', |
465 | | 'to_fieldname' => '_bbp_vbulletin_user_icq' |
| 525 | 'to_fieldname' => '_bbp_vbulletin3_user_icq' |
466 | 526 | ); |
467 | 527 | |
468 | 528 | // User MSN (Stored in usermeta) |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
470 | 530 | 'from_tablename' => 'user', |
471 | 531 | 'from_fieldname' => 'msn', |
472 | 532 | 'to_type' => 'user', |
473 | | 'to_fieldname' => '_bbp_vbulletin_user_msn' |
| 533 | 'to_fieldname' => '_bbp_vbulletin3_user_msn' |
474 | 534 | ); |
475 | 535 | |
476 | 536 | // User Skype (Stored in usermeta) |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
478 | 538 | 'from_tablename' => 'user', |
479 | 539 | 'from_fieldname' => 'skype', |
480 | 540 | 'to_type' => 'user', |
481 | | 'to_fieldname' => '_bbp_vbulletin_user_skype' |
| 541 | 'to_fieldname' => '_bbp_vbulletin3_user_skype' |
482 | 542 | ); |
483 | 543 | } |
484 | 544 | |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
516 | 576 | } |
517 | 577 | |
518 | 578 | /** |
| 579 | * Translate the forum type from vBulletin v3.x numeric's to WordPress's strings. |
| 580 | * |
| 581 | * @param int $status vBulletin v3.x numeric forum type |
| 582 | * @return string WordPress safe |
| 583 | */ |
| 584 | public function callback_forum_type( $status = 0 ) { |
| 585 | if ( $status == -1 ) { |
| 586 | $status = 'category'; |
| 587 | } else { |
| 588 | $status = 'forum'; |
| 589 | } |
| 590 | return $status; |
| 591 | } |
| 592 | |
| 593 | /** |
519 | 594 | * Verify the topic reply count. |
520 | 595 | * |
521 | | * @param int $count vBulletin v4.x reply count |
| 596 | * @param int $count vBulletin v3.x reply count |
522 | 597 | * @return string WordPress safe |
523 | 598 | */ |
524 | 599 | public function callback_topic_reply_count( $count = 1 ) { |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
529 | 604 | /** |
530 | 605 | * Set the reply title |
531 | 606 | * |
532 | | * @param string $title vBulletin v4.x topic title of this reply |
| 607 | * @param string $title vBulletin v3.x topic title of this reply |
533 | 608 | * @return string Prefixed topic title, or empty string |
534 | 609 | */ |
535 | 610 | public function callback_reply_title( $title = '' ) { |
… |
… |
class vBulletin3 extends BBP_Converter_Base { |
538 | 613 | } |
539 | 614 | |
540 | 615 | /** |
541 | | * Translate the post status from vBulletin numeric's to WordPress's strings. |
| 616 | * Translate the post status from vBulletin v3.x numeric's to WordPress's strings. |
542 | 617 | * |
543 | | * @param int $status vBulletin v4.x numeric topic status |
| 618 | * @param int $status vBulletin v3.x numeric topic status |
544 | 619 | * @return string WordPress safe |
545 | 620 | */ |
546 | 621 | public function callback_topic_status( $status = 1 ) { |