}
$current_version_number = get_option('wpsc_version');
if (count(explode(".", $current_version_number)) > 2) {
    // in a previous version, I accidentally had the major version number have two dots, and three numbers
    // this code rectifies that mistake
    $current_version_number_array = explode(".", $current_version_number);
    array_pop($current_version_number_array);
    $current_version_number = (double) implode(".", $current_version_number_array);
} else {
    if (!is_numeric(get_option('wpsc_version'))) {
        $current_version_number = 0;
    }
}
//if there are any upgrades present, include them., thanks to nielo.info and lsdev.biz
if ($v1[0] >= 2.8) {
    $upgrades = get_upgrades();
    foreach ($upgrades as $path => $upgrade) {
        $upgrade_file = WPSC_UPGRADES_DIR . '/' . $path;
        require_once $upgrade_file;
    }
}
include_once WPSC_FILE_PATH . "/wpsc-includes/install_and_update.functions.php";
register_activation_hook(__FILE__, 'wpsc_install');
/**
* Code to define where the uploaded files are stored ends here
*/
if (!function_exists('wpsc_start_the_query')) {
    function wpsc_start_the_query()
    {
        global $wp_query, $wpsc_query;
        $wpsc_query = new WPSC_query();
    display_message(_LOGO_ERROR . "Impossible de se connecter à la base de données");
} else {
    display_message(_LOGO_GOOD . "Connexion à la base de données établie");
    mysql_select_db($_SESSION['install_iconito']['database']);
    //do_mysql_importdump($filename, $connexion);
    $version = 0;
    $sql = "SELECT * FROM kernel_version_bdd ORDER BY version DESC, date DESC LIMIT 1";
    $list = do_mysql_runquery_list($sql, $connexion);
    if ($list) {
        while ($r = do_mysql_move_next($list)) {
            //print_r($r);
            $version = $r['version'];
        }
    }
    display_message(_LOGO_INFO . "Version d&eacute;tect&eacute;e : <b>{$version}</b>");
    $upgrades = get_upgrades($version);
    if ($upgrades) {
        $upgradesInv = $upgrades;
        $last = array_pop($upgradesInv);
        $lastVersion = $last['numero'];
        display_message(_LOGO_INFO . "Version &agrave; installer : <b>{$lastVersion}</b>");
        if (isset($_GET['go']) && $_GET['go']) {
            echo '<hr />';
            //print_r($_SESSION);
            $stop = false;
            foreach ($upgrades as $upgrade) {
                //print_r($upgrade);
                if ($stop) {
                    continue;
                }
                $run = do_mysql_importdump('../../instal/upgrade_bdd/' . $upgrade['file'], $connexion);