Skip to content

Commit

Permalink
Merge pull request #2 from 384forFluxBB/master
Browse files Browse the repository at this point in the history
#735 Update converter to support FluxBB 1.5
  • Loading branch information
franzliedke committed Feb 16, 2014
2 parents 29dffdd + 6ecb793 commit e4fff27
Show file tree
Hide file tree
Showing 26 changed files with 493 additions and 192 deletions.
2 changes: 1 addition & 1 deletion converter.php
Expand Up @@ -3,7 +3,7 @@
/**
* Command line based converter script
*
* @copyright (C) 2012 FluxBB (http://fluxbb.org)
* @copyright (C) 2013 FluxBB (http://fluxbb.org)
* @license GPL - GNU General Public License (http://www.gnu.org/licenses/gpl.html)
* @package FluxBB
*/
Expand Down
22 changes: 3 additions & 19 deletions forums/IP_Board_3_2.php
@@ -1,15 +1,15 @@
<?php

/**
* @copyright (C) 2012 FluxBB (http://fluxbb.org)
* @copyright (C) 2013 FluxBB (http://fluxbb.org)
* @license GPL - GNU General Public License (http://www.gnu.org/licenses/gpl.html)
* @package FluxBB
*/

// Define the version and database revision that this code was written for
define('FORUM_VERSION', '1.4.8');
define('FORUM_VERSION', '1.5.3');

define('FORUM_DB_REVISION', 15);
define('FORUM_DB_REVISION', 18);
define('FORUM_SI_REVISION', 2);
define('FORUM_PARSER_REVISION', 2);

Expand All @@ -27,7 +27,6 @@ class IP_Board_3_2 extends Forum
// 'forum_perms' => 0,
'groups' => array('groups', 'g_id', 'g_id > 6'),
'posts' => array('posts', 'pid'),
'ranks' => array('titles', 'id'),
'reports' => array('rc_reports', 'rid'),
'topic_subscriptions' => 0, // TODO:
'forum_subscriptions' => 0, // TODO:
Expand Down Expand Up @@ -146,7 +145,6 @@ function convert_config()
'o_quickpost' => 1,
'o_users_online' => 1,
'o_censoring' => 0,
'o_ranks' => 1,
'o_show_dot' => 0,
'o_topic_views' => 1,
'o_quickjump' => 1,
Expand Down Expand Up @@ -301,20 +299,6 @@ function convert_posts($start_at)
return $this->redirect('posts', 'pid', $start_at);
}

function convert_ranks()
{
$result = $this->db->query_build(array(
'SELECT' => 'id, title AS rank, posts AS min_posts',
'FROM' => 'titles',
)) or conv_error('Unable to fetch ranks', __FILE__, __LINE__, $this->db->error());

conv_processing_message('ranks', $this->db->num_rows($result));
while ($cur_rank = $this->db->fetch_assoc($result))
{
$this->fluxbb->add_row('ranks', $cur_rank);
}
}

function convert_reports()
{
$result = $this->db->query_build(array(
Expand Down
55 changes: 19 additions & 36 deletions forums/Merge_FluxBB.php
@@ -1,15 +1,15 @@
<?php

/**
* @copyright (C) 2012 FluxBB (http://fluxbb.org)
* @copyright (C) 2013 FluxBB (http://fluxbb.org)
* @license GPL - GNU General Public License (http://www.gnu.org/licenses/gpl.html)
* @package FluxBB
*/

// Define the version and database revision that this code was written for
define('FORUM_VERSION', '1.4.8');
define('FORUM_VERSION', '1.5.3');

define('FORUM_DB_REVISION', 15);
define('FORUM_DB_REVISION', 18);
define('FORUM_SI_REVISION', 2);
define('FORUM_PARSER_REVISION', 2);

Expand All @@ -20,22 +20,21 @@ class Merge_FluxBB extends Forum

// Do not truncate FluxBB database tables
const NO_DB_CLEANUP = true;

var $steps = array(
'groups' => -1,//array('groups', 'g_id', 'g_id > 4'),
'users' => -1,//array('users', 'id', 'id > 1'),
'bans' => -1,//array('bans', 'id'),
'categories' => -1,//array('categories', 'id'),
'censoring' => -1,//array('censoring', 'id'),
'config' => -1,//array('config', 'conf_name'),
'forums' => -1,//array('forums', 'id'),
'forum_perms' => -1,//array('forum_perms', 'forum_id'),
'topics' => -1,//array('topics', 'id'),
'posts' => -1,//array('posts', 'id'),
'ranks' => -1,//array('ranks', 'id'),
'reports' => -1,//array('reports', 'id'),
'topic_subscriptions' => -1,//array('topic_subscriptions', 'topic_id'),
'forum_subscriptions' => -1,//array('forum_subscriptions', 'forum_id'),

public $steps = array(
'groups' => -1, // array('groups', 'g_id', 'g_id > 4'),
'users' => -1, // array('users', 'id', 'id > 1'),
'bans' => -1, // array('bans', 'id'),
'categories' => -1, // array('categories', 'id', 'id > 1'),
'censoring' => -1, // array('censoring', 'id'),
'config' => -1, // array('config', 'conf_name'),
'forums' => -1, // array('forums', 'id'),
'forum_perms' => -1, // array('forum_perms', 'forum_id'),
'topics' => -1, // array('topics', 'id'),
'posts' => -1, // array('posts', 'id'),
'reports' => -1, // array('reports', 'id'),
'topic_subscriptions' => -1, // array('topic_subscriptions', 'topic_id'),
'forum_subscriptions' => -1, // array('forum_subscriptions', 'forum_id'),
);

var $last_id = array();
Expand All @@ -50,7 +49,7 @@ function initialize()
$this->last_id = $session['last_id'];
else
{
$check_id = array('groups' => 'g_id', 'users', 'bans', 'categories', 'censoring', 'forums', 'topics', 'posts', 'ranks', 'reports');
$check_id = array('groups' => 'g_id', 'users', 'bans', 'categories', 'censoring', 'forums', 'topics', 'posts', 'reports');

foreach ($check_id as $key => $cur_table)
{
Expand Down Expand Up @@ -223,22 +222,6 @@ function convert_posts($start_at)
return $this->redirect('posts', 'id', $start_at);
}

function convert_ranks()
{
$result = $this->db->query_build(array(
'SELECT' => 'id, rank, min_posts',
'FROM' => 'ranks',
)) or conv_error('Unable to fetch ranks', __FILE__, __LINE__, $this->db->error());

conv_processing_message('ranks', $this->db->num_rows($result));
while ($cur_rank = $this->db->fetch_assoc($result))
{
$cur_rank['id'] += $this->last_id['ranks'];

$this->fluxbb->add_row('ranks', $cur_rank);
}
}

function convert_reports()
{
$result = $this->db->query_build(array(
Expand Down
22 changes: 3 additions & 19 deletions forums/MyBB_1.php
@@ -1,15 +1,15 @@
<?php

/**
* @copyright (C) 2012 FluxBB (http://fluxbb.org)
* @copyright (C) 2013 FluxBB (http://fluxbb.org)
* @license GPL - GNU General Public License (http://www.gnu.org/licenses/gpl.html)
* @package FluxBB
*/

// Define the version and database revision that this code was written for
define('FORUM_VERSION', '1.4.8');
define('FORUM_VERSION', '1.5.3');

define('FORUM_DB_REVISION', 15);
define('FORUM_DB_REVISION', 18);
define('FORUM_SI_REVISION', 2);
define('FORUM_PARSER_REVISION', 2);

Expand All @@ -27,7 +27,6 @@ class MyBB_1 extends Forum
// 'forum_perms' => 0,
'groups' => array('usergroups', 'gid', 'gid > 7'),
'posts' => array('posts', 'pid'),
'ranks' => array('usertitles', 'utid'),
'reports' => array('reportedposts', 'rid'),
'topic_subscriptions' => array('threadsubscriptions', 'tid'),
'forum_subscriptions' => array('forumsubscriptions', 'fid'),
Expand Down Expand Up @@ -143,7 +142,6 @@ function convert_config()
'o_quickpost' => 1,
'o_users_online' => 1,
'o_censoring' => 0,
'o_ranks' => 1,
'o_show_dot' => $old_config['dotfolders'],
'o_topic_views' => 1,
'o_quickjump' => 1,
Expand Down Expand Up @@ -292,20 +290,6 @@ function convert_posts($start_at)
return $this->redirect('posts', 'pid', $start_at);
}

function convert_ranks()
{
$result = $this->db->query_build(array(
'SELECT' => 'utid AS id, title AS rank, posts AS min_posts',
'FROM' => 'usertitles',
)) or conv_error('Unable to fetch ranks', __FILE__, __LINE__, $this->db->error());

conv_processing_message('ranks', $this->db->num_rows($result));
while ($cur_rank = $this->db->fetch_assoc($result))
{
$this->fluxbb->add_row('ranks', $cur_rank);
}
}

function convert_reports()
{
$result = $this->db->query_build(array(
Expand Down
22 changes: 3 additions & 19 deletions forums/PHP_Fusion_7.php
@@ -1,15 +1,15 @@
<?php

/**
* @copyright (C) 2012 FluxBB (http://fluxbb.org)
* @copyright (C) 2013 FluxBB (http://fluxbb.org)
* @license GPL - GNU General Public License (http://www.gnu.org/licenses/gpl.html)
* @package FluxBB
*/

// Define the version and database revision that this code was written for
define('FORUM_VERSION', '1.4.8');
define('FORUM_VERSION', '1.5.3');

define('FORUM_DB_REVISION', 15);
define('FORUM_DB_REVISION', 18);
define('FORUM_SI_REVISION', 2);
define('FORUM_PARSER_REVISION', 2);

Expand All @@ -27,7 +27,6 @@ class PHP_Fusion_7 extends Forum
// 'forum_perms' => 0,
'groups' => array('user_groups', 'group_id'),
'posts' => array('posts', 'post_id'),
'ranks' => 0,//array('ranks', 'rank_id'),
'reports' => 0,//array('reports', 'report_id'),
'topic_subscriptions' => array('thread_notify', 'thread_id'),
'forum_subscriptions' => 0,//array('forums_watch', 'forum_id'),
Expand Down Expand Up @@ -145,7 +144,6 @@ function convert_config()
'o_quickpost' => 1,
'o_users_online' => 1,
'o_censoring' => $old_config['bad_words_enabled'],
'o_ranks' => 1,
'o_show_dot' => 0,
'o_topic_views' => 1,
'o_quickjump' => 1,
Expand Down Expand Up @@ -311,20 +309,6 @@ function convert_posts($start_at)
return $this->redirect('posts', 'post_id', $start_at);
}

// function convert_ranks()
// {
// $result = $this->db->query_build(array(
// 'SELECT' => 'rank_id AS id, rank_title AS rank, rank_min AS min_posts',
// 'FROM' => 'ranks',
// )) or conv_error('Unable to fetch ranks', __FILE__, __LINE__, $this->db->error());

// conv_processing_message('ranks', $this->db->num_rows($result));
// while ($cur_rank = $this->db->fetch_assoc($result))
// {
// $this->fluxbb->add_row('ranks', $cur_rank);
// }
// }

// function convert_reports()
// {
// $result = $this->db->query_build(array(
Expand Down
23 changes: 3 additions & 20 deletions forums/PhpBB_3_0.php
@@ -1,15 +1,15 @@
<?php

/**
* @copyright (C) 2012 FluxBB (http://fluxbb.org)
* @copyright (C) 2013 FluxBB (http://fluxbb.org)
* @license GPL - GNU General Public License (http://www.gnu.org/licenses/gpl.html)
* @package FluxBB
*/

// Define the version and database revision that this code was written for
define('FORUM_VERSION', '1.4.8');
define('FORUM_VERSION', '1.5.3');

define('FORUM_DB_REVISION', 15);
define('FORUM_DB_REVISION', 18);
define('FORUM_SI_REVISION', 2);
define('FORUM_PARSER_REVISION', 2);

Expand All @@ -27,7 +27,6 @@ class PhpBB_3_0 extends Forum
// 'forum_perms' => 0,
'groups' => array('groups', 'group_id', 'group_id > 7'),
'posts' => array('posts', 'post_id'),
'ranks' => array('ranks', 'rank_id', 'rank_special = 0'),
'reports' => array('reports', 'report_id'),
'topic_subscriptions' => array('topics_watch', 'topic_id'),
'forum_subscriptions' => array('forums_watch', 'forum_id'),
Expand Down Expand Up @@ -146,7 +145,6 @@ function convert_config()
'o_quickpost' => 1,
'o_users_online' => 1,
'o_censoring' => 0,
'o_ranks' => 1,
'o_show_dot' => 0,
'o_topic_views' => 1,
'o_quickjump' => 1,
Expand Down Expand Up @@ -302,21 +300,6 @@ function convert_posts($start_at)
return $this->redirect('posts', 'post_id', $start_at);
}

function convert_ranks()
{
$result = $this->db->query_build(array(
'SELECT' => 'rank_id AS id, rank_title AS rank, rank_min AS min_posts',
'FROM' => 'ranks',
'WHERE' => 'rank_special = 0'
)) or conv_error('Unable to fetch ranks', __FILE__, __LINE__, $this->db->error());

conv_processing_message('ranks', $this->db->num_rows($result));
while ($cur_rank = $this->db->fetch_assoc($result))
{
$this->fluxbb->add_row('ranks', $cur_rank);
}
}

function convert_reports()
{
$result = $this->db->query_build(array(
Expand Down

0 comments on commit e4fff27

Please sign in to comment.