Skip to:
Content

bbPress.org


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

Converter:

  • Remane 'translate' methods to 'callback' to avoid confusion with i18n functions
  • Improve maps of bbPress 1 converter
  • Fix incorrectly named keys in other converters
  • Whitespace and phpdoc fixes
  • See #1820
File:
1 edited

Legend:

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

    r3816 r3866  
    1919        $this->field_map[] = array(
    2020            'from_tablename' => 'forum', 'from_fieldname' => 'forumid',
    21             'to_type' => 'forum', 'to_fieldname' => '_bbc_forum_id'
     21            'to_type' => 'forum', 'to_fieldname' => '_bbp_forum_id'
    2222        );
    2323       
     
    2525        $this->field_map[] = array(
    2626            'from_tablename' => 'forum', 'from_fieldname' => 'parentid',
    27             'to_type' => 'forum', 'to_fieldname' => '_bbc_parent_id'
     27            'to_type' => 'forum', 'to_fieldname' => '_bbp_parent_id'
    2828        );
    2929       
     
    3838            'from_tablename' => 'forum', 'from_fieldname' => 'title_clean',
    3939            'to_type' => 'forum', 'to_fieldname' => 'post_name',
    40             'translate_method' => 'translate_title'
     40            'callback_method' => 'callback_slug'
    4141        );
    4242       
     
    4545            'from_tablename' => 'forum', 'from_fieldname' => 'description',
    4646            'to_type' => 'forum', 'to_fieldname' => 'post_content',
    47             'translate_method' => 'translate_null'
     47            'callback_method' => 'callback_null'
    4848        );
    4949       
     
    7777        $this->field_map[] = array(
    7878            'from_tablename' => 'thread', 'from_fieldname' => 'threadid',
    79             'to_type' => 'topic', 'to_fieldname' => '_bbc_topic_id'
     79            'to_type' => 'topic', 'to_fieldname' => '_bbp_topic_id'
    8080        );
    8181       
     
    8383        $this->field_map[] = array(
    8484            'from_tablename' => 'thread', 'from_fieldname' => 'forumid',
    85             'to_type' => 'topic', 'to_fieldname' => '_bbc_forum_id',
    86             'translate_method' => 'translate_forumid'
     85            'to_type' => 'topic', 'to_fieldname' => '_bbp_forum_id',
     86            'callback_method' => 'callback_forumid'
    8787        );
    8888               
     
    9191            'from_tablename' => 'thread', 'from_fieldname' => 'postuserid',
    9292            'to_type' => 'topic', 'to_fieldname' => 'post_author',
    93             'translate_method' => 'translate_userid'
     93            'callback_method' => 'callback_userid'
    9494        );
    9595
     
    9999            'join_tablename' => 'thread', 'join_type' => 'INNER', 'join_expression' => 'USING (threadid) WHERE post.parentid = 0',
    100100            'to_type' => 'topic', 'to_fieldname' => 'post_content',
    101             'translate_method' => 'translate_html'
     101            'callback_method' => 'callback_html'
    102102        ); 
    103103
     
    112112            'from_tablename' => 'thread', 'from_fieldname' => 'title',
    113113            'to_type' => 'topic', 'to_fieldname' => 'post_name',
    114             'translate_method' => 'translate_title'
     114            'callback_method' => 'callback_slug'
    115115        );
    116116       
     
    119119            'from_tablename' => 'thread', 'from_fieldname' => 'forumid',
    120120            'to_type' => 'topic', 'to_fieldname' => 'post_parent',
    121             'translate_method' => 'translate_forumid'
     121            'callback_method' => 'callback_forumid'
    122122        );
    123123
     
    126126            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    127127            'to_type' => 'topic', 'to_fieldname' => 'post_date',
    128             'translate_method' => 'translate_datetime'
     128            'callback_method' => 'callback_datetime'
    129129        );
    130130        $this->field_map[] = array(
    131131            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    132132            'to_type' => 'topic', 'to_fieldname' => 'post_date_gmt',
    133             'translate_method' => 'translate_datetime'
     133            'callback_method' => 'callback_datetime'
    134134        );
    135135        $this->field_map[] = array(
    136136            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    137137            'to_type' => 'topic', 'to_fieldname' => 'post_modified',
    138             'translate_method' => 'translate_datetime'
     138            'callback_method' => 'callback_datetime'
    139139        );
    140140        $this->field_map[] = array(
    141141            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    142142            'to_type' => 'topic', 'to_fieldname' => 'post_modified_gmt',
    143             'translate_method' => 'translate_datetime'
     143            'callback_method' => 'callback_datetime'
    144144        );
    145145
     
    150150            'from_tablename' => 'tagcontent', 'from_fieldname' => 'contentid',
    151151            'to_type' => 'tags', 'to_fieldname' => 'objectid',
    152             'translate_method' => 'translate_topicid'
     152            'callback_method' => 'callback_topicid'
    153153        );
    154154       
     
    165165        $this->field_map[] = array(
    166166            'from_tablename' => 'post', 'from_fieldname' => 'postid', 'from_expression' => 'WHERE post.parentid != 0',
    167             'to_type' => 'reply', 'to_fieldname' => '_bbc_post_id'
     167            'to_type' => 'reply', 'to_fieldname' => '_bbp_post_id'
    168168        );
    169169       
     
    171171        $this->field_map[] = array(
    172172            'from_tablename' => 'post', 'from_fieldname' => 'threadid',
    173             'to_type' => 'reply', 'to_fieldname' => '_bbc_forum_id',
    174             'translate_method' => 'translate_topicid_to_forumid'
     173            'to_type' => 'reply', 'to_fieldname' => '_bbp_forum_id',
     174            'callback_method' => 'callback_topicid_to_forumid'
    175175        );
    176176       
     
    178178        $this->field_map[] = array(
    179179            'from_tablename' => 'post', 'from_fieldname' => 'threadid',
    180             'to_type' => 'reply', 'to_fieldname' => '_bbc_topic_id',
    181             'translate_method' => 'translate_topicid'
     180            'to_type' => 'reply', 'to_fieldname' => '_bbp_topic_id',
     181            'callback_method' => 'callback_topicid'
    182182        );
    183183       
     
    185185        $this->field_map[] = array(
    186186            'from_tablename' => 'post', 'from_fieldname' => 'ipaddress',
    187             'to_type' => 'reply', 'to_fieldname' => '__bbc_author_ip'
     187            'to_type' => 'reply', 'to_fieldname' => '__bbp_author_ip'
    188188        ); 
    189189           
     
    192192            'from_tablename' => 'post', 'from_fieldname' => 'userid',
    193193            'to_type' => 'reply', 'to_fieldname' => 'post_author',
    194             'translate_method' => 'translate_userid'
     194            'callback_method' => 'callback_userid'
    195195        );
    196196       
     
    205205            'from_tablename' => 'post', 'from_fieldname' => 'title',
    206206            'to_type' => 'reply', 'to_fieldname' => 'post_name',
    207             'translate_method' => 'translate_title'
     207            'callback_method' => 'callback_slug'
    208208        );
    209209       
     
    212212            'from_tablename' => 'post', 'from_fieldname' => 'pagetext',
    213213            'to_type' => 'reply', 'to_fieldname' => 'post_content',
    214             'translate_method' => 'translate_html'
     214            'callback_method' => 'callback_html'
    215215        );
    216216       
     
    219219            'from_tablename' => 'post', 'from_fieldname' => 'threadid',
    220220            'to_type' => 'reply', 'to_fieldname' => 'post_parent',
    221             'translate_method' => 'translate_topicid'
     221            'callback_method' => 'callback_topicid'
    222222        );
    223223
     
    226226            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    227227            'to_type' => 'reply', 'to_fieldname' => 'post_date',
    228             'translate_method' => 'translate_datetime'
     228            'callback_method' => 'callback_datetime'
    229229        );
    230230        $this->field_map[] = array(
    231231            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    232232            'to_type' => 'reply', 'to_fieldname' => 'post_date_gmt',
    233             'translate_method' => 'translate_datetime'
     233            'callback_method' => 'callback_datetime'
    234234        );
    235235        $this->field_map[] = array(
    236236            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    237237            'to_type' => 'reply', 'to_fieldname' => 'post_modified',
    238             'translate_method' => 'translate_datetime'
     238            'callback_method' => 'callback_datetime'
    239239        );
    240240        $this->field_map[] = array(
    241241            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    242242            'to_type' => 'reply', 'to_fieldname' => 'post_modified_gmt',
    243             'translate_method' => 'translate_datetime'
     243            'callback_method' => 'callback_datetime'
    244244        );
    245245
     
    249249        $this->field_map[] = array(
    250250            'from_tablename' => 'user', 'from_fieldname' => 'userid',
    251             'to_type' => 'user', 'to_fieldname' => '_bbc_user_id'
     251            'to_type' => 'user', 'to_fieldname' => '_bbp_user_id'
    252252        );
    253253       
     
    255255        $this->field_map[] = array(
    256256            'from_tablename' => 'user', 'from_fieldname' => 'password',
    257             'to_type' => 'user', 'to_fieldname' => '_bbc_password',
    258             'translate_method' => 'translate_savepass'
     257            'to_type' => 'user', 'to_fieldname' => '_bbp_password',
     258            'callback_method' => 'callback_savepass'
    259259        );
    260260
     
    267267        // User password verify class. Stores in usermeta for verifying password.
    268268        $this->field_map[] = array(
    269             'to_type' => 'user', 'to_fieldname' => '_bbc_class',
     269            'to_type' => 'user', 'to_fieldname' => '_bbp_class',
    270270            'default' => 'Vbulletin'
    271271        );
     
    293293            'from_tablename' => 'user', 'from_fieldname' => 'joindate',
    294294            'to_type' => 'user', 'to_fieldname' => 'user_registered',
    295             'translate_method' => 'translate_datetime'
     295            'callback_method' => 'callback_datetime'
    296296        );
    297297       
     
    323323     * as one value. Array values are auto sanitized by wordpress.
    324324     */
    325     public function translate_savepass( $field, $row )
     325    public function callback_savepass( $field, $row )
    326326    {
    327327        $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
Note: See TracChangeset for help on using the changeset viewer.