diff --git a/bbPress/includes/admin/converter.php b/bbPress/includes/admin/converter.php
index 2588109..31eb728 100644
|
a
|
b
|
class BBP_Converter {
|
| 467 | 467 | |
| 468 | 468 | break; |
| 469 | 469 | |
| 470 | | // STEP 9. Convert reply_to parents. |
| | 470 | // STEP 9. Convert comments. |
| 471 | 471 | case 9 : |
| | 472 | if ( $converter->convert_comments( $start ) ) { |
| | 473 | update_option( '_bbp_converter_step', $step + 1 ); |
| | 474 | update_option( '_bbp_converter_start', 0 ); |
| | 475 | if ( empty( $start ) ) { |
| | 476 | $this->converter_output( __( 'No comments to convert', 'bbpress' ) ); |
| | 477 | } |
| | 478 | } else { |
| | 479 | update_option( '_bbp_converter_start', $max + 1 ); |
| | 480 | $this->converter_output( sprintf( __( 'Converting comments (%1$s - %2$s)', 'bbpress' ), $min, $max ) ); |
| | 481 | } |
| | 482 | |
| | 483 | break; |
| | 484 | |
| | 485 | // STEP 10. Convert reply_to parents. |
| | 486 | case 10 : |
| 472 | 487 | if ( $converter->convert_reply_to_parents( $start ) ) { |
| 473 | 488 | update_option( '_bbp_converter_step', $step + 1 ); |
| 474 | 489 | update_option( '_bbp_converter_start', 0 ); |
| … |
… |
abstract class BBP_Converter_Base {
|
| 692 | 707 | 'default' => 'topic' |
| 693 | 708 | ); |
| 694 | 709 | |
| 695 | | /** Post Section ******************************************************/ |
| | 710 | /** Reply Section *****************************************************/ |
| 696 | 711 | |
| 697 | 712 | $this->field_map[] = array( |
| 698 | 713 | 'to_type' => 'reply', |
| … |
… |
abstract class BBP_Converter_Base {
|
| 715 | 730 | 'default' => 'reply' |
| 716 | 731 | ); |
| 717 | 732 | |
| | 733 | /** Comment Section ***************************************************/ |
| | 734 | |
| | 735 | $this->field_map[] = array( |
| | 736 | 'to_type' => 'comment', |
| | 737 | 'to_fieldname' => 'post_status', |
| | 738 | 'default' => 'publish' |
| | 739 | ); |
| | 740 | $this->field_map[] = array( |
| | 741 | 'to_type' => 'comment', |
| | 742 | 'to_fieldname' => 'comment_status', |
| | 743 | 'default' => 'closed' |
| | 744 | ); |
| | 745 | $this->field_map[] = array( |
| | 746 | 'to_type' => 'comment', |
| | 747 | 'to_fieldname' => 'ping_status', |
| | 748 | 'default' => 'closed' |
| | 749 | ); |
| | 750 | $this->field_map[] = array( |
| | 751 | 'to_type' => 'comment', |
| | 752 | 'to_fieldname' => 'post_type', |
| | 753 | 'default' => 'reply' |
| | 754 | ); |
| | 755 | |
| 718 | 756 | /** User Section ******************************************************/ |
| 719 | 757 | |
| 720 | 758 | $this->field_map[] = array( |
| … |
… |
abstract class BBP_Converter_Base {
|
| 739 | 777 | } |
| 740 | 778 | |
| 741 | 779 | /** |
| 742 | | * Convert Posts |
| | 780 | * Convert Reples / Posts |
| 743 | 781 | */ |
| 744 | 782 | public function convert_replies( $start = 1 ) { |
| 745 | 783 | return $this->convert_table( 'reply', $start ); |
| 746 | 784 | } |
| 747 | 785 | |
| 748 | 786 | /** |
| | 787 | * Convert Comments |
| | 788 | */ |
| | 789 | public function convert_comments( $start = 1 ) { |
| | 790 | return $this->convert_table( 'comment', $start ); |
| | 791 | } |
| | 792 | |
| | 793 | /** |
| 749 | 794 | * Convert Users |
| 750 | 795 | */ |
| 751 | 796 | public function convert_users( $start = 1 ) { |
| … |
… |
abstract class BBP_Converter_Base {
|
| 863 | 908 | // Loop through field map, again... |
| 864 | 909 | foreach ( $this->field_map as $row ) { |
| 865 | 910 | |
| 866 | | // Types matchand to_fieldname is present. This means |
| | 911 | // Types match and to_fieldname is present. This means |
| 867 | 912 | // we have some work to do here. |
| 868 | 913 | if ( ( $row['to_type'] == $to_type ) && ! is_null( $row['to_fieldname'] ) ) { |
| 869 | 914 | |
| … |
… |
abstract class BBP_Converter_Base {
|
| 951 | 996 | $post_id = wp_set_object_terms( $insert_postmeta['objectid'], $insert_postmeta['name'], 'topic-tag', true ); |
| 952 | 997 | break; |
| 953 | 998 | |
| 954 | | /** Forum, Topic, Reply ***************************/ |
| | 999 | /** Forum, Topic, Reply, Comment ******************/ |
| 955 | 1000 | |
| 956 | 1001 | default: |
| 957 | 1002 | $post_id = wp_insert_post( $insert_post ); |
| … |
… |
function bbp_new_converter( $platform ) {
|
| 1358 | 1403 | $found = false; |
| 1359 | 1404 | |
| 1360 | 1405 | if ( $curdir = opendir( bbpress()->admin->admin_dir . 'converters/' ) ) { |
| 1361 | | while ( $file = readdir( $curdir ) ) { |
| | 1406 | while ( false !== ( $file = readdir( $curdir ) ) ) { |
| 1362 | 1407 | if ( stristr( $file, '.php' ) && stristr( $file, 'index' ) === FALSE ) { |
| 1363 | 1408 | $file = preg_replace( '/.php/', '', $file ); |
| 1364 | 1409 | if ( $platform == $file ) { |