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

    r5148 r5170  
    215215        );
    216216
     217        // Sticky status (Stored in postmeta))
     218        $this->field_map[] = array(
     219            'from_tablename'  => 'topics',
     220            'from_fieldname'  => 'pinned',
     221            'to_type'         => 'topic',
     222            'to_fieldname'    => '_bbp_old_sticky_status',
     223            'callback_method' => 'callback_sticky_status'
     224        );
     225
    217226        // Topic dates.
    218227        $this->field_map[] = array(
     
    472481        } else {
    473482            $status = 'forum';
     483        }
     484        return $status;
     485    }
     486
     487    /**
     488     * Translate the topic sticky status type from Invision numeric's to WordPress's strings.
     489     *
     490     * @param int $status Invision numeric forum type
     491     * @return string WordPress safe
     492     */
     493    public function callback_sticky_status( $status = 0 ) {
     494        switch ( $status ) {
     495            case 1 :
     496                $status = 'sticky';       // Invision Pinned Topic 'pinned = 1'
     497                break;
     498
     499            case 0  :
     500            default :
     501                $status = 'normal';       // Invision Normal Topic 'pinned = 0'
     502                break;
    474503        }
    475504        return $status;
Note: See TracChangeset for help on using the changeset viewer.