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/Invision.php

    r3816 r3866  
    1919        $this->field_map[] = array(
    2020            'from_tablename' => 'forums', 'from_fieldname' => 'id',
    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' => 'forums', 'from_fieldname' => 'parent_id',
    27             'to_type' => 'forum', 'to_fieldname' => '_bbc_parent_id'
     27            'to_type' => 'forum', 'to_fieldname' => '_bbp_parent_id'
    2828        );
    2929       
     
    3838            'from_tablename' => 'forums', 'from_fieldname' => 'name',
    3939            'to_type' => 'forum', 'to_fieldname' => 'post_name',
    40             'translate_method' => 'translate_title'
     40            'callback_method' => 'callback_slug'
    4141        );
    4242       
     
    4545            'from_tablename' => 'forums', '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' => 'topics', 'from_fieldname' => 'tid',
    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' => 'topics', 'from_fieldname' => 'forum_id',
    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' => 'topics', 'from_fieldname' => 'starter_id',
    9292            'to_type' => 'topic', 'to_fieldname' => 'post_author',
    93             'translate_method' => 'translate_userid'
     93            'callback_method' => 'callback_userid'
    9494        );
    9595           
     
    9999            'join_tablename' => 'topics', 'join_type' => 'INNER', 'join_expression' => 'ON(topics.tid = posts.topic_id) WHERE posts.new_topic = 1',
    100100            'to_type' => 'topic', 'to_fieldname' => 'post_content',
    101             'translate_method' => 'translate_html'
     101            'callback_method' => 'callback_html'
    102102        ); 
    103103       
     
    112112            'from_tablename' => 'topics', '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' => 'topics', 'from_fieldname' => 'forum_id',
    120120            'to_type' => 'topic', 'to_fieldname' => 'post_parent',
    121             'translate_method' => 'translate_forumid'
     121            'callback_method' => 'callback_forumid'
    122122        );
    123123
     
    126126            'from_tablename' => 'topics', 'from_fieldname' => 'start_date',
    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' => 'topics', 'from_fieldname' => 'start_date',
    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' => 'topics', 'from_fieldname' => 'last_post',
    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' => 'topics', 'from_fieldname' => 'last_post',
    142142            'to_type' => 'topic', 'to_fieldname' => 'post_modified_gmt',
    143             'translate_method' => 'translate_datetime'
     143            'callback_method' => 'callback_datetime'
    144144        );
    145145
     
    150150            'from_tablename' => 'core_tags', 'from_fieldname' => 'tag_meta_id',
    151151            'to_type' => 'tags', 'to_fieldname' => 'objectid',
    152             'translate_method' => 'translate_topicid'
     152            'callback_method' => 'callback_topicid'
    153153        );
    154154       
     
    164164        $this->field_map[] = array(
    165165            'from_tablename' => 'posts', 'from_fieldname' => 'pid', 'from_expression' => 'WHERE posts.new_topic = 1',
    166             'to_type' => 'reply', 'to_fieldname' => '_bbc_post_id'
     166            'to_type' => 'reply', 'to_fieldname' => '_bbp_post_id'
    167167        );
    168168       
     
    170170        $this->field_map[] = array(
    171171            'from_tablename' => 'posts', 'from_fieldname' => 'topic_id',
    172             'to_type' => 'reply', 'to_fieldname' => '_bbc_forum_id',
    173             'translate_method' => 'translate_topicid_to_forumid'
     172            'to_type' => 'reply', 'to_fieldname' => '_bbp_forum_id',
     173            'callback_method' => 'callback_topicid_to_forumid'
    174174        );
    175175       
     
    177177        $this->field_map[] = array(
    178178            'from_tablename' => 'posts', 'from_fieldname' => 'topic_id',
    179             'to_type' => 'reply', 'to_fieldname' => '_bbc_topic_id',
    180             'translate_method' => 'translate_topicid'
     179            'to_type' => 'reply', 'to_fieldname' => '_bbp_topic_id',
     180            'callback_method' => 'callback_topicid'
    181181        );
    182182       
     
    184184        $this->field_map[] = array(
    185185            'from_tablename' => 'posts', 'from_fieldname' => 'ip_address',
    186             'to_type' => 'reply', 'to_fieldname' => '__bbc_author_ip'
     186            'to_type' => 'reply', 'to_fieldname' => '__bbp_author_ip'
    187187        ); 
    188188           
     
    191191            'from_tablename' => 'posts', 'from_fieldname' => 'author_id',
    192192            'to_type' => 'reply', 'to_fieldname' => 'post_author',
    193             'translate_method' => 'translate_userid'
     193            'callback_method' => 'callback_userid'
    194194        );
    195195       
     
    204204            'from_tablename' => 'posts', 'from_fieldname' => 'post_title',
    205205            'to_type' => 'reply', 'to_fieldname' => 'post_name',
    206             'translate_method' => 'translate_title'
     206            'callback_method' => 'callback_slug'
    207207        );
    208208       
     
    211211            'from_tablename' => 'posts', 'from_fieldname' => 'post',
    212212            'to_type' => 'reply', 'to_fieldname' => 'post_content',
    213             'translate_method' => 'translate_html'
     213            'callback_method' => 'callback_html'
    214214        );
    215215       
     
    218218            'from_tablename' => 'posts', 'from_fieldname' => 'topic_id',
    219219            'to_type' => 'reply', 'to_fieldname' => 'post_parent',
    220             'translate_method' => 'translate_topicid'
     220            'callback_method' => 'callback_topicid'
    221221        );
    222222
     
    225225            'from_tablename' => 'posts', 'from_fieldname' => 'post_date',
    226226            'to_type' => 'reply', 'to_fieldname' => 'post_date',
    227             'translate_method' => 'translate_datetime'
     227            'callback_method' => 'callback_datetime'
    228228        );
    229229        $this->field_map[] = array(
    230230            'from_tablename' => 'posts', 'from_fieldname' => 'post_date',
    231231            'to_type' => 'reply', 'to_fieldname' => 'post_date_gmt',
    232             'translate_method' => 'translate_datetime'
     232            'callback_method' => 'callback_datetime'
    233233        );
    234234        $this->field_map[] = array(
    235235            'from_tablename' => 'posts', 'from_fieldname' => 'edit_time',
    236236            'to_type' => 'reply', 'to_fieldname' => 'post_modified',
    237             'translate_method' => 'translate_datetime'
     237            'callback_method' => 'callback_datetime'
    238238        );
    239239        $this->field_map[] = array(
    240240            'from_tablename' => 'posts', 'from_fieldname' => 'edit_time',
    241241            'to_type' => 'reply', 'to_fieldname' => 'post_modified_gmt',
    242             'translate_method' => 'translate_datetime'
     242            'callback_method' => 'callback_datetime'
    243243        );
    244244
     
    248248        $this->field_map[] = array(
    249249            'from_tablename' => 'members', 'from_fieldname' => 'member_id',
    250             'to_type' => 'user', 'to_fieldname' => '_bbc_user_id'
     250            'to_type' => 'user', 'to_fieldname' => '_bbp_user_id'
    251251        );
    252252       
     
    254254        $this->field_map[] = array(
    255255            'from_tablename' => 'members', 'from_fieldname' => 'members_pass_hash',
    256             'to_type' => 'user', 'to_fieldname' => '_bbc_password',
    257             'translate_method' => 'translate_savepass'
     256            'to_type' => 'user', 'to_fieldname' => '_bbp_password',
     257            'callback_method' => 'callback_savepass'
    258258        );
    259259
     
    266266        // User password verify class. Stores in usermeta for verifying password.
    267267        $this->field_map[] = array(
    268             'to_type' => 'user', 'to_fieldname' => '_bbc_class',
     268            'to_type' => 'user', 'to_fieldname' => '_bbp_class',
    269269            'default' => 'Invision'
    270270        );
     
    286286            'from_tablename' => 'members', 'from_fieldname' => 'joined',
    287287            'to_type' => 'user', 'to_fieldname' => 'user_registered',
    288             'translate_method' => 'translate_datetime'
     288            'callback_method' => 'callback_datetime'
    289289        );
    290290               
     
    326326     * as one value. Array values are auto sanitized by wordpress.
    327327     */
    328     public function translate_savepass( $field, $row )
     328    public function callback_savepass( $field, $row )
    329329    {
    330330        $pass_array = array( 'hash' => $field, 'salt' => $row['members_pass_salt'] );
Note: See TracChangeset for help on using the changeset viewer.