Skip to:
Content

bbPress.org

Changeset 5550


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

Include anonymous topic and reply import support in XMB 1.x (XMB.php) and PunBB (PunBB.php) importers
Props netweb. See #2347

Location:
trunk/src/includes/admin/converters
Files:
2 edited

Legend:

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

    r5530 r5550  
    186186        );
    187187
     188        // Topic author name (Stored in postmeta as _bbp_anonymous_name)
     189        $this->field_map[] = array(
     190            'from_tablename'  => 'topics',
     191            'from_fieldname'  => 'poster',
     192            'to_type'         => 'topic',
     193            'to_fieldname'    => '_bbp_old_topic_author_name_id'
     194        );
     195
     196        // Is the topic anonymous (Stored in postmeta)
     197        $this->field_map[] = array(
     198            'from_tablename'  => 'posts',
     199            'from_fieldname'  => 'poster_id',
     200            'join_tablename'  => 'topics',
     201            'join_type'       => 'LEFT',
     202            'join_expression' => 'ON topics.first_post_id = posts.id',
     203            'to_type'         => 'topic',
     204            'to_fieldname'    => '_bbp_old_is_topic_anonymous_id',
     205            'callback_method' => 'callback_check_anonymous'
     206        );
     207
    188208        // Topic Author ip (Stored in postmeta)
    189209        // Note: We join the 'posts' table because 'topics' table does not have author ip.
     
    344364            'to_fieldname'    => 'post_author',
    345365            'callback_method' => 'callback_userid'
     366        );
     367
     368        // Reply author name (Stored in postmeta as _bbp_anonymous_name)
     369        $this->field_map[] = array(
     370            'from_tablename'  => 'posts',
     371            'from_fieldname'  => 'poster',
     372            'to_type'         => 'reply',
     373            'to_fieldname'    => '_bbp_old_reply_author_name_id'
     374        );
     375
     376        // Is the reply anonymous (Stored in postmeta)
     377        $this->field_map[] = array(
     378            'from_tablename'  => 'posts',
     379            'from_fieldname'  => 'poster_id',
     380            'to_type'         => 'reply',
     381            'to_fieldname'    => '_bbp_old_is_reply_anonymous_id',
     382            'callback_method' => 'callback_check_anonymous'
    346383        );
    347384
  • trunk/src/includes/admin/converters/XMB.php

    r5549 r5550  
    196196        );
    197197
     198        // Topic author name (Stored in postmeta as _bbp_anonymous_name)
     199        $this->field_map[] = array(
     200            'from_tablename'  => 'threads',
     201            'from_fieldname'  => 'author',
     202            'to_type'         => 'topic',
     203            'to_fieldname'    => '_bbp_old_topic_author_name_id'
     204        );
     205
     206        // Is the topic anonymous (Stored in postmeta)
     207        $this->field_map[] = array(
     208            'from_tablename'  => 'members',
     209            'from_fieldname'  => 'uid',
     210            'join_tablename'  => 'threads',
     211            'join_type'       => 'LEFT',
     212            'join_expression' => 'ON threads.author = members.username  WHERE posts.subject = ""',
     213            'to_type'         => 'topic',
     214            'to_fieldname'    => '_bbp_old_is_topic_anonymous_id',
     215            'callback_method' => 'callback_check_anonymous'
     216        );
     217
    198218        // Topic Author ip (Stored in postmeta)
    199219        // Note: We join the 'posts' table because 'threads' table does not have author ip.
     
    371391            'to_fieldname'    => 'post_author',
    372392            'callback_method' => 'callback_userid'
     393        );
     394
     395        // Reply author name (Stored in postmeta as _bbp_anonymous_name)
     396        $this->field_map[] = array(
     397            'from_tablename'  => 'posts',
     398            'from_fieldname'  => 'author',
     399            'to_type'         => 'reply',
     400            'to_fieldname'    => '_bbp_old_reply_author_name_id'
     401        );
     402
     403        // Is the reply anonymous (Stored in postmeta)
     404        $this->field_map[] = array(
     405            'from_tablename'  => 'members',
     406            'from_fieldname'  => 'uid',
     407            'join_tablename'  => 'posts',
     408            'join_type'       => 'LEFT',
     409            'join_expression' => 'ON posts.author = members.username WHERE posts.subject = ""',
     410            'to_type'         => 'reply',
     411            'to_fieldname'    => '_bbp_old_is_reply_anonymous_id',
     412            'callback_method' => 'callback_check_anonymous'
    373413        );
    374414
Note: See TracChangeset for help on using the changeset viewer.