Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: upgrade.php 4172 2008-09-03 00:30:14Z Tikitiki $
| * $Id: upgrade.php 4353 2009-04-19 00:25:42Z Tikitiki $
|
*/ error_reporting(E_ALL & ~E_NOTICE);
| */ error_reporting(E_ALL & ~E_NOTICE);
|
Zeile 14 | Zeile 14 |
---|
define("INSTALL_ROOT", dirname(__FILE__)."/"); define("TIME_NOW", time()); define('IN_MYBB', 1);
|
define("INSTALL_ROOT", dirname(__FILE__)."/"); define("TIME_NOW", time()); define('IN_MYBB', 1);
|
| define("IN_UPGRADE", 1);
|
require_once MYBB_ROOT."inc/class_core.php"; $mybb = new MyBB;
| require_once MYBB_ROOT."inc/class_core.php"; $mybb = new MyBB;
|
Zeile 174 | Zeile 175 |
---|
$user = $db->fetch_array($query); if(!$user['uid']) {
|
$user = $db->fetch_array($query); if(!$user['uid']) {
|
$output->print_error("The password you entered is incorrect. If you have forgotten your password, click <a href=\"../member.php?action=lostpw\">here</a>. Otherwise, go back and try again.");
| $output->print_error("The username you have entered appears to be invalid.");
|
} else { $user = validate_password_from_uid($user['uid'], $mybb->input['password'], $user);
|
} else { $user = validate_password_from_uid($user['uid'], $mybb->input['password'], $user);
|
| if(!$user['uid']) { $output->print_error("The password you entered is incorrect. If you have forgotten your password, click <a href=\"../member.php?action=lostpw\">here</a>. Otherwise, go back and try again."); }
|
} $db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");
| } $db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");
|
Zeile 315 | Zeile 320 |
---|
{ add_upgrade_store("startscript", $mybb->input['from']); $runfunction = next_function($mybb->input['from']);
|
{ add_upgrade_store("startscript", $mybb->input['from']); $runfunction = next_function($mybb->input['from']);
|
} }
| } }
|
$currentscript = get_upgrade_store("currentscript"); $system_upgrade_detail = get_upgrade_store("upgradedetail");
| $currentscript = get_upgrade_store("currentscript"); $system_upgrade_detail = get_upgrade_store("upgradedetail");
|
Zeile 331 | Zeile 336 |
---|
elseif($mybb->input['action'] == "buildcaches") { $runfunction = "buildcaches";
|
elseif($mybb->input['action'] == "buildcaches") { $runfunction = "buildcaches";
|
}
| }
|
elseif($mybb->input['action'] == "finished") { $runfunction = "upgradedone";
| elseif($mybb->input['action'] == "finished") { $runfunction = "upgradedone";
|
Zeile 345 | Zeile 350 |
---|
$runfunction = next_function($bits[0], $bits[1]);
}
|
$runfunction = next_function($bits[0], $bits[1]);
}
|
}
| }
|
// Fetch current script we're in if(function_exists($runfunction))
| // Fetch current script we're in if(function_exists($runfunction))
|
Zeile 360 | Zeile 365 |
---|
global $output, $db, $system_upgrade_detail, $lang, $mybb; $output->print_header($lang->upgrade_templates_reverted);
|
global $output, $db, $system_upgrade_detail, $lang, $mybb; $output->print_header($lang->upgrade_templates_reverted);
|
|
|
$charset = $db->build_create_table_collation();
if($system_upgrade_detail['revert_all_templates'] > 0)
| $charset = $db->build_create_table_collation();
if($system_upgrade_detail['revert_all_templates'] > 0)
|
Zeile 375 | Zeile 380 |
---|
status varchar(10) NOT NULL default '', dateline int(10) NOT NULL default '0', PRIMARY KEY (tid)
|
status varchar(10) NOT NULL default '', dateline int(10) NOT NULL default '0', PRIMARY KEY (tid)
|
) TYPE=MyISAM;{$charset}");
| ) TYPE=MyISAM{$charset};");
|
}
if($system_upgrade_detail['revert_all_themes'] > 0)
| }
if($system_upgrade_detail['revert_all_themes'] > 0)
|
Zeile 417 | Zeile 422 |
---|
{ $output->print_error("Please make sure your admin directory is uploaded correctly."); }
|
{ $output->print_error("Please make sure your admin directory is uploaded correctly."); }
|
import_theme_xml($contents, array("templateset" => -2, "no_templates" => 1));
| import_theme_xml($contents, array("templateset" => -2, "no_templates" => 1, "version_compat" => 1));
|
$tid = build_new_theme("Default", null, 1);
$db->update_query("themes", array("def" => 1), "tid='{$tid}'");
| $tid = build_new_theme("Default", null, 1);
$db->update_query("themes", array("def" => 1), "tid='{$tid}'");
|
Zeile 451 | Zeile 456 |
---|
} // Import master theme
|
} // Import master theme
|
import_theme_xml($contents, array("tid" => 1, "no_templates" => 1));
| import_theme_xml($contents, array("tid" => 1, "no_templates" => 1, "version_compat" => 1));
|
}
$sid = -2;
| }
$sid = -2;
|
Zeile 459 | Zeile 464 |
---|
// Now deal with the master templates $contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml'); $parser = new XMLParser($contents);
|
// Now deal with the master templates $contents = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml'); $parser = new XMLParser($contents);
|
$tree = $parser->get_tree();
| $tree = $parser->get_tree();
|
$theme = $tree['theme'];
if(is_array($theme['templates']))
| $theme = $tree['theme'];
if(is_array($theme['templates']))
|
Zeile 672 | Zeile 677 |
---|
}
function add_upgrade_store($title, $contents)
|
}
function add_upgrade_store($title, $contents)
|
{ global $db;
| { global $db;
|
$replace_array = array( "title" => $db->escape_string($title),
| $replace_array = array( "title" => $db->escape_string($title),
|
Zeile 696 | Zeile 701 |
---|
title varchar(220) NOT NULL default '', description text NOT NULL, disporder smallint unsigned NOT NULL default '0',
|
title varchar(220) NOT NULL default '', description text NOT NULL, disporder smallint unsigned NOT NULL default '0',
|
isdefault int(1) NOT NULL default '',
| isdefault int(1) NOT NULL default '0',
|
PRIMARY KEY (gid) ) TYPE=MyISAM;");
| PRIMARY KEY (gid) ) TYPE=MyISAM;");
|
Zeile 718 | Zeile 723 |
---|
else { if($db->type == "mysql" || $db->type == "mysqli")
|
else { if($db->type == "mysql" || $db->type == "mysqli")
|
{
| {
|
$wheresettings = "isdefault='1' OR isdefault='yes'"; } else
| $wheresettings = "isdefault='1' OR isdefault='yes'"; } else
|
Zeile 744 | Zeile 749 |
---|
$tree = $parser->get_tree(); $settinggroupnames = array(); $settingnames = array();
|
$tree = $parser->get_tree(); $settinggroupnames = array(); $settingnames = array();
|
|
|
foreach($tree['settings'][0]['settinggroup'] as $settinggroup) { $settinggroupnames[] = $settinggroup['attributes']['name'];
| foreach($tree['settings'][0]['settinggroup'] as $settinggroup) { $settinggroupnames[] = $settinggroup['attributes']['name'];
|
Zeile 804 | Zeile 809 |
---|
require MYBB_ROOT."inc/settings.php"; foreach($settings as $key => $val) {
|
require MYBB_ROOT."inc/settings.php"; foreach($settings as $key => $val) {
|
$db->update_query("settings", array('value' => $db->escape_string($val)), "name='$key'");
| $db->update_query("settings", array('value' => $db->escape_string($val)), "name='".$db->escape_string($key)."'");
|
} } unset($settings);
| } } unset($settings);
|