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

    r5136 r5170  
    251251        );
    252252
     253        // Sticky status (Stored in postmeta))
     254        $this->field_map[] = array(
     255            'from_tablename'  => 'topics',
     256            'from_fieldname'  => 'topic_sticky',
     257            'to_type'         => 'topic',
     258            'to_fieldname'    => '_bbp_old_sticky_status',
     259            'callback_method' => 'callback_sticky_status'
     260        );
     261
    253262        // Topic dates.
    254263        $this->field_map[] = array(
     
    358367
    359368        // Reply slug (Clean name to avoid conflicts)
    360         // Note: We join the 'topics' table because 'posts' table does not include topic title.
     369        // Note: We join the 'topics' table because 'posts' table does not include topic slug.
    361370        $this->field_map[] = array(
    362371            'from_tablename'  => 'topics',
     
    572581
    573582    /**
     583     * Translate the topic sticky status type from bbPress 1.x numeric's to WordPress's strings.
     584     *
     585     * @param int $status bbPress 1.x numeric forum type
     586     * @return string WordPress safe
     587     */
     588    public function callback_sticky_status( $status = 0 ) {
     589        switch ( $status ) {
     590            case 2 :
     591                $status = 'super-sticky'; // bbPress Super Sticky 'topic_sticky = 2'
     592                break;
     593
     594            case 1 :
     595                $status = 'sticky';       // bbPress Sticky 'topic_sticky = 1'
     596                break;
     597
     598            case 0  :
     599            default :
     600                $status = 'normal';       // bbPress Normal Topic 'topic_sticky = 0'
     601                break;
     602        }
     603        return $status;
     604    }
     605
     606    /**
    574607     * Verify the topic reply count.
    575608     *
Note: See TracChangeset for help on using the changeset viewer.