Upgrade Script #5 | > Script written by Matt Mecham | > Date started: 10th June 2003 | +-------------------------------------------------------------------------- */ //----------------------------------------------- // USER CONFIGURABLE ELEMENTS //----------------------------------------------- // Root path $root_path = "./"; //----------------------------------------------- // NO USER EDITABLE SECTIONS BELOW //----------------------------------------------- error_reporting (E_ERROR | E_WARNING | E_PARSE); set_magic_quotes_runtime(0); $template = new template; $std = new installer; $VARS = $std->parse_incoming(); //-------------------------------- // Import $INFO, now! //-------------------------------- require $root_path."conf_global.php"; //-------------------------------- // Load the DB driver and such //-------------------------------- $INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver']; $to_require = $root_path."sources/Drivers/".$INFO['sql_driver'].".php"; require ($to_require); $DB = new db_driver; $DB->obj['sql_database'] = $INFO['sql_database']; $DB->obj['sql_user'] = $INFO['sql_user']; $DB->obj['sql_pass'] = $INFO['sql_pass']; $DB->obj['sql_host'] = $INFO['sql_host']; $DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix']; // Get a DB connection $DB->connect(); // Switch off auto_error $DB->return_die = 1; //--------------------------------------- // Sort out what to do.. //--------------------------------------- switch($VARS['a']) { case 'tables': do_tables(); break; case 'alter': do_alter(); break; case 'index': do_index(); break; case 'insert': do_insert(); break; case 'templates': do_templates(); break; case 'cleanup': do_cleanup(); break; case 'optimize': do_optimize(); break; default: do_intro(); break; } //+--------------------------------------- function do_optimize() { global $std, $template, $root, $DB; run_sql('optimize'); $template->print_top('Optimization Complete'); $template->contents .= "
![]() |
Welcome to the Invision Board Upgrade Utility Before you run this upgrade tool, please ensure that ALL of the source, language and skin files have been uploaded into the corresponding directories on your server. This script should be in the root forum directory (the same directory that index.php is in). This installer will alter the database for the new format and install the skin and macro files. Please ensure that 'install_templates.txt' is uploaded and in the same directory as this script. Also, please ensure that all the new skin_*.php files have been uploaded into 'Skin/s1' before starting this upgrader. If you wish to keep the old skin data in that directory, please copy the directory now before proceeding. Running this installer will set all existing skins to 'hidden' and install a new default skin pack "; $style_file = $root."install_templates.txt"; $warnings = array(); if ( ! file_exists($style_file) ) { $warnings[] = "Cannot locate the file 'install_templates.txt'. This should be uploaded into the same directory as this script!"; } if ( count($warnings) > 0 ) { $err_string = "
Warning!
The following errors must be rectified before continuing!
";
}
else
{
$template->contents .= "$err_string "; } $template->output(); } function install_error($msg="") { global $std, $template, $root; $template->print_top('Warning!'); $template->contents .= " | ||
| WARNING! | |||
$help"); exit; } //+-------------------------------------------------------------------------- // CLASSES //+-------------------------------------------------------------------------- class template { var $contents = ""; function output() { echo $this->contents; echo " |