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/vBulletin3.php

    r5152 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
     
    587596        } else {
    588597            $status = 'forum';
     598        }
     599        return $status;
     600    }
     601
     602    /**
     603     * Translate the topic sticky status type from vBulletin v3.x numeric's to WordPress's strings.
     604     *
     605     * @param int $status vBulletin v3.x numeric forum type
     606     * @return string WordPress safe
     607     */
     608    public function callback_sticky_status( $status = 0 ) {
     609        switch ( $status ) {
     610            case 1 :
     611                $status = 'sticky';       // vBulletin Sticky 'topic_sticky = 1'
     612                break;
     613
     614            case 0  :
     615            default :
     616                $status = 'normal';       // vBulletin Normal Topic 'topic_sticky = 0'
     617                break;
    589618        }
    590619        return $status;
Note: See TracChangeset for help on using the changeset viewer.