Skip to:
Content

bbPress.org

Ticket #2189: 2189.diff

File 2189.diff, 6.5 KB (added by netweb, 12 years ago)
  • includes/admin/converters/bbPress1.php

    diff --git a/includes/admin/converters/bbPress1.php b/includes/admin/converters/bbPress1.php
    index 9c3ecee..85dcef5 100644
    a b  
    44 * bbPress 1.1 Converter
    55 *
    66 * @since bbPress (rxxxx)
     7 * @link Codex Docs http://codex.bbpress.org/import-forums/bbpress-1-x-buddypress-group-forums
    78 */
    89class bbPress1 extends BBP_Converter_Base {
    910
    class bbPress1 extends BBP_Converter_Base { 
    3233                        'to_fieldname'   => '_bbp_forum_id'
    3334                );
    3435
    35                 // Forum parent id (If no parent, 0. Stored in postmeta)
     36                // Forum parent id (If no parent, then 0. Stored in postmeta)
    3637                $this->field_map[] = array(
    3738                        'from_tablename' => 'forums',
    3839                        'from_fieldname' => 'forum_parent',
    class bbPress1 extends BBP_Converter_Base { 
    5657                        'to_fieldname'   => '_bbp_reply_count'
    5758                );
    5859
    59                 // Forum topic count (Stored in postmeta)
     60                // Forum total topic count (Stored in postmeta)
    6061                $this->field_map[] = array(
    6162                        'from_tablename' => 'forums',
    6263                        'from_fieldname' => 'topics',
    class bbPress1 extends BBP_Converter_Base { 
    6465                        'to_fieldname'   => '_bbp_total_topic_count'
    6566                );
    6667
    67                 // Forum reply count (Stored in postmeta)
     68                // Forum total reply count (Stored in postmeta)
    6869                $this->field_map[] = array(
    6970                        'from_tablename' => 'forums',
    7071                        'from_fieldname' => 'posts',
    class bbPress1 extends BBP_Converter_Base { 
    138139                        'to_fieldname'   => '_bbp_topic_id'
    139140                );
    140141
    141                 // Reply count (Stored in postmeta)
     142                // Topic reply count (Stored in postmeta)
    142143                $this->field_map[] = array(
    143144                        'from_tablename'  => 'topics',
    144145                        'from_fieldname'  => 'topic_posts',
    class bbPress1 extends BBP_Converter_Base { 
    147148                        'callback_method' => 'callback_topic_reply_count'
    148149                );
    149150
    150                 // Forum id (Stored in postmeta)
     151                // Topic parent forum id (If no parent, then 0. Stored in postmeta)
    151152                $this->field_map[] = array(
    152153                        'from_tablename'  => 'topics',
    153154                        'from_fieldname'  => 'forum_id',
    class bbPress1 extends BBP_Converter_Base { 
    195196                        'callback_method' => 'callback_html'
    196197                );
    197198
    198                 // Post status (Spam, Trash or Publish)
     199                // Topic status (Spam, Trash or Publish)
    199200                $this->field_map[] = array(
    200201                        'from_tablename'  => 'posts',
    201202                        'from_fieldname'  => 'post_status',
    class bbPress1 extends BBP_Converter_Base { 
    207208                        'callback_method' => 'callback_status'
    208209                );
    209210
    210                 // Author ip.
     211                // Topic author ip (Stored in postmeta)
    211212                $this->field_map[] = array(
    212213                        'from_tablename'  => 'posts',
    213214                        'from_fieldname'  => 'poster_ip',
    class bbPress1 extends BBP_Converter_Base { 
    218219                        'to_fieldname'    => '_bbp_author_ip'
    219220                );
    220221
    221                 // Forum id (If no parent, 0)
     222                // Topic parent forum id (If no parent, then 0)
    222223                $this->field_map[] = array(
    223224                        'from_tablename'  => 'topics',
    224225                        'from_fieldname'  => 'forum_id',
    class bbPress1 extends BBP_Converter_Base { 
    294295
    295296                /** Reply Section *****************************************************/
    296297
    297                 // Post id. Stores in postmeta.
     298                // Reply id (Stored in postmeta)
    298299                $this->field_map[] = array(
    299300                        'from_tablename'  => 'posts',
    300301                        'from_fieldname'  => 'post_id',
    class bbPress1 extends BBP_Converter_Base { 
    302303                        'to_fieldname'    => '_bbp_post_id'
    303304                );
    304305
    305                 // Topic id (Stores in postmeta)
     306                // Reply parent topic id (If no parent, then 0. Stored in postmeta)
    306307                $this->field_map[] = array(
    307308                        'from_tablename'  => 'posts',
    308309                        'from_fieldname'  => 'topic_id',
    class bbPress1 extends BBP_Converter_Base { 
    311312                        'callback_method' => 'callback_topicid'
    312313                );
    313314
    314                 // Forum id (Stored in postmeta)
     315                // Reply parent forum id (If no parent, then 0. Stored in postmeta)
    315316                $this->field_map[] = array(
    316317                        'from_tablename'  => 'posts',
    317318                        'from_fieldname'  => 'forum_id',
    class bbPress1 extends BBP_Converter_Base { 
    320321                        'callback_method' => 'callback_forumid'
    321322                );
    322323
    323                 // Topic title (for reply title).
     324                // Reply title.
     325                // Note: We join the topics table because post table does not include topic title.
    324326                $this->field_map[] = array(
    325327                        'from_tablename'  => 'topics',
    326328                        'from_fieldname'  => 'topic_title',
    class bbPress1 extends BBP_Converter_Base { 
    332334                        'callback_method' => 'callback_reply_title'
    333335                );
    334336
    335                 // Author ip.
     337                // Reply author ip (Stored in postmeta)
    336338                $this->field_map[] = array(
    337339                        'from_tablename' => 'posts',
    338340                        'from_fieldname' => 'poster_ip',
    class bbPress1 extends BBP_Converter_Base { 
    349351                        'callback_method' => 'callback_userid'
    350352                );
    351353
    352                 // Reply status
     354                // Reply status (Spam, Trash or Publish)
    353355                $this->field_map[] = array(
    354356                        'from_tablename'  => 'posts',
    355357                        'from_fieldname'  => 'post_status',
    class bbPress1 extends BBP_Converter_Base { 
    375377                        'to_fieldname'    => 'menu_order'
    376378                );
    377379
    378                 // Topic id.  If no parent, than 0.
     380                // Reply parent topic id (If no parent, then 0)
    379381                $this->field_map[] = array(
    380382                        'from_tablename'  => 'posts',
    381383                        'from_fieldname'  => 'topic_id',
    class bbPress1 extends BBP_Converter_Base { 
    412414
    413415                /** User Section ******************************************************/
    414416
    415                 // Store old User id. Stores in usermeta.
     417                // Store old User id (Stored in usermeta)
    416418                $this->field_map[] = array(
    417419                        'from_tablename' => 'users',
    418420                        'from_fieldname' => 'ID',
    class bbPress1 extends BBP_Converter_Base { 
    420422                        'to_fieldname'   => '_bbp_user_id'
    421423                );
    422424
    423                 // Store old User password. Stores in usermeta.
     425                // Store old User password (Stored in usermeta)
    424426                $this->field_map[] = array(
    425427                        'from_tablename' => 'users',
    426428                        'from_fieldname' => 'user_pass',
    class bbPress1 extends BBP_Converter_Base { 
    521523        /**
    522524         * Verify the topic reply count.
    523525         *
    524          * @param int $count bbPress 1.x reply count
     526         * @param int $count bbPress 1.x topic and reply counts
    525527         * @return string WordPress safe
    526528         */
    527529        public function callback_topic_reply_count( $count = 1 ) {
    class bbPress1 extends BBP_Converter_Base { 
    566568         */
    567569        protected function callback_html( $field ) {
    568570                require_once( bbpress()->admin->admin_dir . 'parser.php' );
    569                 $bbcode = BBCode::getInstance(); 
     571                $bbcode = BBCode::getInstance();
    570572                $bbcode->enable_smileys = false;
    571573                $bbcode->smiley_regex   = false;
    572574                return html_entity_decode( $bbcode->Parse( $field ) );