Vergleich install/resources/upgrade30.php - 1.8.0 - 1.8.36

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 9Zeile 9
 */

/**

 */

/**

 * Upgrade Script: 1.6.14 or 1.6.15

 * Upgrade Script: 1.6.14, 1.6.15, 1.6.16, 1.6.17 or 1.6.18

 */

$upgrade_detail = array(

 */

$upgrade_detail = array(

Zeile 330Zeile 330
	$db->update_query('profilefields', array('viewableby' => '-1', 'editableby' => '-1'));

global $footer_extra;

	$db->update_query('profilefields', array('viewableby' => '-1', 'editableby' => '-1'));

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges2");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges2");

Zeile 480Zeile 480
	$db->update_query('forums', array('usethreadcounts' => 1), 'usepostcounts = 1');

global $footer_extra;

	$db->update_query('forums', array('usethreadcounts' => 1), 'usepostcounts = 1');

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges3");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges3");

Zeile 616Zeile 616
	}

global $footer_extra;

	}

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges4");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges4");

Zeile 747Zeile 747
	$db->update_query("maillogs", $update_array, "tid > '0'");

global $footer_extra;

	$db->update_query("maillogs", $update_array, "tid > '0'");

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges5");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges5");

Zeile 861Zeile 861
	}

global $footer_extra;

	}

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges6");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges6");

Zeile 1116Zeile 1116
		$groups[] = "'{$group['gid']}'";
}


		$groups[] = "'{$group['gid']}'";
}


	$usergroups = implode(',', $groups);
$db->update_query('usergroups', array('canbereported' => 1), "gid IN ({$usergroups})");




	if(!empty($groups))
{
$usergroups = implode(',', $groups);
$db->update_query('usergroups', array('canbereported' => 1), "gid IN ({$usergroups})");
}


$db->update_query('usergroups', array('canviewboardclosed' => 1), 'cancp = 1');



$db->update_query('usergroups', array('canviewboardclosed' => 1), 'cancp = 1');


Zeile 1246Zeile 1249
	}
else
{

	}
else
{

		$threads = $_POST['theadspage'];

		$threads = (int)$_POST['theadspage'];

	}

if($_POST['threadstart'])
{

	}

if($_POST['threadstart'])
{

		$startat = $_POST['threadstart'];

		$startat = (int)$_POST['threadstart'];

		$upper = $startat+$threads;
$lower = $startat;
}

		$upper = $startat+$threads;
$lower = $startat;
}

Zeile 1301Zeile 1304
	$output->print_contents($contents);

global $footer_extra;

	$output->print_contents($contents);

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_footer($nextact);
}


$output->print_footer($nextact);
}

Zeile 1386Zeile 1389
			$db->modify_column("warninglevels", "percentage", "smallint(3) NOT NULL default '0'");
$db->modify_column("warningtypes", "points", "smallint unsigned NOT NULL default '0'");
$db->modify_column("warnings", "points", "smallint unsigned NOT NULL default '0'");

			$db->modify_column("warninglevels", "percentage", "smallint(3) NOT NULL default '0'");
$db->modify_column("warningtypes", "points", "smallint unsigned NOT NULL default '0'");
$db->modify_column("warnings", "points", "smallint unsigned NOT NULL default '0'");

			break;
}

			break;
}


if($db->type != "pgsql")
{


if($db->type != "pgsql")
{

Zeile 1405Zeile 1408
	}

global $footer_extra;

	}

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges_optimize2");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges_optimize2");

Zeile 1504Zeile 1507
	}

global $footer_extra;

	}

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges_optimize3");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges_optimize3");

Zeile 1579Zeile 1582
	}

global $footer_extra;

	}

global $footer_extra;

	$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

	$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges_optimize4");


$output->print_contents("<p>Click next to continue with the upgrade process.</p>");
$output->print_footer("30_dbchanges_optimize4");

Zeile 1628Zeile 1631
		"threads" => array("dateline", "lastpost"),
"threadsread" => array("dateline"),
"threadsubscriptions" => array("dateline"),

		"threads" => array("dateline", "lastpost"),
"threadsread" => array("dateline"),
"threadsubscriptions" => array("dateline"),

		"threadsread" => array("dateline"),

 
		"usergroups" => array("reputationpower", "maxreputationsday", "maxreputationsperuser", "maxreputationsperthread", "attachquota"),
"users" => array("regdate", "lastactive", "lastvisit", "lastpost", "timeonline", "moderationtime", "suspensiontime", "suspendsigtime"),
"warningtypes" => array("expirationtime"),

		"usergroups" => array("reputationpower", "maxreputationsday", "maxreputationsperuser", "maxreputationsperthread", "attachquota"),
"users" => array("regdate", "lastactive", "lastvisit", "lastpost", "timeonline", "moderationtime", "suspensiontime", "suspendsigtime"),
"warningtypes" => array("expirationtime"),

Zeile 1790Zeile 1792
				elseif($db->type == "pgsql")
{
$db->write_query("ALTER TABLE ".TABLE_PREFIX."posts ADD INDEX (`ipaddress`)");

				elseif($db->type == "pgsql")
{
$db->write_query("ALTER TABLE ".TABLE_PREFIX."posts ADD INDEX (`ipaddress`)");

				}

				}

			}
$next_task = 7;
break;

			}
$next_task = 7;
break;

Zeile 1801Zeile 1803
			}
else
{

			}
else
{

				$ipp = $_POST['ipspage'];

				$ipp = (int)$_POST['ipspage'];

			}

if($_POST['ipstart'])
{

			}

if($_POST['ipstart'])
{

				$startat = $_POST['ipstart'];

				$startat = (int)$_POST['ipstart'];

				$upper = $startat+$ipp-1;
$lower = $startat;
}

				$upper = $startat+$ipp-1;
$lower = $startat;
}

Zeile 1911Zeile 1913
						$ip2 = my_inet_pton($db->unescape_binary($data['lastip']));
if($ip1 === false && $ip2 === false)
{

						$ip2 = my_inet_pton($db->unescape_binary($data['lastip']));
if($ip1 === false && $ip2 === false)
{

							continue;

							continue 2;

						}
break;
case 5:
$ip = my_inet_pton($db->unescape_binary($data['ip']));
if($ip === false)
{

						}
break;
case 5:
$ip = my_inet_pton($db->unescape_binary($data['ip']));
if($ip === false)
{

							continue;

							continue 2;

						}
break;
case 6:

						}
break;
case 6:

Zeile 1929Zeile 1931
						$ip = my_inet_pton($db->unescape_binary($data['ipaddress']));
if($ip === false)
{

						$ip = my_inet_pton($db->unescape_binary($data['ipaddress']));
if($ip === false)
{

							continue;

							continue 2;

						}
break;
}

						}
break;
}

Zeile 2061Zeile 2063
			// Truncate invalid IPs
$db->write_query("UPDATE ".TABLE_PREFIX."{$table} SET {$column} = SUBSTR({$column}, 16) WHERE LENGTH({$column})>16");
switch($db->type)

			// Truncate invalid IPs
$db->write_query("UPDATE ".TABLE_PREFIX."{$table} SET {$column} = SUBSTR({$column}, 16) WHERE LENGTH({$column})>16");
switch($db->type)

			{

			{

				case "pgsql":
// Drop default value before converting the column
$db->modify_column($table, $column, false, false);
$db->modify_column($table, $column, "bytea USING {$column}::bytea", 'set', "''");

				case "pgsql":
// Drop default value before converting the column
$db->modify_column($table, $column, false, false);
$db->modify_column($table, $column, "bytea USING {$column}::bytea", 'set', "''");

					break;

					break;

				case "sqlite":
$db->modify_column($table, $column, "blob(16) NOT NULL default ''");
break;

				case "sqlite":
$db->modify_column($table, $column, "blob(16) NOT NULL default ''");
break;

Zeile 2077Zeile 2079
			if($mybb->input['iptable'] < 10)
{
$iptable = "<input type=\"hidden\" name=\"iptable\" value=\"".($mybb->input['iptable']+1)."\" />";

			if($mybb->input['iptable'] < 10)
{
$iptable = "<input type=\"hidden\" name=\"iptable\" value=\"".($mybb->input['iptable']+1)."\" />";

			}
break;

			}
break;

		case 3:
echo "<p>Updating user table (2/4)...</p>";

		case 3:
echo "<p>Updating user table (2/4)...</p>";

			flush();

			flush();


if($db->field_exists('longlastip', 'users'))
{


if($db->field_exists('longlastip', 'users'))
{

Zeile 2095Zeile 2097
			flush();

if($db->field_exists('longregip', 'users'))

			flush();

if($db->field_exists('longregip', 'users'))

			{

			{

				// This may take a while
$db->drop_column("users", "longregip");
}

				// This may take a while
$db->drop_column("users", "longregip");
}

Zeile 2124Zeile 2126
		$contents = "<p><input type=\"hidden\" name=\"iptask\" value=\"{$next_task}\" />{$iptable}{$ipstart}Done. Click Next to continue the IP conversion.</p>";

global $footer_extra;

		$contents = "<p><input type=\"hidden\" name=\"iptask\" value=\"{$next_task}\" />{$iptable}{$ipstart}Done. Click Next to continue the IP conversion.</p>";

global $footer_extra;

		$footer_extra = "<script type=\"text/javascript\">$(document).ready(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

		$footer_extra = "<script type=\"text/javascript\">$(function() { var button = $('.submit_button'); if(button) { button.val('Automatically Redirecting...'); button.prop('disabled', true); button.css('color', '#aaa'); button.css('border-color', '#aaa'); document.forms[0].submit(); } });</script>";

		$nextact = "30_dbchanges_ip";

		$nextact = "30_dbchanges_ip";

	}

$output->print_contents($contents);


	}

$output->print_contents($contents);


	$output->print_footer($nextact);
}

	$output->print_footer($nextact);
}





function upgrade30_updatetheme()
{
global $db, $mybb, $output, $config;

if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))

function upgrade30_updatetheme()
{
global $db, $mybb, $output, $config;

if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php"))

	{

	{

		require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";

		require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions_themes.php";

	}

	}

	else if(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
{
require_once MYBB_ROOT."admin/inc/functions_themes.php";
}
else

	else if(file_exists(MYBB_ROOT."admin/inc/functions_themes.php"))
{
require_once MYBB_ROOT."admin/inc/functions_themes.php";
}
else

	{

	{

		$output->print_error("Please make sure your admin directory is uploaded correctly.");
}


		$output->print_error("Please make sure your admin directory is uploaded correctly.");
}


Zeile 2166Zeile 2168
	$stylesheets = my_unserialize($theme['stylesheets']);

$old = array("global.css", "usercp.css", "modcp.css", "star_ratings.css");

	$stylesheets = my_unserialize($theme['stylesheets']);

$old = array("global.css", "usercp.css", "modcp.css", "star_ratings.css");

	require_once MYBB_ROOT."inc/class_xml.php";

 
	$colors = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml');

	$colors = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme.xml');

	$parser = new XMLParser($colors);

	$parser = create_xml_parser($colors);

	$tree = $parser->get_tree();

if(is_array($tree) && is_array($tree['theme']))

	$tree = $parser->get_tree();

if(is_array($tree) && is_array($tree['theme']))

Zeile 2197Zeile 2198
					$sid = $db->insert_query("themestylesheets", $new_stylesheet);
$css_url = "css.php?stylesheet={$sid}";


					$sid = $db->insert_query("themestylesheets", $new_stylesheet);
$css_url = "css.php?stylesheet={$sid}";


					$cached = cache_stylesheet($tid, $stylesheet['attributes']['name'], $stylesheet['value']);

					$cached = cache_stylesheet(1, $stylesheet['attributes']['name'], $stylesheet['value']);


if($cached)
{


if($cached)
{

Zeile 2234Zeile 2235
	}

$update_array = array(

	}

$update_array = array(

		"properties" => $db->escape_string(serialize($properties)),
"stylesheets" => $db->escape_string(serialize($stylesheets))

		"properties" => $db->escape_string(my_serialize($properties)),
"stylesheets" => $db->escape_string(my_serialize($stylesheets))

	);

$db->update_query("themes", $update_array, "tid = '1'");

	);

$db->update_query("themes", $update_array, "tid = '1'");

Zeile 2291Zeile 2292
			}
}


			}
}


		$db->update_query("themes", array("properties" => $db->escape_string(serialize($properties))), "tid='{$theme['tid']}'");

		$db->update_query("themes", array("properties" => $db->escape_string(my_serialize($properties))), "tid='{$theme['tid']}'");

	}

$contents .= "done.</p>";

	}

$contents .= "done.</p>";

Zeile 2316Zeile 2317
			$properties['logo'] = "images/logo.png";
}


			$properties['logo'] = "images/logo.png";
}


		require_once MYBB_ROOT."inc/class_xml.php";

 
		$colors = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme_colors.xml');

		$colors = @file_get_contents(INSTALL_ROOT.'resources/mybb_theme_colors.xml');

		$parser = new XMLParser($colors);

		$parser = create_xml_parser($colors);

		$tree = $parser->get_tree();

if(is_array($tree) && is_array($tree['colors']))

		$tree = $parser->get_tree();

if(is_array($tree) && is_array($tree['colors']))

Zeile 2366Zeile 2366
			}

$update_array = array(

			}

$update_array = array(

				"properties" => $db->escape_string(serialize($properties)),
"stylesheets" => $db->escape_string(serialize($stylesheets))

				"properties" => $db->escape_string(my_serialize($properties)),
"stylesheets" => $db->escape_string(my_serialize($stylesheets))

			);

$db->update_query("themes", $update_array, "tid = '2'");

			);

$db->update_query("themes", $update_array, "tid = '2'");