Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/25/2014 07:05:49 AM (10 years ago)
Author:
netweb
Message:

Include anonymous topic and reply import support in phpBB.php and SMF.php importers
Props netweb. See #2347

File:
1 edited

Legend:

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

    r5530 r5539  
    194194        );
    195195
     196        // Topic author name (Stored in postmeta as _bbp_anonymous_name)
     197        $this->field_map[] = array(
     198            'from_tablename'  => 'topics',
     199            'from_fieldname'  => 'topic_first_poster_name',
     200            'to_type'         => 'topic',
     201            'to_fieldname'    => '_bbp_old_topic_author_name_id'
     202        );
     203
     204        // Is the topic anonymous (Stored in postmeta)
     205        $this->field_map[] = array(
     206            'from_tablename'  => 'topics',
     207            'from_fieldname'  => 'topic_poster',
     208            'to_type'         => 'topic',
     209            'to_fieldname'    => '_bbp_old_is_topic_anonymous_id',
     210            'callback_method' => 'callback_check_anonymous'
     211        );
     212
    196213        // Topic Author ip (Stored in postmeta)
    197214        $this->field_map[] = array(
     
    358375            'to_fieldname'    => 'post_author',
    359376            'callback_method' => 'callback_userid'
     377        );
     378
     379        // Reply author name (Stored in postmeta as _bbp_anonymous_name)
     380        $this->field_map[] = array(
     381            'from_tablename'  => 'posts',
     382            'from_fieldname'  => 'post_username',
     383            'to_type'         => 'reply',
     384            'to_fieldname'    => '_bbp_old_reply_author_name_id'
     385        );
     386
     387        // Is the reply anonymous (Stored in postmeta)
     388        $this->field_map[] = array(
     389            'from_tablename'  => 'posts',
     390            'from_fieldname'  => 'poster_id',
     391            'to_type'         => 'reply',
     392            'to_fieldname'    => '_bbp_old_is_reply_anonymous_id',
     393            'callback_method' => 'callback_check_anonymous'
    360394        );
    361395
     
    792826
    793827    /**
     828     * Check the anonymous topic or reply status
     829     *
     830     * @since  (r5539)
     831     *
     832     * @param int $status phpBB v3.x anonymous topic/reply status
     833     * @return string WordPress safe
     834     */
     835    public function callback_check_anonymous( $status = 0 ) {
     836        if ( $status == 1 ) {
     837            $status = 'true';
     838        } else {
     839            $status = 'false';
     840        }
     841        return $status;
     842    }
     843
     844    /**
    794845     * This callback processes any custom parser.php attributes and custom code with preg_replace
    795846     */
Note: See TracChangeset for help on using the changeset viewer.