Skip to:
Content

bbPress.org


Ignore:
Timestamp:
10/10/2014 10:25:07 AM (12 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.