IPB UPGRADE MODULE:: IPB 2.0.0 PF1 -> PF 2 | > 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 = '20007'; var $upgrade_from = '20006'; 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() { global $ibforums, $std, $DB; $this->md5_check = $std->return_md5_check(); $this->base_url = "index.php?act=work&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}"; if ( is_array( $ibforums->modules_to_run ) and count( $ibforums->modules_to_run ) ) { $tmp = array_shift( $ibforums->modules_to_run ); $this->mod_to_run = implode( ', ', $ibforums->modules_to_run ); } if ( ! $this->mod_to_run ) { $this->mod_to_run = 'None'; } } /*-------------------------------------------------------------------------*/ // Auto run.. /*-------------------------------------------------------------------------*/ function auto_run() { global $ibforums, $std, $DB; //-------------------------------- // What are we doing? //-------------------------------- switch( $ibforums->input['workact'] ) { case 'sql': $this->upgrade_sql(); break; default: $this->upgrade_intro(); break; } } /*-------------------------------------------------------------------------*/ // SQL /*-------------------------------------------------------------------------*/ function upgrade_sql() { global $ibforums, $std, $DB; $cnt = 0; $sql = $this->_get_sql(); foreach( $sql as $q ) { $DB->query( $q ); $cnt++; } //-------------------------------- // Next page... //-------------------------------- $ibforums->core->redirect( "index.php?act=done&loginkey={$ibforums->input['loginkey']}&securekey={$ibforums->input['securekey']}&mid={$ibforums->input['mid']}", "$cnt queries run...." ); } /*-------------------------------------------------------------------------*/ // INTRO /*-------------------------------------------------------------------------*/ function upgrade_intro() { global $ibforums, $std, $DB; $ibforums->template->content .= "
Welcome to the IPB Upgrade System
This upgrade module will upgrade you from {$ibforums->versions[$this->upgrade_from]} to {$ibforums->versions[$this->this_version]}

This first step will {$this->first_step}

» Proceed...

Modules to run after this module: {$this->mod_to_run}
"; $ibforums->template->output(); } /*-------------------------------------------------------------------------*/ // SQL (ARRAY) /*-------------------------------------------------------------------------*/ function _get_sql() { global $ibforums, $DB, $std; $SQL = array(); $SQL[] = "INSERT INTO ibf_custom_bbcode (bbcode_title, bbcode_desc, bbcode_tag, bbcode_replace, bbcode_useoption, bbcode_example) VALUES ('CODEBOX', 'Use this BBCode tag to show a scrolling codebox. Useful for long sections of code.', 'codebox', '
CODE
{content}
', 0, '[codebox]long_code_here = '';[/codebox]');"; return $SQL; } } ?>