Ticket #2126: 2126.1.diff
File 2126.1.diff, 32.6 KB (added by , 10 years ago) |
---|
-
includes/admin/converter.php
437 437 438 438 break; 439 439 440 // STEP 7. Convert tags.440 // STEP 7. Stick topics. 441 441 case 7 : 442 if ( $converter->convert_topic_stickies( $start ) ) { 443 update_option( '_bbp_converter_step', $step + 1 ); 444 update_option( '_bbp_converter_start', 0 ); 445 if ( empty( $start ) ) { 446 $this->converter_output( __( 'No stickies to stick', 'bbpress' ) ); 447 } 448 } else { 449 update_option( '_bbp_converter_start', $max + 1 ); 450 $this->converter_output( sprintf( __( 'Calculating topic stickies (%1$s - %2$s)', 'bbpress' ), $min, $max ) ); 451 } 452 453 break; 454 455 // STEP 8. Stick to front topics (Super Sicky). 456 case 8 : 457 if ( $converter->convert_topic_super_stickies( $start ) ) { 458 update_option( '_bbp_converter_step', $step + 1 ); 459 update_option( '_bbp_converter_start', 0 ); 460 if ( empty( $start ) ) { 461 $this->converter_output( __( 'No super stickies to stick', 'bbpress' ) ); 462 } 463 } else { 464 update_option( '_bbp_converter_start', $max + 1 ); 465 $this->converter_output( sprintf( __( 'Calculating topic super stickies (%1$s - %2$s)', 'bbpress' ), $min, $max ) ); 466 } 467 468 break; 469 470 // STEP 9. Convert tags. 471 case 9 : 442 472 if ( $converter->convert_tags( $start ) ) { 443 473 update_option( '_bbp_converter_step', $step + 1 ); 444 474 update_option( '_bbp_converter_start', 0 ); … … 452 482 453 483 break; 454 484 455 // STEP 8. Convert replies.456 case 8:485 // STEP 10. Convert replies. 486 case 10 : 457 487 if ( $converter->convert_replies( $start ) ) { 458 488 update_option( '_bbp_converter_step', $step + 1 ); 459 489 update_option( '_bbp_converter_start', 0 ); … … 467 497 468 498 break; 469 499 470 // STEP 9. Convert reply_to parents.471 case 9:500 // STEP 11. Convert reply_to parents. 501 case 11 : 472 502 if ( $converter->convert_reply_to_parents( $start ) ) { 473 503 update_option( '_bbp_converter_step', $step + 1 ); 474 504 update_option( '_bbp_converter_start', 0 ); … … 1028 1058 } 1029 1059 1030 1060 /** 1061 * This method converts old topic stickies to new bbPress stickies. 1062 * 1063 * @since bbPress (r) 1064 * 1065 * @uses WPDB $wpdb 1066 * @uses bbp_stick_topic() to set the imported topic as sticky 1067 * 1068 */ 1069 public function convert_topic_stickies( $start ) { 1070 1071 $has_update = false; 1072 1073 if ( !empty( $this->sync_table ) ) { 1074 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows; 1075 } else { 1076 $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "sticky" LIMIT ' . $start . ', ' . $this->max_rows; 1077 } 1078 1079 update_option( '_bbp_converter_query', $query ); 1080 1081 $sticky_array = $this->wpdb->get_results( $query ); 1082 1083 foreach ( (array) $sticky_array as $row ) { 1084 bbp_stick_topic( $row->value_id ); 1085 $has_update = true; 1086 } 1087 1088 return ! $has_update; 1089 } 1090 1091 /** 1092 * This method converts old topic super stickies to new bbPress super stickies. 1093 * 1094 * @since bbPress (r) 1095 * 1096 * @uses WPDB $wpdb 1097 * @uses bbp_stick_topic() to set the imported topic as super sticky 1098 * 1099 */ 1100 public function convert_topic_super_stickies( $start ) { 1101 1102 $has_update = false; 1103 1104 if ( !empty( $this->sync_table ) ) { 1105 $query = 'SELECT value_id, meta_value FROM ' . $this->sync_table_name . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "super-sticky" LIMIT ' . $start . ', ' . $this->max_rows; 1106 } else { 1107 $query = 'SELECT post_id AS value_id, meta_value FROM ' . $this->wpdb->postmeta . ' WHERE meta_key = "_bbp_old_sticky_status" AND meta_value = "super-sticky" LIMIT ' . $start . ', ' . $this->max_rows; 1108 } 1109 1110 update_option( '_bbp_converter_query', $query ); 1111 1112 $sticky_array = $this->wpdb->get_results( $query ); 1113 1114 foreach ( (array) $sticky_array as $row ) { 1115 $super = true; 1116 bbp_stick_topic( $row->value_id, $super ); 1117 $has_update = true; 1118 } 1119 1120 return ! $has_update; 1121 } 1122 1123 /** 1031 1124 * This method converts old reply_to post id to new bbPress reply_to post id. 1032 1125 */ 1033 1126 public function convert_reply_to_parents( $start ) { -
includes/admin/converters/AEF.php
239 239 'callback_method' => 'callback_forumid' 240 240 ); 241 241 242 // Sticky status (Stored in postmeta)) 243 $this->field_map[] = array( 244 'from_tablename' => 'topics', 245 'from_fieldname' => 't_sticky', 246 'to_type' => 'topic', 247 'to_fieldname' => '_bbp_old_sticky_status', 248 'callback_method' => 'callback_sticky_status' 249 ); 250 242 251 // Topic dates. 243 252 // Note: We join the 'posts' table because 'topics' table does not include topic dates. 244 253 $this->field_map[] = array( … … 639 648 } 640 649 641 650 /** 651 * Translate the topic sticky status type from AEF 1.x numeric's to WordPress's strings. 652 * 653 * @param int $status AEF 1.x numeric forum type 654 * @return string WordPress safe 655 */ 656 public function callback_sticky_status( $status = 0 ) { 657 switch ( $status ) { 658 case 1 : 659 $status = 'sticky'; // AEF Sticky 't_sticky = 1' 660 break; 661 662 case 0 : 663 default : 664 $status = 'normal'; // AEF normal topic 't_sticky = 0' 665 break; 666 } 667 return $status; 668 } 669 670 /** 642 671 * Verify the topic/reply count. 643 672 * 644 673 * @param int $count AEF v1.0.9 topic/reply counts -
includes/admin/converters/bbPress1.php
250 250 'callback_method' => 'callback_forumid' 251 251 ); 252 252 253 // Sticky status (Stored in postmeta)) 254 $this->field_map[] = array( 255 'from_tablename' => 'topics', 256 'from_fieldname' => 'topic_sticky', 257 'to_type' => 'topic', 258 'to_fieldname' => '_bbp_old_sticky_status', 259 'callback_method' => 'callback_sticky_status' 260 ); 261 253 262 // Topic dates. 254 263 $this->field_map[] = array( 255 264 'from_tablename' => 'topics', … … 357 366 ); 358 367 359 368 // Reply slug (Clean name to avoid conflicts) 360 // Note: We join the 'topics' table because 'posts' table does not include topic title.369 // Note: We join the 'topics' table because 'posts' table does not include topic slug. 361 370 $this->field_map[] = array( 362 371 'from_tablename' => 'topics', 363 372 'from_fieldname' => 'topic_slug', … … 571 580 } 572 581 573 582 /** 583 * Translate the topic sticky status type from bbPress 1.x numeric's to WordPress's strings. 584 * 585 * @param int $status bbPress 1.x numeric forum type 586 * @return string WordPress safe 587 */ 588 public function callback_sticky_status( $status = 0 ) { 589 switch ( $status ) { 590 case 2 : 591 $status = 'super-sticky'; // bbPress Super Sticky 'topic_sticky = 2' 592 break; 593 594 case 1 : 595 $status = 'sticky'; // bbPress Sticky 'topic_sticky = 1' 596 break; 597 598 case 0 : 599 default : 600 $status = 'normal'; // bbPress Normal Topic 'topic_sticky = 0' 601 break; 602 } 603 return $status; 604 } 605 606 /** 574 607 * Verify the topic reply count. 575 608 * 576 609 * @param int $count bbPress 1.x topic and reply counts -
includes/admin/converters/Drupal7.php
190 190 'callback_method' => 'callback_forumid' 191 191 ); 192 192 193 // Sticky status (Stored in postmeta)) 194 $this->field_map[] = array( 195 'from_tablename' => 'forum_index', 196 'from_fieldname' => 'sticky', 197 'to_type' => 'topic', 198 'to_fieldname' => '_bbp_old_sticky_status', 199 'callback_method' => 'callback_sticky_status' 200 ); 201 193 202 // Topic dates. 194 203 $this->field_map[] = array( 195 204 'from_tablename' => 'forum_index', … … 549 558 } 550 559 551 560 /** 561 * Translate the topic sticky status type from Drupal v7.x numeric's to WordPress's strings. 562 * 563 * @param int $status Drupal v7.x numeric forum type 564 * @return string WordPress safe 565 */ 566 public function callback_sticky_status( $status = 0 ) { 567 switch ( $status ) { 568 case 1 : 569 $status = 'sticky'; // Drupal Sticky 'topic_sticky = 1' 570 break; 571 572 case 0 : 573 default : 574 $status = 'normal'; // Drupal Normal Topic 'sticky = 0' 575 break; 576 } 577 return $status; 578 } 579 580 /** 552 581 * Verify the topic/reply count. 553 582 * 554 583 * @param int $count Drupal v7.x topic/reply counts -
includes/admin/converters/Example.php
1 1 <?php 2 2 3 3 /** 4 * Example converter base impoprter template for bbPress 4 * Example converter base impoprter template for bbPress 5 5 * 6 6 * @since bbPress (r4689) 7 7 * @link Codex Docs http://codex.bbpress.org/import-forums/custom-import … … 233 233 'callback_method' => 'callback_forumid' 234 234 ); 235 235 236 // Sticky status (Stored in postmeta)) 237 $this->field_map[] = array( 238 'from_tablename' => 'topics_table', 239 'from_fieldname' => 'the_topic_sticky_status', 240 'to_type' => 'topic', 241 'to_fieldname' => '_bbp_old_sticky_status', 242 'callback_method' => 'callback_sticky_status' 243 ); 244 236 245 // Topic dates. 237 246 $this->field_map[] = array( 238 247 'from_tablename' => 'topics_table', … … 357 366 'to_type' => 'reply', 358 367 'to_fieldname' => '_bbp_author_ip' 359 368 ); 360 369 361 370 // Reply author. 362 371 $this->field_map[] = array( 363 372 'from_tablename' => 'replies_table', … … 454 463 /** User Section ******************************************************/ 455 464 456 465 // Setup table joins for the user section at the base of this section 457 466 458 467 // Store old User id (Stored in usermeta) 459 468 $this->field_map[] = array( 460 469 'from_tablename' => 'users_table', -
includes/admin/converters/FluxBB.php
222 222 'callback_method' => 'callback_forumid' 223 223 ); 224 224 225 // Sticky status (Stored in postmeta)) 226 $this->field_map[] = array( 227 'from_tablename' => 'topics', 228 'from_fieldname' => 'sticky', 229 'to_type' => 'topic', 230 'to_fieldname' => '_bbp_old_sticky_status', 231 'callback_method' => 'callback_sticky_status' 232 ); 233 225 234 // Topic dates. 226 235 $this->field_map[] = array( 227 236 'from_tablename' => 'topics', … … 594 603 } 595 604 596 605 /** 606 * Translate the topic sticky status type from FluxBB v1.5.3 numeric's to WordPress's strings. 607 * 608 * @param int $status FluxBB v1.5.3 numeric forum type 609 * @return string WordPress safe 610 */ 611 public function callback_sticky_status( $status = 0 ) { 612 switch ( $status ) { 613 case 1 : 614 $status = 'sticky'; // FluxBB Sticky 'sticky = 1' 615 break; 616 617 case 0 : 618 default : 619 $status = 'normal'; // FluxBB Normal Topic 'sticky = 0' 620 break; 621 } 622 return $status; 623 } 624 625 /** 597 626 * Verify the topic/reply count. 598 627 * 599 628 * @param int $count FluxBB v1.5.3 topic/reply counts -
includes/admin/converters/Invision.php
214 214 'callback_method' => 'callback_forumid' 215 215 ); 216 216 217 // Sticky status (Stored in postmeta)) 218 $this->field_map[] = array( 219 'from_tablename' => 'topics', 220 'from_fieldname' => 'pinned', 221 'to_type' => 'topic', 222 'to_fieldname' => '_bbp_old_sticky_status', 223 'callback_method' => 'callback_sticky_status' 224 ); 225 217 226 // Topic dates. 218 227 $this->field_map[] = array( 219 228 'from_tablename' => 'topics', … … 476 485 } 477 486 478 487 /** 488 * Translate the topic sticky status type from Invision numeric's to WordPress's strings. 489 * 490 * @param int $status Invision numeric forum type 491 * @return string WordPress safe 492 */ 493 public function callback_sticky_status( $status = 0 ) { 494 switch ( $status ) { 495 case 1 : 496 $status = 'sticky'; // Invision Pinned Topic 'pinned = 1' 497 break; 498 499 case 0 : 500 default : 501 $status = 'normal'; // Invision Normal Topic 'pinned = 0' 502 break; 503 } 504 return $status; 505 } 506 507 /** 479 508 * Verify the topic reply count. 480 509 * 481 510 * @param int $count Invision reply count -
includes/admin/converters/Mingle.php
162 162 'callback_method' => 'callback_forumid' 163 163 ); 164 164 165 // Sticky status (Stored in postmeta)) 166 $this->field_map[] = array( 167 'from_tablename' => 'forum_threads', 168 'from_fieldname' => 'status', 169 'to_type' => 'topic', 170 'to_fieldname' => '_bbp_old_sticky_status', 171 'callback_method' => 'callback_sticky_status' 172 ); 173 165 174 // Topic dates. 166 175 $this->field_map[] = array( 167 176 'from_tablename' => 'forum_threads', … … 441 450 } 442 451 443 452 /** 453 * Translate the topic sticky status type from Mingle numeric's to WordPress's strings. 454 * 455 * @param int $status Mingle numeric forum type 456 * @return string WordPress safe 457 */ 458 public function callback_sticky_status( $status = 0 ) { 459 switch ( $status ) { 460 case 'sticky' : 461 $status = 'sticky'; // Mingle Sticky 'status = sticky' 462 break; 463 464 case 'open' : 465 default : 466 $status = 'normal'; // Mingle Normal Topic 'status = open' 467 break; 468 } 469 return $status; 470 } 471 472 /** 444 473 * This callback processes any custom BBCodes with parser.php 445 474 */ 446 475 protected function callback_html( $field ) { -
includes/admin/converters/MyBB.php
209 209 'callback_method' => 'callback_forumid' 210 210 ); 211 211 212 // Sticky status (Stored in postmeta)) 213 $this->field_map[] = array( 214 'from_tablename' => 'threads', 215 'from_fieldname' => 'sticky', 216 'to_type' => 'topic', 217 'to_fieldname' => '_bbp_old_sticky_status', 218 'callback_method' => 'callback_sticky_status' 219 ); 220 212 221 // Topic dates. 213 222 $this->field_map[] = array( 214 223 'from_tablename' => 'threads', … … 549 558 } 550 559 551 560 /** 561 * Translate the topic sticky status type from MyBB v1.6.10 numeric's to WordPress's strings. 562 * 563 * @param int $status MyBB v1.6.10 numeric forum type 564 * @return string WordPress safe 565 */ 566 public function callback_sticky_status( $status = 0 ) { 567 switch ( $status ) { 568 case 1 : 569 $status = 'sticky'; // MyBB Sticky 'topic_sticky = 1' 570 break; 571 572 case 0 : 573 default : 574 $status = 'normal'; // MyBB Normal Topic 'topic_sticky = 0' 575 break; 576 } 577 return $status; 578 } 579 580 /** 552 581 * Verify the topic/reply count. 553 582 * 554 583 * @param int $count MyBB v1.6.10 topic/reply counts -
includes/admin/converters/phpBB.php
193 193 'callback_method' => 'callback_userid' 194 194 ); 195 195 196 // Topic Author ip (Stored in postmeta) 197 $this->field_map[] = array( 198 'from_tablename' => 'posts', 199 'from_fieldname' => 'poster_ip', 200 'join_tablename' => 'topics', 201 'join_type' => 'INNER', 202 'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id', 203 'to_type' => 'topic', 204 'to_fieldname' => '_bbp_author_ip' 205 ); 206 196 207 // Topic content. 197 // Note: We join the 'posts' table because 'topics' do not havecontent.208 // Note: We join the 'posts' table because 'topics' does not include topic content. 198 209 $this->field_map[] = array( 199 210 'from_tablename' => 'posts', 200 211 'from_fieldname' => 'post_text', … … 223 234 'callback_method' => 'callback_slug' 224 235 ); 225 236 237 // Topic status (Open or Closed) 238 $this->field_map[] = array( 239 'from_tablename' => 'topics', 240 'from_fieldname' => 'topic_status', 241 'to_type' => 'topic', 242 'to_fieldname' => 'post_status', 243 'callback_method' => 'callback_topic_status' 244 ); 245 226 246 // Topic parent forum id (If no parent, then 0) 227 247 $this->field_map[] = array( 228 248 'from_tablename' => 'topics', … … 232 252 'callback_method' => 'callback_forumid' 233 253 ); 234 254 255 // Sticky status (Stored in postmeta)) 256 $this->field_map[] = array( 257 'from_tablename' => 'topics', 258 'from_fieldname' => 'topic_type', 259 'to_type' => 'topic', 260 'to_fieldname' => '_bbp_old_sticky_status', 261 'callback_method' => 'callback_sticky_status' 262 ); 263 235 264 // Topic dates. 236 265 $this->field_map[] = array( 237 266 'from_tablename' => 'topics', … … 269 298 'callback_method' => 'callback_datetime' 270 299 ); 271 300 272 // Topic status (Open or Closed)273 $this->field_map[] = array(274 'from_tablename' => 'topics',275 'from_fieldname' => 'topic_status',276 'to_type' => 'topic',277 'to_fieldname' => 'post_status',278 'callback_method' => 'callback_topic_status'279 );280 281 // Topic Author ip (Stored in postmeta)282 $this->field_map[] = array(283 'from_tablename' => 'posts',284 'from_fieldname' => 'poster_ip',285 'join_tablename' => 'topics',286 'join_type' => 'INNER',287 'join_expression' => 'USING (topic_id) WHERE posts.post_id = topics.topic_first_post_id',288 'to_type' => 'topic',289 'to_fieldname' => '_bbp_author_ip'290 );291 292 301 /** Tags Section ******************************************************/ 293 302 294 303 /** … … 759 768 } 760 769 761 770 /** 771 * Translate the topic sticky status type from phpBB 3.x numeric's to WordPress's strings. 772 * 773 * @param int $status phpBB 3.x numeric forum type 774 * @return string WordPress safe 775 */ 776 public function callback_sticky_status( $status = 0 ) { 777 switch ( $status ) { 778 case 3 : 779 $status = 'super-sticky'; // phpBB Global Sticky 'topic_type = 3' 780 break; 781 782 case 2 : 783 $status = 'super-sticky'; // phpBB Announcement Sticky 'topic_type = 2' 784 break; 785 786 case 1 : 787 $status = 'sticky'; // phpBB Sticky 'topic_type = 1' 788 break; 789 790 case 0 : 791 default : 792 $status = 'normal'; // phpBB normal topic 'topic_type = 0' 793 break; 794 } 795 return $status; 796 } 797 798 /** 762 799 * Verify the topic reply count. 763 800 * 764 801 * @param int $count phpBB v3.x reply count -
includes/admin/converters/PHPFox3.php
233 233 'callback_method' => 'callback_forumid' 234 234 ); 235 235 236 // Topic status (Open or Closed, PHPFox v3.5.x 0=open & 1=closed) 237 $this->field_map[] = array( 238 'from_tablename' => 'forum_thread', 239 'from_fieldname' => 'is_closed', 240 'to_type' => 'topic', 241 'to_fieldname' => 'post_status', 242 'callback_method' => 'callback_topic_status' 243 ); 244 245 // Sticky status (Stored in postmeta)) 246 $this->field_map[] = array( 247 'from_tablename' => 'forum_thread', 248 'from_fieldname' => 'order_id', 249 'to_type' => 'topic', 250 'to_fieldname' => '_bbp_old_sticky_status', 251 'callback_method' => 'callback_sticky_status' 252 ); 253 236 254 // Topic dates. 237 255 $this->field_map[] = array( 238 256 'from_tablename' => 'forum_thread', … … 270 288 'callback_method' => 'callback_datetime' 271 289 ); 272 290 273 // Topic status (Open or Closed, PHPFox v3.5.x 0=open & 1=closed)274 $this->field_map[] = array(275 'from_tablename' => 'forum_thread',276 'from_fieldname' => 'is_closed',277 'to_type' => 'topic',278 'to_fieldname' => 'post_status',279 'callback_method' => 'callback_topic_status'280 );281 282 291 /** Tags Section ******************************************************/ 283 292 284 293 // Topic id. … … 591 600 } 592 601 593 602 /** 603 * Translate the topic sticky status type from PHPFox v3.5.x numeric's to WordPress's strings. 604 * 605 * @param int $status PHPFox v3.5.x numeric forum type 606 * @return string WordPress safe 607 */ 608 public function callback_sticky_status( $status = 0 ) { 609 switch ( $status ) { 610 case 1 : 611 $status = 'sticky'; // PHPFox Sticky 'topic_sticky = 1' 612 break; 613 614 case 0 : 615 default : 616 $status = 'normal'; // PHPFox Normal Topic 'topic_sticky = 0' 617 break; 618 } 619 return $status; 620 } 621 622 /** 594 623 * Verify the topic/reply count. 595 624 * 596 625 * @param int $count PHPFox v3.5.x topic/reply counts -
includes/admin/converters/PunBB.php
222 222 'callback_method' => 'callback_forumid' 223 223 ); 224 224 225 // Topic status (Open or Closed, PunBB v1.4.2 0=open & 1=closed) 226 $this->field_map[] = array( 227 'from_tablename' => 'topics', 228 'from_fieldname' => 'closed', 229 'to_type' => 'topic', 230 'to_fieldname' => 'post_status', 231 'callback_method' => 'callback_topic_status' 232 ); 233 234 // Sticky status (Stored in postmeta)) 235 $this->field_map[] = array( 236 'from_tablename' => 'topics', 237 'from_fieldname' => 'sticky', 238 'to_type' => 'topic', 239 'to_fieldname' => '_bbp_old_sticky_status', 240 'callback_method' => 'callback_sticky_status' 241 ); 225 242 // Topic dates. 226 243 $this->field_map[] = array( 227 244 'from_tablename' => 'topics', … … 259 276 'callback_method' => 'callback_datetime' 260 277 ); 261 278 262 // Topic status (Open or Closed, PunBB v1.4.2 0=open & 1=closed)263 $this->field_map[] = array(264 'from_tablename' => 'topics',265 'from_fieldname' => 'closed',266 'to_type' => 'topic',267 'to_fieldname' => 'post_status',268 'callback_method' => 'callback_topic_status'269 );270 271 279 /** Tags Section ******************************************************/ 272 280 273 281 /** … … 629 637 } 630 638 631 639 /** 640 * Translate the topic sticky status type from PunBB v1.4.2 numeric's to WordPress's strings. 641 * 642 * @param int $status PunBB v1.4.2 numeric forum type 643 * @return string WordPress safe 644 */ 645 public function callback_sticky_status( $status = 0 ) { 646 switch ( $status ) { 647 case 1 : 648 $status = 'sticky'; // PunBB Sticky 'topic_sticky = 1' 649 break; 650 651 case 0 : 652 default : 653 $status = 'normal'; // PunBB Normal Topic 'topic_sticky = 0' 654 break; 655 } 656 return $status; 657 } 658 659 /** 632 660 * Verify the topic/reply count. 633 661 * 634 662 * @param int $count PunBB v1.4.2 topic/reply counts -
includes/admin/converters/SimplePress5.php
205 205 'callback_method' => 'callback_forumid' 206 206 ); 207 207 208 // Topic status (Open or Closed) 209 $this->field_map[] = array( 210 'from_tablename' => 'sftopics', 211 'from_fieldname' => 'topic_status', 212 'to_type' => 'topic', 213 'to_fieldname' => 'post_status', 214 'callback_method' => 'callback_status' 215 ); 216 217 // Sticky status (Stored in postmeta)) 218 $this->field_map[] = array( 219 'from_tablename' => 'sftopics', 220 'from_fieldname' => 'topic_pinned', 221 'to_type' => 'topic', 222 'to_fieldname' => '_bbp_old_sticky_status', 223 'callback_method' => 'callback_sticky_status' 224 ); 225 208 226 // Topic dates. 209 227 $this->field_map[] = array( 210 228 'from_tablename' => 'sftopics', … … 237 255 'to_fieldname' => '_bbp_last_active_time' 238 256 ); 239 257 240 // Topic status (Open or Closed)241 $this->field_map[] = array(242 'from_tablename' => 'sftopics',243 'from_fieldname' => 'topic_status',244 'to_type' => 'topic',245 'to_fieldname' => 'post_status',246 'callback_method' => 'callback_status'247 );248 249 258 /** Tags Section ******************************************************/ 250 259 251 260 /** … … 488 497 } 489 498 490 499 /** 500 * Translate the topic sticky status type from Simple:Press v5.x numeric's to WordPress's strings. 501 * 502 * @param int $status Simple:Press v5.x numeric forum type 503 * @return string WordPress safe 504 */ 505 public function callback_sticky_status( $status = 0 ) { 506 switch ( $status ) { 507 case 1 : 508 $status = 'sticky'; // Simple:Press Sticky 'topic_sticky = 1' 509 break; 510 511 case 0 : 512 default : 513 $status = 'normal'; // Simple:Press Normal Topic 'topic_sticky = 0' 514 break; 515 } 516 return $status; 517 } 518 519 /** 491 520 * Verify the topic reply count. 492 521 * 493 522 * @param int $count Simple:Press v5.x reply count -
includes/admin/converters/vBulletin.php
235 235 'callback_method' => 'callback_html' 236 236 ); 237 237 238 // Topic status (Open or Closed) 239 $this->field_map[] = array( 240 'from_tablename' => 'thread', 241 'from_fieldname' => 'open', 242 'to_type' => 'topic', 243 'to_fieldname' => 'post_status', 244 'callback_method' => 'callback_topic_status' 245 ); 246 247 // Sticky status (Stored in postmeta)) 248 $this->field_map[] = array( 249 'from_tablename' => 'thread', 250 'from_fieldname' => 'sticky', 251 'to_type' => 'topic', 252 'to_fieldname' => '_bbp_old_sticky_status', 253 'callback_method' => 'callback_sticky_status' 254 ); 255 238 256 // Topic dates. 239 257 $this->field_map[] = array( 240 258 'from_tablename' => 'thread', … … 272 290 'callback_method' => 'callback_datetime' 273 291 ); 274 292 275 // Topic status (Open or Closed)276 $this->field_map[] = array(277 'from_tablename' => 'thread',278 'from_fieldname' => 'open',279 'to_type' => 'topic',280 'to_fieldname' => 'post_status',281 'callback_method' => 'callback_topic_status'282 );283 284 293 /** Tags Section ******************************************************/ 285 294 286 295 // Topic id. … … 587 596 } 588 597 589 598 /** 599 * Translate the topic sticky status type from vBulletin v4.x numeric's to WordPress's strings. 600 * 601 * @param int $status vBulletin v4.x numeric forum type 602 * @return string WordPress safe 603 */ 604 public function callback_sticky_status( $status = 0 ) { 605 switch ( $status ) { 606 case 2 : 607 $status = 'super-sticky'; // vBulletin Super Sticky 'sticky = 2' 608 break; 609 610 case 1 : 611 $status = 'sticky'; // vBulletin Sticky 'sticky = 1' 612 break; 613 614 case 0 : 615 default : 616 $status = 'normal'; // vBulletin Normal Topic 'sticky = 0' 617 break; 618 } 619 return $status; 620 } 621 622 /** 590 623 * Verify the topic reply count. 591 624 * 592 625 * @param int $count vBulletin v4.x reply count -
includes/admin/converters/vBulletin3.php
235 235 'callback_method' => 'callback_html' 236 236 ); 237 237 238 // Topic status (Open or Closed) 239 $this->field_map[] = array( 240 'from_tablename' => 'thread', 241 'from_fieldname' => 'open', 242 'to_type' => 'topic', 243 'to_fieldname' => 'post_status', 244 'callback_method' => 'callback_topic_status' 245 ); 246 247 // Sticky status (Stored in postmeta)) 248 $this->field_map[] = array( 249 'from_tablename' => 'thread', 250 'from_fieldname' => 'sticky', 251 'to_type' => 'topic', 252 'to_fieldname' => '_bbp_old_sticky_status', 253 'callback_method' => 'callback_sticky_status' 254 ); 255 238 256 // Topic dates. 239 257 $this->field_map[] = array( 240 258 'from_tablename' => 'thread', … … 272 290 'callback_method' => 'callback_datetime' 273 291 ); 274 292 275 // Topic status (Open or Closed)276 $this->field_map[] = array(277 'from_tablename' => 'thread',278 'from_fieldname' => 'open',279 'to_type' => 'topic',280 'to_fieldname' => 'post_status',281 'callback_method' => 'callback_topic_status'282 );283 284 293 /** Tags Section ******************************************************/ 285 294 286 295 // Topic id. … … 591 600 } 592 601 593 602 /** 603 * Translate the topic sticky status type from vBulletin v3.x numeric's to WordPress's strings. 604 * 605 * @param int $status vBulletin v3.x numeric forum type 606 * @return string WordPress safe 607 */ 608 public function callback_sticky_status( $status = 0 ) { 609 switch ( $status ) { 610 case 1 : 611 $status = 'sticky'; // vBulletin Sticky 'topic_sticky = 1' 612 break; 613 614 case 0 : 615 default : 616 $status = 'normal'; // vBulletin Normal Topic 'topic_sticky = 0' 617 break; 618 } 619 return $status; 620 } 621 622 /** 594 623 * Verify the topic reply count. 595 624 * 596 625 * @param int $count vBulletin v3.x reply count -
includes/admin/converters/XenForo.php
262 262 'callback_method' => 'callback_forumid' 263 263 ); 264 264 265 // Sticky status (Stored in postmeta)) 266 $this->field_map[] = array( 267 'from_tablename' => 'thread', 268 'from_fieldname' => 'sticky', 269 'to_type' => 'topic', 270 'to_fieldname' => '_bbp_old_sticky_status', 271 'callback_method' => 'callback_sticky_status' 272 ); 273 265 274 // Topic dates. 266 275 $this->field_map[] = array( 267 276 'from_tablename' => 'thread', … … 671 680 } 672 681 return $status; 673 682 } 683 674 684 /** 685 * Translate the topic sticky status type from XenForo numeric's to WordPress's strings. 686 * 687 * @param int $status XenForo numeric forum type 688 * @return string WordPress safe 689 */ 690 public function callback_sticky_status( $status = 0 ) { 691 switch ( $status ) { 692 case 1 : 693 $status = 'sticky'; // XenForo Sticky 'sticky = 1' 694 break; 695 696 case 0 : 697 default : 698 $status = 'normal'; // XenForo Normal Topic 'sticky = 0' 699 break; 700 } 701 return $status; 702 } 703 704 /** 675 705 * Verify the topic reply count. 676 706 * 677 707 * @param int $count XenForo reply count -
includes/admin/converters/XMB.php
239 239 'callback_method' => 'callback_forumid' 240 240 ); 241 241 242 // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed) 243 $this->field_map[] = array( 244 'from_tablename' => 'threads', 245 'from_fieldname' => 'closed', 246 'to_type' => 'topic', 247 'to_fieldname' => 'post_status', 248 'callback_method' => 'callback_topic_status' 249 ); 250 251 // Sticky status (Stored in postmeta)) 252 $this->field_map[] = array( 253 'from_tablename' => 'threads', 254 'from_fieldname' => 'topped', 255 'to_type' => 'topic', 256 'to_fieldname' => '_bbp_old_sticky_status', 257 'callback_method' => 'callback_sticky_status' 258 ); 259 242 260 // Topic dates. 243 261 // Note: We join the 'posts' table because 'threads' table does not include dates. 244 262 $this->field_map[] = array( … … 292 310 'callback_method' => 'callback_datetime' 293 311 ); 294 312 295 // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed)296 $this->field_map[] = array(297 'from_tablename' => 'threads',298 'from_fieldname' => 'closed',299 'to_type' => 'topic',300 'to_fieldname' => 'post_status',301 'callback_method' => 'callback_topic_status'302 );303 304 313 /** Tags Section ******************************************************/ 305 314 306 315 /** … … 656 665 } 657 666 658 667 /** 668 * Translate the topic sticky status type from XMB v1.9.11.13 numeric's to WordPress's strings. 669 * 670 * @param int $status XMB v1.9.11.13 numeric forum type 671 * @return string WordPress safe 672 */ 673 public function callback_sticky_status( $status = 0 ) { 674 switch ( $status ) { 675 case 1 : 676 $status = 'sticky'; // XMB Sticky 'topped = 1' 677 break; 678 679 case 0 : 680 default : 681 $status = 'normal'; // XMB Normal Topic 'topped = 0' 682 break; 683 } 684 return $status; 685 } 686 687 /** 659 688 * Verify the topic/reply count. 660 689 * 661 690 * @param int $count XMB v1.9.11.13 topic/reply counts