Skip to:
Content

bbPress.org

Changeset 5989


Ignore:
Timestamp:
03/30/2016 12:21:08 PM (9 years ago)
Author:
netweb
Message:

Importers: Add support for anonymous topic and reply import support in XenForo (XenForo.php) importer

This changeset adds support for importing topics and replies where the original XenForo author was deleted, this keeps the original author name as the now topic or reply anonymous author name.

Props netweb.
Fixes #2922, See aslo #2347.

File:
1 edited

Legend:

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

    r5951 r5989  
    242242        );
    243243
     244        // Topic author name (Stored in postmeta as _bbp_anonymous_name)
     245        $this->field_map[] = array(
     246            'from_tablename' => 'thread',
     247            'from_fieldname' => 'username',
     248            'to_type'        => 'topic',
     249            'to_fieldname'   => '_bbp_old_topic_author_name_id'
     250        );
     251
     252        // Is the topic anonymous (Stored in postmeta)
     253        $this->field_map[] = array(
     254            'from_tablename'  => 'thread',
     255            'from_fieldname'  => 'user_id',
     256            'to_type'         => 'topic',
     257            'to_fieldname'    => '_bbp_old_is_topic_anonymous_id',
     258            'callback_method' => 'callback_check_anonymous'
     259        );
     260
    244261        // Topic title.
    245262        $this->field_map[] = array(
     
    406423            'to_fieldname'    => 'post_author',
    407424            'callback_method' => 'callback_userid'
     425        );
     426
     427
     428        // Reply author name (Stored in postmeta as _bbp_anonymous_name)
     429        $this->field_map[] = array(
     430            'from_tablename'  => 'post',
     431            'from_fieldname'  => 'username',
     432            'to_type'         => 'reply',
     433            'to_fieldname'   => '_bbp_old_reply_author_name_id'
     434        );
     435
     436        // Is the reply anonymous  (Stored in postmeta)
     437        $this->field_map[] = array(
     438            'from_tablename'  => 'post',
     439            'from_fieldname'  => 'user_id',
     440            'to_type'         => 'reply',
     441            'to_fieldname'    => '_bbp_old_is_reply_anonymous_id',
     442            'callback_method' => 'callback_check_anonymous'
    408443        );
    409444
Note: See TracChangeset for help on using the changeset viewer.