Skip to:
Content

bbPress.org

Changeset 5548


Ignore:
Timestamp:
10/10/2014 08:45:23 AM (10 years ago)
Author:
netweb
Message:

Include anonymous topic and reply import support in SimplePress 5 (SimplePress5.php) importer
Props netweb. See #2347

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/converters/SimplePress5.php

    r5547 r5548  
    192192        );
    193193
     194        // Topic author name (Stored in postmeta as _bbp_anonymous_name)
     195        $this->field_map[] = array(
     196            'from_tablename'  => 'sfposts',
     197            'from_fieldname'  => 'guest_name',
     198            'join_tablename'  => 'sftopics',
     199            'join_type'       => 'INNER',
     200            'join_expression' => 'USING (topic_id) WHERE sfposts.post_index = 1',
     201            'to_type'         => 'topic',
     202            'to_fieldname'    => '_bbp_old_topic_author_name_id'
     203        );
     204
     205        // Is the topic anonymous (Stored in postmeta)
     206        $this->field_map[] = array(
     207            'from_tablename'  => 'sftopics',
     208            'from_fieldname'  => 'user_id',
     209            'to_type'         => 'topic',
     210            'to_fieldname'    => '_bbp_old_is_topic_anonymous_id',
     211            'callback_method' => 'callback_check_anonymous'
     212        );
     213
    194214        // Topic content.
    195215        // Note: We join the sfposts table because sftopics do not have content.
     
    331351            'to_fieldname'    => 'post_author',
    332352            'callback_method' => 'callback_userid'
     353        );
     354
     355        // Reply author name (Stored in postmeta as _bbp_anonymous_name)
     356        $this->field_map[] = array(
     357            'from_tablename'  => 'sfposts',
     358            'from_fieldname'  => 'guest_name',
     359            'to_type'         => 'reply',
     360            'to_fieldname'    => '_bbp_old_reply_author_name_id'
     361        );
     362
     363        // Is the reply anonymous (Stored in postmeta)
     364        $this->field_map[] = array(
     365            'from_tablename'  => 'sfposts',
     366            'from_fieldname'  => 'user_id',
     367            'to_type'         => 'reply',
     368            'to_fieldname'    => '_bbp_old_is_reply_anonymous_id',
     369            'callback_method' => 'callback_check_anonymous'
    333370        );
    334371
Note: See TracChangeset for help on using the changeset viewer.