Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Implementation of Social Engine converter.
- */
- class SocialEngine extends BBP_Converter_Base {
- function __construct() {
- parent::__construct();
- $this->setup_globals();
- }
- public function setup_globals() {
- /** Forum Section ***************************************************** */
- // Forum id. Stored in postmeta.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forums',
- 'from_fieldname' => 'forum_id',
- 'to_type' => 'forum',
- 'to_fieldname' =>
- '_bbp_forum_id'
- );
- // Forum parent id. If no parent, than 0. Stored in postmeta.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumtopics',
- 'from_fieldname' => 'forumtopic_forum_id',
- 'to_type' => 'forum',
- 'to_fieldname' => '_bbp_parent_id'
- );
- // Forum title.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forums',
- 'from_fieldname' => 'forum_title',
- 'join_tablename' => 'se_languagevars',
- 'join_type' => 'INNER',
- 'join_expression' => 'USING(languagevar_id)',
- 'to_type' => 'forum',
- 'to_fieldname' => 'post_title'
- );
- // Forum slug. Clean name.
- $this->field_map[] = array(
- 'from_tablename' => 'forum',
- 'from_fieldname' => 'title_clean',
- 'to_type' => 'forum',
- 'to_fieldname' => 'post_name',
- 'callback_method' => 'callback_slug'
- );
- // Forum description.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forums',
- 'from_fieldname' => 'forum_desc',
- 'join_tablename' => 'se_languagevars',
- 'join_type' => 'INNER',
- 'join_expression' => 'USING(languagevar_id)',
- 'to_type' => 'forum', 'to_fieldname' => 'post_content',
- 'callback_method' => 'callback_null'
- );
- // Forum display order. Starts from 1.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forums',
- 'from_fieldname' => 'forum_order',
- 'to_type' => 'forum',
- 'to_fieldname' => 'menu_order'
- );
- // Forum date update.
- $this->field_map[] = array(
- 'to_type' => 'forum',
- 'to_fieldname' => 'post_date',
- 'default' => date('Y-m-d H:i:s')
- );
- /** Topic Section ***************************************************** */
- // Topic id. Stored in postmeta.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumtopics',
- 'from_fieldname' => 'forumtopic_id',
- 'to_type' => 'topic',
- 'to_fieldname' => '_bbp_topic_id'
- );
- // Forum id. Stored in postmeta.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumtopics',
- 'from_fieldname' => 'forumtopic_forum_id',
- 'to_type' => 'topic',
- 'to_fieldname' => '_bbp_forum_id',
- 'callback_method' => 'callback_forumid'
- );
- // Topic author.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumposts',
- 'from_fieldname' => 'forumpost_authoruser_id',
- 'to_type' => 'topic',
- 'to_fieldname' => 'post_author',
- 'callback_method' => 'callback_userid'
- );
- // Topic title.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumtopis',
- 'from_fieldname' => 'forumtopic_subject',
- 'to_type' => 'topic',
- 'to_fieldname' => 'post_title'
- );
- // Forum id. If no parent, than 0.
- $this->field_map[] = array(
- 'from_tablename' => 'thread',
- 'from_fieldname' => 'forumid',
- 'to_type' => 'topic',
- 'to_fieldname' => 'post_parent',
- 'callback_method' => 'callback_forumid'
- );
- /** Post Section ***************************************************** */
- // Post id. Stores in postmeta.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumposts',
- 'from_fieldname' => 'forumpost_id',
- 'to_type' => 'reply',
- 'to_fieldname' => '_bbp_post_id'
- );
- // Topic id. Stores in postmeta.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumposts',
- 'from_fieldname' => 'forumpost_forumtopic_id',
- 'to_type' => 'reply',
- 'to_fieldname' => '_bbp_topic_id',
- 'callback_method' => 'callback_topicid'
- );
- // Author ip.
- $this->field_map[] = array(
- 'from_tablename' => 'se_users',
- 'from_fieldname' => 'user_ip_lastactive',
- 'to_type' => 'reply',
- 'to_fieldname' => '__bbp_author_ip'
- );
- // Post author.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumposts',
- 'from_fieldname' => 'forumpost_authoruser_id',
- 'to_type' => 'reply',
- 'to_fieldname' => 'post_author',
- 'callback_method' => 'callback_userid'
- );
- // Post content.
- $this->field_map[] = array(
- 'from_tablename' => 'se_forumposts',
- 'from_fieldname' => 'forumpost_body',
- 'to_type' => 'reply',
- 'to_fieldname' => 'post_content',
- 'callback_method' => 'callback_html'
- );
- }
- /**
- * This method allows us to indicates what is or is not converted for each
- * converter.
- */
- public function info() {
- return '';
- }
- /**
- * This method is to save the salt and password together. That
- * way when we authenticate it we can get it out of the database
- * as one value. Array values are auto sanitized by WordPress.
- */
- public function callback_savepass($field, $row) {
- return false;
- }
- /**
- * This method is to take the pass out of the database and compare
- * to a pass the user has typed in.
- */
- public function authenticate_pass($password, $serialized_pass) {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement