Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/04/2012 06:20:46 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Converter:

  • Clean up phpBB field maps
  • See #1820
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/converters/phpBB.php

    r3866 r3867  
    209209        // Post id. Stores in postmeta.
    210210        $this->field_map[] = array(
    211             'from_tablename' => 'posts', 'from_fieldname' => 'post_id',
    212             'to_type' => 'reply', 'to_fieldname' => '_bbp_post_id'
     211            'from_tablename' => 'posts',
     212            'from_fieldname' => 'post_id',
     213            'to_type'        => 'reply',
     214            'to_fieldname'   => '_bbp_post_id'
    213215        );
    214216       
    215217        // Topic content.
    216218        $this->field_map[] = array(
    217             'from_tablename' => 'topics', 'from_fieldname' => 'topic_id',
    218             'join_tablename' => 'posts', 'join_type' => 'LEFT', 'join_expression' => 'USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id',
    219             'to_type' => 'reply'
     219            'from_tablename'  => 'topics',
     220            'from_fieldname'  => 'topic_id',
     221            'join_tablename'  => 'posts',
     222            'join_type'       => 'LEFT',
     223            'join_expression' => 'USING (topic_id) WHERE posts.post_id != topics.topic_first_post_id',
     224            'to_type'         => 'reply'
    220225        ); 
    221226       
    222227        // Forum id. Stores in postmeta.
    223228        $this->field_map[] = array(
    224             'from_tablename' => 'posts', 'from_fieldname' => 'forum_id',
    225             'to_type' => 'reply', 'to_fieldname' => '_bbp_forum_id',
     229            'from_tablename'  => 'posts',
     230            'from_fieldname'  => 'forum_id',
     231            'to_type'         => 'reply',
     232            'to_fieldname'    => '_bbp_forum_id',
    226233            'callback_method' => 'callback_topicid_to_forumid'
    227234        );
     
    229236        // Topic id. Stores in postmeta.
    230237        $this->field_map[] = array(
    231             'from_tablename' => 'posts', 'from_fieldname' => 'topic_id',
    232             'to_type' => 'reply', 'to_fieldname' => '_bbp_topic_id',
     238            'from_tablename'  => 'posts',
     239            'from_fieldname'  => 'topic_id',
     240            'to_type'         => 'reply',
     241            'to_fieldname'    => '_bbp_topic_id',
    233242            'callback_method' => 'callback_topicid'
    234243        );
     
    236245        // Author ip.
    237246        $this->field_map[] = array(
    238             'from_tablename' => 'posts', 'from_fieldname' => 'poster_ip',
    239             'to_type' => 'reply', 'to_fieldname' => '_bbp_author_ip'
     247            'from_tablename' => 'posts',
     248            'from_fieldname' => 'poster_ip',
     249            'to_type'        => 'reply',
     250            'to_fieldname'   => '_bbp_author_ip'
    240251        ); 
    241252           
    242253        // Post author.
    243254        $this->field_map[] = array(
    244             'from_tablename' => 'posts', 'from_fieldname' => 'poster_id',
    245             'to_type' => 'reply', 'to_fieldname' => 'post_author',
     255            'from_tablename'  => 'posts',
     256            'from_fieldname'  => 'poster_id',
     257            'to_type'         => 'reply',
     258            'to_fieldname'    => 'post_author',
    246259            'callback_method' => 'callback_userid'
    247260        );
     
    249262        // Topic title.
    250263        $this->field_map[] = array(
    251             'from_tablename' => 'posts', 'from_fieldname' => 'post_subject',
    252             'to_type' => 'reply', 'to_fieldname' => 'post_title'
     264            'from_tablename' => 'posts',
     265            'from_fieldname' => 'post_subject',
     266            'to_type'        => 'reply',
     267            'to_fieldname'   => 'post_title'
    253268        );
    254269       
    255270        // Topic slug. Clean name.
    256271        $this->field_map[] = array(
    257             'from_tablename' => 'posts', 'from_fieldname' => 'post_subject',
    258             'to_type' => 'reply', 'to_fieldname' => 'post_name',
     272            'from_tablename'  => 'posts',
     273            'from_fieldname'  => 'post_subject',
     274            'to_type'         => 'reply',
     275            'to_fieldname'    => 'post_name',
    259276            'callback_method' => 'callback_slug'
    260277        );
     
    262279        // Post content.
    263280        $this->field_map[] = array(
    264             'from_tablename' => 'posts', 'from_fieldname' => 'post_text',
    265             'to_type' => 'reply', 'to_fieldname' => 'post_content',
     281            'from_tablename'  => 'posts',
     282            'from_fieldname'  => 'post_text',
     283            'to_type'         => 'reply',
     284            'to_fieldname'    => 'post_content',
    266285            'callback_method' => 'callback_html'
    267286        );
     
    269288        // Topic id.  If no parent, than 0.
    270289        $this->field_map[] = array(
    271             'from_tablename' => 'posts', 'from_fieldname' => 'topic_id',
    272             'to_type' => 'reply', 'to_fieldname' => 'post_parent',
     290            'from_tablename'  => 'posts',
     291            'from_fieldname'  => 'topic_id',
     292            'to_type'         => 'reply',
     293            'to_fieldname'    => 'post_parent',
    273294            'callback_method' => 'callback_topicid'
    274295        );
     
    276297        // Topic date update.
    277298        $this->field_map[] = array(
    278             'from_tablename' => 'posts', 'from_fieldname' => 'post_time',
    279             'to_type' => 'reply', 'to_fieldname' => 'post_date',
    280             'callback_method' => 'callback_datetime'
    281         );
    282         $this->field_map[] = array(
    283             'from_tablename' => 'posts', 'from_fieldname' => 'post_time',
    284             'to_type' => 'reply', 'to_fieldname' => 'post_date_gmt',
    285             'callback_method' => 'callback_datetime'
    286         );
    287         $this->field_map[] = array(
    288             'from_tablename' => 'posts', 'from_fieldname' => 'post_time',
    289             'to_type' => 'reply', 'to_fieldname' => 'post_modified',
    290             'callback_method' => 'callback_datetime'
    291         );
    292         $this->field_map[] = array(
    293             'from_tablename' => 'posts', 'from_fieldname' => 'post_time',
    294             'to_type' => 'reply', 'to_fieldname' => 'post_modified_gmt',
     299            'from_tablename'  => 'posts',
     300            'from_fieldname'  => 'post_time',
     301            'to_type'         => 'reply',
     302            'to_fieldname'    => 'post_date',
     303            'callback_method' => 'callback_datetime'
     304        );
     305        $this->field_map[] = array(
     306            'from_tablename'  => 'posts',
     307            'from_fieldname'  => 'post_time',
     308            'to_type'         => 'reply',
     309            'to_fieldname'    => 'post_date_gmt',
     310            'callback_method' => 'callback_datetime'
     311        );
     312        $this->field_map[] = array(
     313            'from_tablename'  => 'posts',
     314            'from_fieldname'  => 'post_time',
     315            'to_type'         => 'reply',
     316            'to_fieldname'    => 'post_modified',
     317            'callback_method' => 'callback_datetime'
     318        );
     319        $this->field_map[] = array(
     320            'from_tablename'  => 'posts',
     321            'from_fieldname'  => 'post_time',
     322            'to_type'         => 'reply',
     323            'to_fieldname'    => 'post_modified_gmt',
    295324            'callback_method' => 'callback_datetime'
    296325        );
     
    300329        // Store old User id. Stores in usermeta.
    301330        $this->field_map[] = array(
    302             'from_tablename' => 'users', 'from_fieldname' => 'user_id',
    303             'to_type' => 'user', 'to_fieldname' => '_bbp_user_id'
     331            'from_tablename' => 'users',
     332            'from_fieldname' => 'user_id',
     333            'to_type'        => 'user',
     334            'to_fieldname'   => '_bbp_user_id'
    304335        );
    305336       
    306337        // Store old User password. Stores in usermeta serialized with salt.
    307338        $this->field_map[] = array(
    308             'from_tablename' => 'users', 'from_fieldname' => 'user_password',
    309             'to_type' => 'user', 'to_fieldname' => '_bbp_password',
     339            'from_tablename'  => 'users',
     340            'from_fieldname'  => 'user_password',
     341            'to_type'         => 'user',
     342            'to_fieldname'    => '_bbp_password',
    310343            'callback_method' => 'callback_savepass'
    311344        );
     
    313346        // Store old User Salt. This is only used for the SELECT row info for the above password save
    314347        $this->field_map[] = array(
    315             'from_tablename' => 'users', 'from_fieldname' => 'user_form_salt',
    316             'to_type' => 'user', 'to_fieldname' => ''
     348            'from_tablename' => 'users',
     349            'from_fieldname' => 'user_form_salt',
     350            'to_type'        => 'user',
     351            'to_fieldname'   => ''
    317352        );
    318353               
    319354        // User password verify class. Stores in usermeta for verifying password.
    320355        $this->field_map[] = array(
    321             'to_type' => 'user', 'to_fieldname' => '_bbp_class',
    322             'default' => 'Phpbb'
     356            'to_type'      => 'user',
     357            'to_fieldname' => '_bbp_class',
     358            'default'      => 'Phpbb'
    323359        );
    324360               
    325361        // User name.
    326362        $this->field_map[] = array(
    327             'from_tablename' => 'users', 'from_fieldname' => 'username',
    328             'to_type' => 'user', 'to_fieldname' => 'user_login'
     363            'from_tablename' => 'users',
     364            'from_fieldname' => 'username',
     365            'to_type'        => 'user',
     366            'to_fieldname'   => 'user_login'
    329367        );
    330368               
    331369        // User email.
    332370        $this->field_map[] = array(
    333             'from_tablename' => 'users', 'from_fieldname' => 'user_email',
    334             'to_type' => 'user', 'to_fieldname' => 'user_email'
     371            'from_tablename' => 'users',
     372            'from_fieldname' => 'user_email',
     373            'to_type'        => 'user',
     374            'to_fieldname'   => 'user_email'
    335375        );
    336376       
    337377        // User homepage.
    338378        $this->field_map[] = array(
    339             'from_tablename' => 'users', 'from_fieldname' => 'user_website',
    340             'to_type' => 'user', 'to_fieldname' => 'user_url'
     379            'from_tablename' => 'users',
     380            'from_fieldname' => 'user_website',
     381            'to_type'        => 'user',
     382            'to_fieldname'   => 'user_url'
    341383        );
    342384       
    343385        // User registered.
    344386        $this->field_map[] = array(
    345             'from_tablename' => 'users', 'from_fieldname' => 'user_regdate',
    346             'to_type' => 'user', 'to_fieldname' => 'user_registered',
     387            'from_tablename'  => 'users',
     388            'from_fieldname'  => 'user_regdate',
     389            'to_type'         => 'user',
     390            'to_fieldname'    => 'user_registered',
    347391            'callback_method' => 'callback_datetime'
    348392        );
     
    350394        // User aim.
    351395        $this->field_map[] = array(
    352             'from_tablename' => 'users', 'from_fieldname' => 'user_aim',
    353             'to_type' => 'user', 'to_fieldname' => 'aim'
     396            'from_tablename' => 'users',
     397            'from_fieldname' => 'user_aim',
     398            'to_type'        => 'user',
     399            'to_fieldname'   => 'aim'
    354400        );
    355401       
    356402        // User yahoo.
    357403        $this->field_map[] = array(
    358             'from_tablename' => 'users', 'from_fieldname' => 'user_yim',
    359             'to_type' => 'user', 'to_fieldname' => 'yim'
     404            'from_tablename' => 'users',
     405            'from_fieldname' => 'user_yim',
     406            'to_type'        => 'user',
     407            'to_fieldname'   => 'yim'
    360408        ); 
    361409    }
Note: See TracChangeset for help on using the changeset viewer.