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

    r5144 r5170  
    240240        );
    241241
     242        // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed)
     243        $this->field_map[] = array(
     244            'from_tablename'  => 'threads',
     245            'from_fieldname'  => 'closed',
     246            'to_type'         => 'topic',
     247            'to_fieldname'    => 'post_status',
     248            'callback_method' => 'callback_topic_status'
     249        );
     250
     251        // Sticky status (Stored in postmeta))
     252        $this->field_map[] = array(
     253            'from_tablename'  => 'threads',
     254            'from_fieldname'  => 'topped',
     255            'to_type'         => 'topic',
     256            'to_fieldname'    => '_bbp_old_sticky_status',
     257            'callback_method' => 'callback_sticky_status'
     258        );
     259
    242260        // Topic dates.
    243261        // Note: We join the 'posts' table because 'threads' table does not include dates.
     
    291309            'to_fieldname'    => '_bbp_last_active_time',
    292310            'callback_method' => 'callback_datetime'
    293         );
    294 
    295         // Topic status (Open or Closed, XMB v1.9.11.13 ''=open & 'yes'=closed)
    296         $this->field_map[] = array(
    297             'from_tablename'  => 'threads',
    298             'from_fieldname'  => 'closed',
    299             'to_type'         => 'topic',
    300             'to_fieldname'    => 'post_status',
    301             'callback_method' => 'callback_topic_status'
    302311        );
    303312
     
    657666
    658667    /**
     668     * Translate the topic sticky status type from XMB v1.9.11.13 numeric's to WordPress's strings.
     669     *
     670     * @param int $status XMB v1.9.11.13 numeric forum type
     671     * @return string WordPress safe
     672     */
     673    public function callback_sticky_status( $status = 0 ) {
     674        switch ( $status ) {
     675            case 1 :
     676                $status = 'sticky';       // XMB Sticky 'topped = 1'
     677                break;
     678
     679            case 0  :
     680            default :
     681                $status = 'normal';       // XMB Normal Topic 'topped = 0'
     682                break;
     683        }
     684        return $status;
     685    }
     686
     687    /**
    659688     * Verify the topic/reply count.
    660689     *
Note: See TracChangeset for help on using the changeset viewer.