Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/23/2013 11:19:34 AM (12 years ago)
Author:
netweb
Message:

Include 'sticky' and 'super sticky' import capabilities for the following forum importers:

  • AEF, Drupal7, Example, FluxBB, Invision, Mingle, MyBB, phpBB, PHPFox, PunBB, SimplePress, vBulletin v4.x, vBulletin v3.x, Xenforo and XMB forum importers
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/converters/vBulletin.php

    r5153 r5170  
    236236        );
    237237
     238        // Topic status (Open or Closed)
     239        $this->field_map[] = array(
     240            'from_tablename'  => 'thread',
     241            'from_fieldname'  => 'open',
     242            'to_type'         => 'topic',
     243            'to_fieldname'    => 'post_status',
     244            'callback_method' => 'callback_topic_status'
     245        );
     246
     247        // Sticky status (Stored in postmeta))
     248        $this->field_map[] = array(
     249            'from_tablename'  => 'thread',
     250            'from_fieldname'  => 'sticky',
     251            'to_type'         => 'topic',
     252            'to_fieldname'    => '_bbp_old_sticky_status',
     253            'callback_method' => 'callback_sticky_status'
     254        );
     255
    238256        // Topic dates.
    239257        $this->field_map[] = array(
     
    271289            'to_fieldname'   => '_bbp_last_active_time',
    272290            'callback_method' => 'callback_datetime'
    273         );
    274 
    275         // Topic status (Open or Closed)
    276         $this->field_map[] = array(
    277             'from_tablename'  => 'thread',
    278             'from_fieldname'  => 'open',
    279             'to_type'         => 'topic',
    280             'to_fieldname'    => 'post_status',
    281             'callback_method' => 'callback_topic_status'
    282291        );
    283292
     
    588597
    589598    /**
     599     * Translate the topic sticky status type from vBulletin v4.x numeric's to WordPress's strings.
     600     *
     601     * @param int $status vBulletin v4.x numeric forum type
     602     * @return string WordPress safe
     603     */
     604    public function callback_sticky_status( $status = 0 ) {
     605        switch ( $status ) {
     606            case 2 :
     607                $status = 'super-sticky'; // vBulletin Super Sticky 'sticky = 2'
     608                break;
     609
     610            case 1 :
     611                $status = 'sticky';       // vBulletin Sticky 'sticky = 1'
     612                break;
     613
     614            case 0  :
     615            default :
     616                $status = 'normal';       // vBulletin Normal Topic 'sticky = 0'
     617                break;
     618        }
     619        return $status;
     620    }
     621
     622    /**
    590623     * Verify the topic reply count.
    591624     *
Note: See TracChangeset for help on using the changeset viewer.