*
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $dispatcher, $flush_action;
phpbb_display_steps(5);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 5: Import topics'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'replies');
if ($flush_action == 'topics') {
    $Form->begin_fieldset(T_('Import log'));
    // Import the topics into the posts
    phpbb_import_topics();
    $Form->end_fieldset();
}
$Form->begin_fieldset(T_('Report of the topics import'));
$Form->info(T_('Count of the imported topics'), '<b>' . (int) phpbb_get_var('topics_count_imported') . '</b>');
$Form->info(T_('Count of the imported forums'), (int) phpbb_get_var('forums_count_imported'));
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $dispatcher, $flush_action;
phpbb_display_steps(6);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 6: Import replies'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'messages');
if ($flush_action == 'replies') {
    $Form->begin_fieldset(T_('Import log'));
    // Import the replies into the comments
    phpbb_import_replies();
    $Form->end_fieldset();
}
$Form->begin_fieldset(T_('Report of the replies import'));
$Form->info(T_('Count of the imported replies'), '<b>' . (int) phpbb_get_var('replies_count_imported') . '</b>');
$Form->info(T_('Count of the imported topics'), (int) phpbb_get_var('topics_count_imported'));
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $dispatcher, $flush_action;
phpbb_display_steps(7);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 7: Import messages'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'finish');
if ($flush_action == 'messages') {
    $Form->begin_fieldset(T_('Import log'));
    // Import the messages
    phpbb_import_messages();
    $Form->end_fieldset();
}
$Form->begin_fieldset(T_('Report of the mesagges import'));
$Form->info(T_('Count of the imported messages'), '<b>' . (int) phpbb_get_var('messages_count_imported') . '</b>');
$Form->info(T_('Count of the messages that are NOT imported because of missing users'), '<b class="red">' . (int) phpbb_get_var('messages_count_missing_users') . '</b>');
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $dispatcher, $flush_action;
phpbb_display_steps(4);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 4: Import forums'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'topics');
if ($flush_action == 'forums') {
    $Form->begin_fieldset(T_('Import log'));
    // Import the forums into the categories
    phpbb_import_forums();
    $Form->end_fieldset();
}
$Form->begin_fieldset(T_('Report of the forums import'));
$Form->info(T_('Count of the imported forums'), '<b>' . (int) phpbb_get_var('forums_count_imported') . '</b>');
$Form->info(T_('Count of the imported users'), (int) phpbb_get_var('users_count_imported'));
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $dispatcher, $flush_action;
phpbb_display_steps(3);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 3: Import users'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'forums');
if ($flush_action == 'users') {
    $Form->begin_fieldset(T_('Import log'));
    // Import the users
    phpbb_import_users();
    $Form->end_fieldset();
}
$Form->begin_fieldset(T_('Report of users import'));
$Form->info(T_('Count of the imported users'), '<b>' . (int) phpbb_get_var('users_count_imported') . '</b>');
$Form->info(T_('Count of the updated users'), '<b>' . (int) phpbb_get_var('users_count_updated') . '</b>');
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $phpbb_db_config, $phpbb_blog_ID, $dispatcher;
phpbb_display_steps(1);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 1: Database connection'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'database');
$Form->begin_fieldset(T_('Access information for database of phpBB forum'));
$Form->text('db_host', param('db_host', 'string', $phpbb_db_config['host']), 20, T_('Database host'));
$Form->text('db_name', param('db_name', 'string', $phpbb_db_config['name']), 20, T_('Database name'));
$Form->text('db_user', param('db_user', 'string', $phpbb_db_config['user']), 20, T_('Username'));
$Form->password('db_pass', param('db_pass', 'string', $phpbb_db_config['password']), 20, T_('Password'));
$Form->text('db_prefix', param('db_prefix', 'string', $phpbb_db_config['prefix']), 20, T_('Table prefix'));
$Form->text('path_avatars', param('path_avatars', 'string', phpbb_get_var('path_avatars')), 80, T_('Source for avatars'), '', 1000);
$Form->end_fieldset();
$Form->begin_fieldset(T_('Select a blog for import'));
 *
 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
 * See also {@link https://github.com/b2evolution/b2evolution}.
 *
 * @license GNU GPL v2 - {@link http://b2evolution.net/about/gnu-gpl-license}
 *
 * @copyright (c)2003-2015 by Francois Planque - {@link http://fplanque.com/}.
 * Parts of this file are copyright (c)2005 by Daniel HAHLER - {@link http://thequod.de/contact}.
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $phpbb_db_config, $dispatcher;
phpbb_display_steps(2);
$Form = new Form();
$Form->begin_form('fform', T_('phpBB Importer') . ' - ' . T_('Step 2: User group mapping'));
evo_flush();
$Form->add_crumb('phpbb');
$Form->hidden_ctrl();
$Form->hidden('action', 'users');
$Form->begin_fieldset(T_('Access information for database of phpBB forum'));
$Form->info(T_('Connection'), '<b class="green">OK</b>');
$Form->info(T_('Database host'), $phpbb_db_config['host']);
$Form->info(T_('Database name'), $phpbb_db_config['name']);
$Form->info(T_('Username'), $phpbb_db_config['user']);
$Form->info(T_('Password'), str_repeat('*', strlen($phpbb_db_config['password'])));
$Form->info(T_('Table prefix'), $phpbb_db_config['prefix']);
$path_avatars = phpbb_get_var('path_avatars');
$path_avatars_note = '';