// BACK UP YOUR DATABASE
##################################################################################################################
# CHANGE NOTHING BELOW THIS LINE # CHANGE NOTHING BELOW THIS LINE # CHANGE NOTHIING BELOW THIS LINE # CHANGE NOTHI
##################################################################################################################
include_once './../db_mysql.php';
include_once './../ImpExFunction.php';
include_once './../ImpExDatabaseCore.php';
// BACK UP YOUR DATABASE
extract(parse_ini_file('./../ImpExConfig.php'), EXTR_SKIP);
$Db_target = new DB_Sql_vb_impex();
$Db_target->appname = 'vBulletin:ImpEx Target';
$Db_target->appshortname = 'vBulletin:ImpEx Target';
$Db_target->type = 'mysql';
$Db_target->database = $targetdatabase;
$Db_target->connect($targetserver, $targetuser, $targetpassword, 0);
$Db_target->select_db($targetdatabase);
$Imp_database = new ImpExDatabaseCore();
$thread_ids_array = $Imp_database->get_threads_ids($Db_target, $Db_target->type, $target_table_prefix);
// BACK UP YOUR DATABASE
# Posts
if ($do_posts) {
    $posts = $Db_target->query("SELECT postid, pagetext FROM " . $targettableprefix . "post");
    while ($post = $Db_target->fetch_array($posts)) {
        if (strrpos($post['pagetext'], $old_domain . $old_forum_path)) {
            $text = $post['pagetext'];
            // Threads id replacment
            #viewtopic.php\?topic OR viewtopic.php\?t
            $text = preg_replace("#(.*){$old_domain}{$old_forum_path}viewtopic.php\\?topic=([0-9]+)\\&forum=[0-9]+(.*)#isUe", "phpBB_thread_id_swapper(\$file_extenstion, \$new_domain, \$new_forum_path, '\\1', '\\2', \$thread_ids_array)", $post['pagetext']);
            $Db_target->query("UPDATE " . $targettableprefix . "post SET pagetext='" . addslashes($text) . "' WHERE postid='" . $post['postid'] . "'");
            echo "<br /><b>Post done -></b><i> " . $post['postid'] . "</i>";
        }
Exemple #2
0
        $impexconfig['target']['charset'] = trim($config['Mysqli']['charset']);
    }
} else {
    $using_local_config = '<p>' . $impex_phrases['using_impex_config'] . '</p>';
}
// #############################################################################
// Database connect
// #############################################################################
$Db_target = new DB_Sql_vb_impex();
$Db_source = new DB_Sql_vb_impex();
$Db_target->appname = 'vBulletin:ImpEx Target';
$Db_target->appshortname = 'vBulletin:ImpEx Target';
$Db_target->database = $impexconfig['target']['database'];
$Db_target->type = $impexconfig['target']['databasetype'];
$Db_target->connect($impexconfig['target']['server'], $impexconfig['target']['user'], $impexconfig['target']['password'], $impexconfig['target']['persistent'], $impexconfig['target']['charset']);
$Db_target->select_db($impexconfig['target']['database']);
// #############################################################################
// Session start
// #############################################################################
$ImpEx = new ImpExController();
$session_state = $ImpEx->return_session($Db_target, $impexconfig['target']['tableprefix']);
if ($session_state) {
    $ImpExSession = $session_state;
} else {
    $ImpExSession = new ImpExSession();
}
// #############################################################################
// Requires ImpExDatabase version (has to be done here as it needs the session)
// #############################################################################
require_once IDIR . '/ImpExDatabaseCore.php';
#ImpExDatabase_<product>_version.php