Vergleich install/upgrade.php - 1.2.0 - 1.2.1

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

 * $Id: upgrade.php 2191 2006-09-03 12:11:04Z chris $

 * $Id: upgrade.php 2282 2006-09-27 13:34:37Z chris $

 */
error_reporting(E_ALL & ~E_NOTICE);


 */
error_reporting(E_ALL & ~E_NOTICE);


Zeile 74Zeile 74

if(!$mybb->input['action'] || $mybb->input['action'] == "intro")
{


if(!$mybb->input['action'] || $mybb->input['action'] == "intro")
{

 
		if($db->table_exists(TABLE_PREFIX."datacache"))
{
require_once MYBB_ROOT."/inc/class_datacache.php";
$cache = new datacache;
$plugins = $cache->read('plugins', true);
if(!empty($plugins['active']))
{
$lang->upgrade_welcome = "<div class=\"error\"><strong><span style=\"color: red\">Warning:</span></strong> <p>There are still ".count($plugins['active'])." plugin(s) active. Active plugins can sometimes cause problems during an upgrade procedure.</p></div> <br />".$lang->upgrade_welcome;
}
}


		$output->print_header();

$db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."upgrade_data");

		$output->print_header();

$db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."upgrade_data");

Zeile 138Zeile 149
	elseif($mybb->input['action'] == "finished")
{
$runfunction = "upgradedone";

	elseif($mybb->input['action'] == "finished")
{
$runfunction = "upgradedone";

	}

	}

	else // Busy running modules, come back later
{
$bits = explode("_", $mybb->input['action'], 2);

	else // Busy running modules, come back later
{
$bits = explode("_", $mybb->input['action'], 2);

Zeile 160Zeile 171
function upgradethemes()
{
global $output, $db, $system_upgrade_detail, $lang;

function upgradethemes()
{
global $output, $db, $system_upgrade_detail, $lang;





	$output->print_header($lang->upgrade_templates_reverted);

if($system_upgrade_detail['revert_all_templates'] > 0)

	$output->print_header($lang->upgrade_templates_reverted);

if($system_upgrade_detail['revert_all_templates'] > 0)

Zeile 240Zeile 251
		}
}
update_theme(1, 0, $themebits, $css, 0);

		}
}
update_theme(1, 0, $themebits, $css, 0);

	$output->print_contents(sprintf($lang->upgrade_template_reverted_success, $synccount[1], $synccount[0]));

	$output->print_contents($lang->upgrade_templates_reverted_success);

	$output->print_footer("rebuildsettings");
}


	$output->print_footer("rebuildsettings");
}


Zeile 248Zeile 259
{
global $db, $output, $system_upgrade_detail, $lang;


{
global $db, $output, $system_upgrade_detail, $lang;


 
	if(!is_writable(MYBB_ROOT."/inc/settings.php"))
{
$output->print_header("Rebuilding Settings");
echo "<p><div class=\"error\"><span style=\"color: red; font-weight: bold;\">Error: Unable to open inc/settings.php</span><h3>Before the upgrade process can continue, you need to changes the permissions of inc/settings.php so it is writable.</h3></div></p>";
$output->print_footer("rebuildsettings");
exit;
}

	$synccount = sync_settings($system_upgrade_detail['revert_all_settings']);

$output->print_header($lang->upgrade_settings_sync);

	$synccount = sync_settings($system_upgrade_detail['revert_all_settings']);

$output->print_header($lang->upgrade_settings_sync);

Zeile 383Zeile 401
function sync_settings($redo=0)
{
global $db;

function sync_settings($redo=0)
{
global $db;

 
	

	$settingcount = $groupcount = 0;
if($redo == 2)
{

	$settingcount = $groupcount = 0;
if($redo == 2)
{

		$db->query("DROP TABLE ".TABLE_PREFIX."settinggroups");

		$db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."settinggroups");

		$db->query("CREATE TABLE ".TABLE_PREFIX."settinggroups (
gid smallint unsigned NOT NULL auto_increment,
name varchar(100) NOT NULL default '',

		$db->query("CREATE TABLE ".TABLE_PREFIX."settinggroups (
gid smallint unsigned NOT NULL auto_increment,
name varchar(100) NOT NULL default '',

Zeile 397Zeile 416
		  PRIMARY KEY  (gid)
) TYPE=MyISAM;");


		  PRIMARY KEY  (gid)
) TYPE=MyISAM;");


		$db->query("DROP TABLE ".TABLE_PREFIX."settings");

		$db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."settings");


$db->query("CREATE TABLE ".TABLE_PREFIX."settings (
sid smallint(6) NOT NULL auto_increment,


$db->query("CREATE TABLE ".TABLE_PREFIX."settings (
sid smallint(6) NOT NULL auto_increment,

Zeile 438Zeile 457
			"disporder" => intval($settinggroup['attributes']['disporder']),
"isdefault" => $settinggroup['attributes']['isdefault']
);

			"disporder" => intval($settinggroup['attributes']['disporder']),
"isdefault" => $settinggroup['attributes']['isdefault']
);

		if(!$settinggroups[$settinggroup['attributes']['key']] || $redo == 2)

		if(!$settinggroups[$settinggroup['attributes']['name']] || $redo == 2)

		{
$db->insert_query(TABLE_PREFIX."settinggroups", $groupdata);
$gid = $db->insert_id();

		{
$db->insert_query(TABLE_PREFIX."settinggroups", $groupdata);
$gid = $db->insert_id();

Zeile 447Zeile 466
		else
{
$gid = $settinggroups[$settinggroup['attributes']['name']];

		else
{
$gid = $settinggroups[$settinggroup['attributes']['name']];

			$db->insert_query(TABLE_PREFIX."settinggroups", $groupdata, "gid='{$gid}");

			$db->update_query(TABLE_PREFIX."settinggroups", $groupdata, "gid='{$gid}'");

		}
if(!$gid)
{

		}
if(!$gid)
{

Zeile 478Zeile 497
	}
if($redo >= 1)
{

	}
if($redo >= 1)
{

		require_once MYBB_ROOT."/inc/settings.php";

		require MYBB_ROOT."/inc/settings.php";

		foreach($settings as $key => $val)
{
$db->update_query(TABLE_PREFIX."settings", array('value' => $db->escape_string($val)), "name='$key'");

		foreach($settings as $key => $val)
{
$db->update_query(TABLE_PREFIX."settings", array('value' => $db->escape_string($val)), "name='$key'");

Zeile 489Zeile 508
	while($setting = $db->fetch_array($query))
{
$setting['value'] = str_replace("\"", "\\\"", $setting['value']);

	while($setting = $db->fetch_array($query))
{
$setting['value'] = str_replace("\"", "\\\"", $setting['value']);

		$settings .= "\$settings[".$setting['name']."] = \"".$setting['value']."\";\n";

		$settings .= "\$settings['{$setting['name']}'] = \"".$setting['value']."\";\n";

	}
$settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n$settings\n?>";
$file = fopen(MYBB_ROOT."/inc/settings.php", "w");

	}
$settings = "<?php\n/*********************************\ \n DO NOT EDIT THIS FILE, PLEASE USE\n THE SETTINGS EDITOR\n\*********************************/\n\n$settings\n?>";
$file = fopen(MYBB_ROOT."/inc/settings.php", "w");