IPB UPGRADE 1.x -> 2.0! | > Script written by Matt Mecham | > Date started: 21st April 2004 | > Interesting fact: Radiohead rock (Rain down, Rain down, come on rain down. On me. From a great height) +-------------------------------------------------------------------------- */ /** * Upgrade wrapper * * Set-up and load module to run * * @package InvisionPowerBoard * @author Matt Mecham * @version 2.1 */ /** * Script type * */ define( 'IPB_THIS_SCRIPT', 'upgrade' ); define( 'IPB_LOAD_SQL' , 'admin_queries' ); require_once( '../init.php' ); //----------------------------------------------- // USER CONFIGURABLE ELEMENTS //----------------------------------------------- define( 'THIS_PATH' , './' ); define( 'UPGRADE_DIR', 'upgrade' ); $INFO = array(); //-------------------------------- // Require our global functions //-------------------------------- require ROOT_PATH . "conf_global.php"; require ROOT_PATH . "sources/ipsclass.php"; require KERNEL_PATH . "class_converge.php"; require THIS_PATH . "core/functions.php"; require THIS_PATH . "core/template.php"; # Initiate super-class $ipsclass = new ipsclass(); $ipsclass->vars = $INFO; //-------------------------------- // The clocks a' tickin' //-------------------------------- $Debug = new Debug; $Debug->startTimer(); //-------------------------------- // Load the DB driver and such //-------------------------------- $ipsclass->init_db_connection(); //-------------------------------- // Set up our vars //-------------------------------- $ipsclass->parse_incoming(); //-------------------------------- // Set converge //-------------------------------- $ipsclass->converge = new class_converge( $ipsclass->DB ); //-------------------------------- // Initialize the FUNC //-------------------------------- $ipsclass->initiate_ipsclass(); //-------------------------------- // Set up our vars //-------------------------------- $ipsclass->core = new core_functions(); $ipsclass->core->ipsclass =& $ipsclass; $ipsclass->template = new template(); $ipsclass->template->ipsclass =& $ipsclass; $ipsclass->base_url = 'upgrade.php?'; $ipsclass->next_step = intval($ipsclass->input['step']) + 1; //-------------------------------- // OG //-------------------------------- $runme = new upgrade_legacy(); $runme->ipsclass =& $ipsclass; $runme->autorun(); /** * main core class * */ class upgrade_legacy { var $ipsclass; function autorun() { //-------------------------------- // GET QUERIES FILE (1.2 or 1.3)? // If we have subs table, it's 1.3 //-------------------------------- if ( ! $this->ipsclass->input['version'] ) { if ( $this->_check_for_two() ) { $this->ipsclass->input['version'] = '200'; print "You appear to be running IPB 2.0.0 already and no upgrade is required."; exit(); } else if ( $this->ipsclass->DB->field_exists( 'sub_id', 'subscriptions' ) ) { $this->ipsclass->input['version'] = '103'; } else if ( $this->ipsclass->DB->field_exists( 'perm_id', 'forum_perms' ) ) { $this->ipsclass->input['version'] = '102'; } else { $this->ipsclass->input['version'] = '101'; } } switch( $this->ipsclass->input['version'] ) { case '103': define( 'UPGRADE_FROM', '1.3' ); require_once( THIS_PATH.'pre_20000/10003_'.strtolower($this->ipsclass->vars['sql_driver']).'_queries.php' ); break; case '102': define( 'UPGRADE_FROM', '1.2' ); require_once( THIS_PATH.'pre_20000/10002_'.strtolower($this->ipsclass->vars['sql_driver']).'_queries.php' ); break; case '101': define( 'UPGRADE_FROM', '1.1' ); require_once( THIS_PATH.'pre_20000/10001_'.strtolower($this->ipsclass->vars['sql_driver']).'_queries.php' ); break; } $this->ipsclass->sql = new upgrade_sql(); $this->ipsclass->sql->ipsclass =& $this->ipsclass; //-------------------------------- // Quitting on this step? //-------------------------------- if ( $this->ipsclass->input['dieafterstep'] ) { if ( $this->ipsclass->input['step'] - 1 == $this->ipsclass->input['dieafterstep'] ) { $this->ipsclass->template->content .= "