IPB UPGRADE MODULE:: IPB 2.0.0 PF4 -> FINAL
| > Script written by Matt Mecham
| > Date started: 23rd April 2004
| > "So what, pop is dead - it's no great loss.
So many facelifts, it's face flew off"
+--------------------------------------------------------------------------
*/
if ( ! defined( 'IN_IPB' ) )
{
print "
Incorrect access
You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
exit();
}
class version_upgrade
{
var $this_version = '20012';
var $upgrade_from = '20011';
var $first_step = 'update your database to include the new schematic modifications.';
var $md5_check = '';
var $base_url = '';
var $mod_to_run = '';
/*-------------------------------------------------------------------------*/
// CONSTRUCTOR
/*-------------------------------------------------------------------------*/
function version_upgrade()
{
}
function version_process()
{
$this->md5_check = $this->ipsclass->return_md5_check();
$this->base_url = "index.php?act=work&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}";
if ( is_array( $this->ipsclass->modules_to_run ) and count( $this->ipsclass->modules_to_run ) )
{
$tmp = array_shift( $this->ipsclass->modules_to_run );
$this->mod_to_run = implode( ', ', $this->ipsclass->modules_to_run );
}
if ( ! $this->mod_to_run )
{
$this->mod_to_run = 'None';
}
}
/*-------------------------------------------------------------------------*/
// Auto run..
/*-------------------------------------------------------------------------*/
function auto_run()
{
//--------------------------------
// What are we doing?
//--------------------------------
switch( $this->ipsclass->input['workact'] )
{
case 'sql':
$this->upgrade_sql();
break;
default:
$this->upgrade_intro();
break;
}
}
/*-------------------------------------------------------------------------*/
// SQL
/*-------------------------------------------------------------------------*/
function upgrade_sql()
{
$cnt = 0;
$SQL = array();
if ( file_exists( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/'.strtolower($this->ipsclass->vars['sql_driver']).'_updates.php' ) )
{
require_once( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/'.strtolower($this->ipsclass->vars['sql_driver']).'_updates.php' );
foreach( $SQL as $q )
{
$this->ipsclass->DB->query( $q );
$cnt++;
}
}
//--------------------------------
// Upgrade templates
//--------------------------------
if ( file_exists( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/components.php' ) )
{
require_once( THIS_PATH.'upg_'.$this->ipsclass->current_upgrade.'/components.php' );
$this->ipsclass->DB->do_update( 'skin_sets', array( 'set_css' => $CSS,
'set_cache_css' => $CSS,
'set_wrapper' => $WRAPPER,
'set_cache_wrapper' => $WRAPPER,
), 'set_skin_set_id=1' );
}
$cnt++;
//--------------------------------
// Next page...
//--------------------------------
$this->ipsclass->core->redirect( "index.php?act=done&loginkey={$this->ipsclass->input['loginkey']}&securekey={$this->ipsclass->input['securekey']}&mid={$this->ipsclass->input['mid']}", "$cnt queries run...." );
}
/*-------------------------------------------------------------------------*/
// INTRO
/*-------------------------------------------------------------------------*/
function upgrade_intro()
{
$this->ipsclass->template->content .= "
Welcome to the IPB Upgrade System
This upgrade module will upgrade you from
{$this->ipsclass->versions[$this->upgrade_from]} to
{$this->ipsclass->versions[$this->this_version]}
This first step will {$this->first_step}
Modules to run after this module: {$this->mod_to_run}
";
$this->ipsclass->template->output();
}
}
?>