<?php
/*========================================================*\
||########################################################||
||# #||
||# WB News v1.4.2 #||
||# ---------------------------------------------------- #||
||# Copyright (c) 2004-2006 #||
||# Created: 8th Feb 2007 #||
||# Filename: upgrade_1.4.2.php #||
||# #||
||########################################################||
/*========================================================*/
/**
* @author $Author: pmcilwaine $
* @version $Id: upgrade_1.4.2.php,v 1.1 2007/05/11 13:29:06 pmcilwaine Exp $
*/
/**
* Do Database Changes
*/
$dbChanges = array();
/**
* Upgrade config.php to newest version
*/
$configUpdate = file("../config.php");
$configUpdate[29] = " \$config['version'] = '" . $newVersion . "'; //version\n";
$configUpdate = implode("", $configUpdate);
$fp = fopen("../config.php", "w");
$bytes = fwrite($fp, $configUpdate);
fclose($fp);
$configOK = ($bytes === false) ? "No" : "Yes";
?>
<html>
<head>
<title>WB News Upgrade <?php echo $newVersion; ?></title>
</head>
<body>
<img src="./imgs/wbnews.png" alt="WB News" title="WB News"/><br clear="all"/>
<strong>Database Changes:</strong>
<?php
if ( count($dbChanges) != 0 )
{
include $config['installdir']."/includes/lib/db_mysql.php";
$dbclass = new DB($config['dbhost'], base64_decode($config['dbname']), base64_decode($config['dbuser']), base64_decode($config['dbpass']));
$dbclass->db_connect();
$i = 0;
foreach ( $dbChanges as $query )
{
$dbclass->db_query( $query );
$i++;
}
echo ( $i == count($dbChanges) ) ? "All $i database changes made" : "Not all database changes were made, please report errors given.";
}
else
echo "No DB Changes";
?>
<p />
<strong>Config.php Updated:</strong> <?php echo $configOK;?><p/>
<p>Make sure you have uploaded all files. If you have any errors please report them, if you have
no errors you have successfully upgraded to <?php echo $newVersion; ?>.</p>
</body>
</html>