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/Example.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       
     
    104104            'from_tablename' => 'thread', 'from_fieldname' => 'title',
    105105            'to_type' => 'topic', 'to_fieldname' => 'post_name',
    106             'translate_method' => 'translate_title'
     106            'callback_method' => 'callback_slug'
    107107        );
    108108       
     
    111111            'from_tablename' => 'thread', 'from_fieldname' => 'forumid',
    112112            'to_type' => 'topic', 'to_fieldname' => 'post_parent',
    113             'translate_method' => 'translate_forumid'
     113            'callback_method' => 'callback_forumid'
    114114        );
    115115
     
    118118            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    119119            'to_type' => 'topic', 'to_fieldname' => 'post_date',
    120             'translate_method' => 'translate_datetime'
     120            'callback_method' => 'callback_datetime'
    121121        );
    122122        $this->field_map[] = array(
    123123            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    124124            'to_type' => 'topic', 'to_fieldname' => 'post_date_gmt',
    125             'translate_method' => 'translate_datetime'
     125            'callback_method' => 'callback_datetime'
    126126        );
    127127        $this->field_map[] = array(
    128128            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    129129            'to_type' => 'topic', 'to_fieldname' => 'post_modified',
    130             'translate_method' => 'translate_datetime'
     130            'callback_method' => 'callback_datetime'
    131131        );
    132132        $this->field_map[] = array(
    133133            'from_tablename' => 'thread', 'from_fieldname' => 'dateline',
    134134            'to_type' => 'topic', 'to_fieldname' => 'post_modified_gmt',
    135             'translate_method' => 'translate_datetime'
     135            'callback_method' => 'callback_datetime'
    136136        );
    137137
     
    142142            'from_tablename' => 'tagcontent', 'from_fieldname' => 'contentid',
    143143            'to_type' => 'tags', 'to_fieldname' => 'objectid',
    144             'translate_method' => 'translate_topicid'
     144            'callback_method' => 'callback_topicid'
    145145        );
    146146       
     
    157157        $this->field_map[] = array(
    158158            'from_tablename' => 'post', 'from_fieldname' => 'postid',
    159             'to_type' => 'reply', 'to_fieldname' => '_bbc_post_id'
     159            'to_type' => 'reply', 'to_fieldname' => '_bbp_post_id'
    160160        );
    161161       
     
    163163        $this->field_map[] = array(
    164164            'from_tablename' => 'post', 'from_fieldname' => 'threadid',
    165             'to_type' => 'reply', 'to_fieldname' => '_bbc_forum_id',
    166             'translate_method' => 'translate_topicid_to_forumid'
     165            'to_type' => 'reply', 'to_fieldname' => '_bbp_forum_id',
     166            'callback_method' => 'callback_topicid_to_forumid'
    167167        );
    168168       
     
    170170        $this->field_map[] = array(
    171171            'from_tablename' => 'post', 'from_fieldname' => 'threadid',
    172             'to_type' => 'reply', 'to_fieldname' => '_bbc_topic_id',
    173             'translate_method' => 'translate_topicid'
     172            'to_type' => 'reply', 'to_fieldname' => '_bbp_topic_id',
     173            'callback_method' => 'callback_topicid'
    174174        );
    175175       
     
    177177        $this->field_map[] = array(
    178178            'from_tablename' => 'post', 'from_fieldname' => 'ipaddress',
    179             'to_type' => 'reply', 'to_fieldname' => '__bbc_author_ip'
     179            'to_type' => 'reply', 'to_fieldname' => '__bbp_author_ip'
    180180        ); 
    181181           
     
    184184            'from_tablename' => 'post', 'from_fieldname' => 'userid',
    185185            'to_type' => 'reply', 'to_fieldname' => 'post_author',
    186             'translate_method' => 'translate_userid'
     186            'callback_method' => 'callback_userid'
    187187        );
    188188       
     
    197197            'from_tablename' => 'post', 'from_fieldname' => 'title',
    198198            'to_type' => 'reply', 'to_fieldname' => 'post_name',
    199             'translate_method' => 'translate_title'
     199            'callback_method' => 'callback_slug'
    200200        );
    201201       
     
    204204            'from_tablename' => 'post', 'from_fieldname' => 'pagetext',
    205205            'to_type' => 'reply', 'to_fieldname' => 'post_content',
    206             'translate_method' => 'translate_html'
     206            'callback_method' => 'callback_html'
    207207        );
    208208       
     
    211211            'from_tablename' => 'post', 'from_fieldname' => 'threadid',
    212212            'to_type' => 'reply', 'to_fieldname' => 'post_parent',
    213             'translate_method' => 'translate_topicid'
     213            'callback_method' => 'callback_topicid'
    214214        );
    215215
     
    218218            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    219219            'to_type' => 'reply', 'to_fieldname' => 'post_date',
    220             'translate_method' => 'translate_datetime'
     220            'callback_method' => 'callback_datetime'
    221221        );
    222222        $this->field_map[] = array(
    223223            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    224224            'to_type' => 'reply', 'to_fieldname' => 'post_date_gmt',
    225             'translate_method' => 'translate_datetime'
     225            'callback_method' => 'callback_datetime'
    226226        );
    227227        $this->field_map[] = array(
    228228            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    229229            'to_type' => 'reply', 'to_fieldname' => 'post_modified',
    230             'translate_method' => 'translate_datetime'
     230            'callback_method' => 'callback_datetime'
    231231        );
    232232        $this->field_map[] = array(
    233233            'from_tablename' => 'post', 'from_fieldname' => 'dateline',
    234234            'to_type' => 'reply', 'to_fieldname' => 'post_modified_gmt',
    235             'translate_method' => 'translate_datetime'
     235            'callback_method' => 'callback_datetime'
    236236        );
    237237
     
    241241        $this->field_map[] = array(
    242242            'from_tablename' => 'user', 'from_fieldname' => 'userid',
    243             'to_type' => 'user', 'to_fieldname' => '_bbc_user_id'
     243            'to_type' => 'user', 'to_fieldname' => '_bbp_user_id'
    244244        );
    245245       
     
    247247        $this->field_map[] = array(
    248248            'from_tablename' => 'user', 'from_fieldname' => 'password',
    249             'to_type' => 'user', 'to_fieldname' => '_bbc_password',
    250             'translate_method' => 'translate_savepass'
     249            'to_type' => 'user', 'to_fieldname' => '_bbp_password',
     250            'callback_method' => 'callback_savepass'
    251251        );
    252252
     
    259259        // User password verify class. Stores in usermeta for verifying password.
    260260        $this->field_map[] = array(
    261             'to_type' => 'user', 'to_fieldname' => '_bbc_class',
     261            'to_type' => 'user', 'to_fieldname' => '_bbp_class',
    262262            'default' => 'Vbulletin'
    263263        );
     
    285285            'from_tablename' => 'user', 'from_fieldname' => 'joindate',
    286286            'to_type' => 'user', 'to_fieldname' => 'user_registered',
    287             'translate_method' => 'translate_datetime'
     287            'callback_method' => 'callback_datetime'
    288288        );
    289289       
     
    315315     * as one value. Array values are auto sanitized by wordpress.
    316316     */
    317     public function translate_savepass( $field, $row )
     317    public function callback_savepass( $field, $row )
    318318    {
    319319        $pass_array = array( 'hash' => $field, 'salt' => $row['salt'] );
Note: See TracChangeset for help on using the changeset viewer.