Location: PHPKode > projects > Exero CMS > upload/install/upgrade1.php
<?
/*========================================*\
| Exero CMS                                |
|==========================================|
|          http://ecms.getox.net           |
|https://sourceforge.net/projects/exerocms/|
|==========================================|
|     Exero CMS is released under the      |
|     GNU General Public License (GPL)     |
| opensource.org/licenses/gpl-license.php  |
\*========================================*/
// Include required files
require("core.php");
require("resource/upgradecore.php");

$upgradeinfo['appver'] = "1.0.1";
$upgradeinfo['steps'] = "2";

if(empty($_POST['step'])) {
	print_header('',$upgradeinfo['appver']);
	print_form_header($_SERVER['PHP_SELF'],"POST");
	print_form_hiddenfield("step","1");

	print_table_header("Welcome","2");
	print_table_row("This script will upgrade your Exero CMS installation to version ".$upgradeinfo['appver'].", Please backup your database then click Next.");
	print_table_footer();

	print_stepinfo("0","Next","",1);

	print_form_footer();
	print_footer();
} else if($_POST['step'] == "1") {
	print_header('',$upgradeinfo['appver']);
	print_form_header($_SERVER['PHP_SELF'],"POST");
	print_form_hiddenfield("step","2");
	
	$query[] = "ALTER TABLE `blocks` ADD `status` VARCHAR( 255 ) NOT NULL ;";
	$query[] = "ALTER TABLE `modules` ADD `blockshidden` VARCHAR( 255 ) NOT NULL ;";
	$query[] = "ALTER TABLE `modules` ADD `blocksviewable` VARCHAR( 255 ) NOT NULL ;";
	
	foreach($query as $query) {
		$db->query($query);
	}
	
	
	print_table_header("Step 1 Complete","2");
	print_table_row("Database changes made, You can Continue to Step 2 now.");
	print_table_footer();
	
	print_stepinfo("1","Next Step","Step 1 / $upgradeinfo[steps]<br />$stepinfo[6]");
	
	print_form_footer();
	print_footer();
} else if($_POST['step'] == "2") {
	print_header('',$upgradeinfo['appver']);
	
	$query[] = "UPDATE blocks SET STATUS = '1' ;";
	$query[] = "INSERT INTO `admin_items` VALUES (3, 'Image', 'image');";
	$query[] = "UPDATE `settings` SET `value` = '1.0.1' WHERE `settings`.`setting` = 'appver' AND `settings`.`value` = '1.0.0' LIMIT 1 ;";
	
	foreach($query as $query) {
		$db->query($query);
	}
		
	if(file_exists("upgrade2.php")) {
		print_table_header("Step 2 Complete","2");
		print_table_row("New table data inserted and changes made.<br /><strong>Click Continue to complete the Upgrade.</strong>");
		print_table_footer();
		
		print_form_header("upgrade2.php","POST");
		print_stepinfo("1","Next Step","Step 2 / $upgradeinfo[steps]<br />$stepinfo[7]");
		print_form_footer();
	} else {
		print_table_header("Step 2 Complete","2");
		print_table_row("Data updated / New Data inserted.<br />You may now close this page.");
		print_table_footer();
		
		print_stepinfo("2","","Step 2 / $upgradeinfo[steps]<br />$stepinfo[7]",0);
	}
	
	print_footer();
}
?>
Return current item: Exero CMS