Vergleich install/resources/upgrade17.php - 1.6.4 - 1.6.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://www.mybb.com
* License: http://mybb.com/about/license
*

 * $Id: upgrade17.php 5404 2011-03-19 01:17:10Z jammerx2 $

 * $Id$

 */

/**

 */

/**

Zeile 31Zeile 31
	echo "<p>Performing necessary upgrade queries..</p>";
echo "<p>Adding index to private messages table ... ";
flush();

	echo "<p>Performing necessary upgrade queries..</p>";
echo "<p>Adding index to private messages table ... ";
flush();

	



	if($db->type == "mysql" || $db->type == "mysqli")
{
$db->write_query("ALTER TABLE ".TABLE_PREFIX."privatemessages ADD INDEX ( `toid` )");
}

	if($db->type == "mysql" || $db->type == "mysqli")
{
$db->write_query("ALTER TABLE ".TABLE_PREFIX."privatemessages ADD INDEX ( `toid` )");
}

	



	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	



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

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

Zeile 53Zeile 53

echo "<p>Performing necessary upgrade queries..</p>";
flush();


echo "<p>Performing necessary upgrade queries..</p>";
flush();

	



	// Update our version history first
$version_history = array();
$dh = opendir(INSTALL_ROOT."resources");

	// Update our version history first
$version_history = array();
$dh = opendir(INSTALL_ROOT."resources");

Zeile 65Zeile 65
		}
}
sort($version_history, SORT_NUMERIC);

		}
}
sort($version_history, SORT_NUMERIC);

	



	// This script isn't done yet!
unset($version_history['17']);

	// This script isn't done yet!
unset($version_history['17']);

	



	$cache->update("version_history", $version_history);

	$cache->update("version_history", $version_history);

	



	if($db->field_exists('prefix', 'threads'))
{
$db->drop_column("threads", "prefix");

	if($db->field_exists('prefix', 'threads'))
{
$db->drop_column("threads", "prefix");

	}


	}


	if($db->field_exists('loginattempts', "adminoptions"))

	if($db->field_exists('loginattempts', "adminoptions"))

	{

	{

		$db->drop_column("adminoptions", "loginattempts");

		$db->drop_column("adminoptions", "loginattempts");

	}


	}


	if($db->field_exists('loginlockoutexpiry', "adminoptions"))
{
$db->drop_column("adminoptions", "loginlockoutexpiry");
}

	if($db->field_exists('loginlockoutexpiry', "adminoptions"))
{
$db->drop_column("adminoptions", "loginlockoutexpiry");
}

	



	if($db->field_exists('canonlyviewownthreads', "forumpermissions"))
{
$db->drop_column("forumpermissions", "canonlyviewownthreads");
}

	if($db->field_exists('canonlyviewownthreads', "forumpermissions"))
{
$db->drop_column("forumpermissions", "canonlyviewownthreads");
}

	



	if($db->field_exists('isgroup', 'moderators'))
{
$db->drop_column("moderators", "isgroup");
}

	if($db->field_exists('isgroup', 'moderators'))
{
$db->drop_column("moderators", "isgroup");
}

	



	if($db->field_exists('referrals', 'promotions'))

	if($db->field_exists('referrals', 'promotions'))

	{

	{

		$db->drop_column("promotions", "referrals");

		$db->drop_column("promotions", "referrals");

	}


	}


	if($db->field_exists('referralstype', 'promotions'))
{
$db->drop_column("promotions", "referralstype");
}

	if($db->field_exists('referralstype', 'promotions'))
{
$db->drop_column("promotions", "referralstype");
}

	



	if($db->field_exists('pid', 'reputation'))
{
$db->drop_column("reputation", "pid");
}

	if($db->field_exists('pid', 'reputation'))
{
$db->drop_column("reputation", "pid");
}

	



	if($db->field_exists('allowvideocode', 'calendars'))

	if($db->field_exists('allowvideocode', 'calendars'))

	{

	{

		$db->drop_column("calendars", "allowvideocode");

		$db->drop_column("calendars", "allowvideocode");

	}


	}


	if($db->field_exists('allowvideocode', 'forums'))
{
$db->drop_column("forums", "allowvideocode");
}

	if($db->field_exists('allowvideocode', 'forums'))
{
$db->drop_column("forums", "allowvideocode");
}

	



	switch($db->type)
{
case "pgsql":

	switch($db->type)
{
case "pgsql":

Zeile 159Zeile 159
			$db->add_column("calendars", "allowvideocode", "int(1) NOT NULL default '0' AFTER allowimgcode");
$db->add_column("forums", "allowvideocode", "int(1) NOT NULL default '0' AFTER allowimgcode");
}

			$db->add_column("calendars", "allowvideocode", "int(1) NOT NULL default '0' AFTER allowimgcode");
$db->add_column("forums", "allowvideocode", "int(1) NOT NULL default '0' AFTER allowimgcode");
}

	



	$db->update_query("forums", array('allowvideocode' => '1'));
$db->update_query("calendars", array('allowvideocode' => '1'));

	$db->update_query("forums", array('allowvideocode' => '1'));
$db->update_query("calendars", array('allowvideocode' => '1'));

	



	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	



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

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

Zeile 175Zeile 175
{
global $db, $output, $mybb;


{
global $db, $output, $mybb;


	$output->print_header("Performing Queries");


	$output->print_header("Performing Queries");


	echo "<p>Performing necessary upgrade queries..</p>";
flush();

	echo "<p>Performing necessary upgrade queries..</p>";
flush();

	



	if($db->field_exists('canundovotes', 'usergroups'))

	if($db->field_exists('canundovotes', 'usergroups'))

	{

	{

		$db->drop_column("usergroups", "canundovotes");
}

		$db->drop_column("usergroups", "canundovotes");
}

	



	if($db->field_exists('maxreputationsperuser', 'usergroups'))
{
$db->drop_column("usergroups", "maxreputationsperuser");

	if($db->field_exists('maxreputationsperuser', 'usergroups'))
{
$db->drop_column("usergroups", "maxreputationsperuser");

	}


	}


	if($db->field_exists('maxreputationsperthread', 'usergroups'))

	if($db->field_exists('maxreputationsperthread', 'usergroups'))

	{

	{

		$db->drop_column("usergroups", "maxreputationsperthread");
}

		$db->drop_column("usergroups", "maxreputationsperthread");
}

	



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

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

	{

	{

		$db->drop_column("users", "receivefrombuddy");
}

		$db->drop_column("users", "receivefrombuddy");
}

	



	if($db->field_exists('suspendsignature', 'users'))
{
$db->drop_column("users", "suspendsignature");

	if($db->field_exists('suspendsignature', 'users'))
{
$db->drop_column("users", "suspendsignature");

	}


	}


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

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

	{

	{

		$db->drop_column("users", "suspendsigtime");
}

		$db->drop_column("users", "suspendsigtime");
}

	



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

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

	{

	{

		$db->drop_column("users", "loginattempts");
}

		$db->drop_column("users", "loginattempts");
}

	



	if($db->field_exists('failedlogin', 'users'))
{
$db->drop_column("users", "failedlogin");

	if($db->field_exists('failedlogin', 'users'))
{
$db->drop_column("users", "failedlogin");

	}


	}


	if($db->field_exists('usernotes', "users"))

	if($db->field_exists('usernotes', "users"))

	{

	{

		$db->drop_column("users", "usernotes");
}

		$db->drop_column("users", "usernotes");
}

	



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

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

	{

	{

		$db->drop_column("users", "referrals");
}

		$db->drop_column("users", "referrals");
}

	



	switch($db->type)
{
case "pgsql":

	switch($db->type)
{
case "pgsql":

			$db->add_column("usergroups", "canundovotes", "int NOT NULL default '0' AFTER canvotepolls");

			$db->add_column("usergroups", "canundovotes", "int NOT NULL default '0' AFTER canvotepolls");

			$db->add_column("usergroups", "maxreputationsperuser", "bigint NOT NULL default '0' AFTER maxreputationsday");
$db->add_column("usergroups", "maxreputationsperthread", "bigint NOT NULL default '0' AFTER maxreputationsperuser");
$db->add_column("users", "receivefrombuddy", "int NOT NULL default '0'");

			$db->add_column("usergroups", "maxreputationsperuser", "bigint NOT NULL default '0' AFTER maxreputationsday");
$db->add_column("usergroups", "maxreputationsperthread", "bigint NOT NULL default '0' AFTER maxreputationsperuser");
$db->add_column("users", "receivefrombuddy", "int NOT NULL default '0'");

Zeile 267Zeile 267
			$db->add_column("users", "failedlogin", "bigint(30) NOT NULL default '0'");
$db->add_column("users", "usernotes", "text NOT NULL");
$db->add_column("users", "referrals", "int unsigned NOT NULL default '0' AFTER referrer");

			$db->add_column("users", "failedlogin", "bigint(30) NOT NULL default '0'");
$db->add_column("users", "usernotes", "text NOT NULL");
$db->add_column("users", "referrals", "int unsigned NOT NULL default '0' AFTER referrer");

	}

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


	}

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


	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	



	$output->print_footer("17_dbchanges4");
}


	$output->print_footer("17_dbchanges4");
}


Zeile 283Zeile 283
	global $db, $output, $mybb;

$output->print_header("Performing Queries");

	global $db, $output, $mybb;

$output->print_header("Performing Queries");





	echo "<p>Performing necessary upgrade queries..</p>";
flush();

	echo "<p>Performing necessary upgrade queries..</p>";
flush();

	



	if($db->field_exists('remember', 'users'))
{
$db->drop_column("users", "remember");

	if($db->field_exists('remember', 'users'))
{
$db->drop_column("users", "remember");

	}

	}


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


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

Zeile 310Zeile 310
				$db->rename_column("moderators", "uid", "id", "int unsigned NOT NULL default '0'");
}
}

				$db->rename_column("moderators", "uid", "id", "int unsigned NOT NULL default '0'");
}
}

	



	if($db->table_exists("threadprefixes"))
{
$db->drop_table("threadprefixes");
}

	if($db->table_exists("threadprefixes"))
{
$db->drop_table("threadprefixes");
}

	



	if($db->table_exists("delayedmoderation"))
{
$db->drop_table("delayedmoderation");
}

	if($db->table_exists("delayedmoderation"))
{
$db->drop_table("delayedmoderation");
}

	



	switch($db->type)
{
case "sqlite":

	switch($db->type)
{
case "sqlite":

Zeile 384Zeile 384
				PRIMARY KEY (did)
) ENGINE=MyISAM;");
}

				PRIMARY KEY (did)
) ENGINE=MyISAM;");
}

	



	$added_tasks = sync_tasks();

	$added_tasks = sync_tasks();

	



	echo "<p>Added {$added_tasks} new tasks.</p>";

	echo "<p>Added {$added_tasks} new tasks.</p>";

	



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

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

	



	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	



	$output->print_footer("17_dbchanges5");
}

	$output->print_footer("17_dbchanges5");
}





function upgrade17_dbchanges5()
{
global $db, $output, $mybb, $cache;

function upgrade17_dbchanges5()
{
global $db, $output, $mybb, $cache;

	



	if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"))
{
require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";

	if(file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php"))
{
require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";

Zeile 413Zeile 413
	else
{
$output->print_error("Please make sure your admin directory is uploaded correctly.");

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

	}

$output->print_header("Performing Queries");

	}

$output->print_header("Performing Queries");


echo "<p>Performing necessary upgrade queries..</p>";
flush();


echo "<p>Performing necessary upgrade queries..</p>";
flush();

	



	$db->update_query("spiders", array('name' => 'Bing'), "name='MSN Search'");
$db->update_query("spiders", array('useragent' => 'Googlebot', 'name' => 'Google'), "useragent='google'");
$db->update_query("spiders", array('useragent' => 'Teoma', 'name' => 'Ask.com'), "useragent='ask jeeves'");

	$db->update_query("spiders", array('name' => 'Bing'), "name='MSN Search'");
$db->update_query("spiders", array('useragent' => 'Googlebot', 'name' => 'Google'), "useragent='google'");
$db->update_query("spiders", array('useragent' => 'Teoma', 'name' => 'Ask.com'), "useragent='ask jeeves'");

Zeile 428Zeile 428
	$db->update_query("spiders", array('name' => 'Alexa Internet'), "useragent='ia_archiver'");
$db->delete_query("spiders", "useragent='scooter'");
$db->update_query("spiders", array('useragent' => 'Slurp'), "name='Yahoo!'");

	$db->update_query("spiders", array('name' => 'Alexa Internet'), "useragent='ia_archiver'");
$db->delete_query("spiders", "useragent='scooter'");
$db->update_query("spiders", array('useragent' => 'Slurp'), "name='Yahoo!'");

	



	$query = $db->simple_select("spiders", "COUNT(*) as numexists", "useragent='twiceler'");
if($db->fetch_field($query, "numexists") == 0)
{

	$query = $db->simple_select("spiders", "COUNT(*) as numexists", "useragent='twiceler'");
if($db->fetch_field($query, "numexists") == 0)
{

Zeile 440Zeile 440
	{
$db->insert_query("spiders", array('name' => "Baidu", 'useragent' => 'Baiduspider'));
}

	{
$db->insert_query("spiders", array('name' => "Baidu", 'useragent' => 'Baiduspider'));
}

	



	$db->update_query("attachtypes", array('mimetype' => 'application/x-httpd-php'), "extension='php'");
$db->update_query("attachtypes", array('mimetype' => 'text/html'), "extension='htm'");
$db->update_query("attachtypes", array('mimetype' => 'text/html'), "extension='html'");

	$db->update_query("attachtypes", array('mimetype' => 'application/x-httpd-php'), "extension='php'");
$db->update_query("attachtypes", array('mimetype' => 'text/html'), "extension='htm'");
$db->update_query("attachtypes", array('mimetype' => 'text/html'), "extension='html'");

Zeile 449Zeile 449
	$db->update_query("attachtypes", array('mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), "extension='xlsx'");
$db->update_query("attachtypes", array('mimetype' => 'application/vnd.ms-powerpoint'), "extension='ppt'");
$db->update_query("attachtypes", array('mimetype' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation'), "extension='pptx'");

	$db->update_query("attachtypes", array('mimetype' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'), "extension='xlsx'");
$db->update_query("attachtypes", array('mimetype' => 'application/vnd.ms-powerpoint'), "extension='ppt'");
$db->update_query("attachtypes", array('mimetype' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation'), "extension='pptx'");

	



	$cache->update_moderators();

	$cache->update_moderators();

	



	$db->update_query("themes", array('allowedgroups' => 'all'), "allowedgroups='' OR allowedgroups IS NULL");

	$db->update_query("themes", array('allowedgroups' => 'all'), "allowedgroups='' OR allowedgroups IS NULL");

	



	// Add permissions for all of our new ACP pages
change_admin_permission('config', 'thread_prefixes');
change_admin_permission('tools', 'file_verification');
change_admin_permission('tools', 'statistics');

	// Add permissions for all of our new ACP pages
change_admin_permission('config', 'thread_prefixes');
change_admin_permission('tools', 'file_verification');
change_admin_permission('tools', 'statistics');

	



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

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

	



	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";

	



	$output->print_footer("17_dbchanges6");
}

	$output->print_footer("17_dbchanges6");
}





function upgrade17_dbchanges6()
{
global $db, $output;

function upgrade17_dbchanges6()
{
global $db, $output;

	



	$output->print_header("Post IP Repair Conversion");

if(!$_POST['ipspage'])

	$output->print_header("Post IP Repair Conversion");

if(!$_POST['ipspage'])

Zeile 497Zeile 497
	}

$query = $db->simple_select("posts", "COUNT(pid) AS ipcount");

	}

$query = $db->simple_select("posts", "COUNT(pid) AS ipcount");

	$cnt = $db->fetch_array($query);

if($upper > $cnt['ipcount'])
{

	$cnt = $db->fetch_array($query);

if($upper > $cnt['ipcount'])
{

		$upper = $cnt['ipcount'];
}

echo "<p>Repairing ip {$lower} to {$upper} ({$cnt['ipcount']} Total)</p>";
flush();

		$upper = $cnt['ipcount'];
}

echo "<p>Repairing ip {$lower} to {$upper} ({$cnt['ipcount']} Total)</p>";
flush();

	



	$ipaddress = false;

	$ipaddress = false;

	



	$query = $db->simple_select("posts", "ipaddress, pid", "", array('limit_start' => $lower, 'limit' => $ipp));
while($post = $db->fetch_array($query))
{
$db->update_query("posts", array('longipaddress' => intval(my_ip2long($post['ipaddress']))), "pid = '{$post['pid']}'");

	$query = $db->simple_select("posts", "ipaddress, pid", "", array('limit_start' => $lower, 'limit' => $ipp));
while($post = $db->fetch_array($query))
{
$db->update_query("posts", array('longipaddress' => intval(my_ip2long($post['ipaddress']))), "pid = '{$post['pid']}'");

		$ipaddress = true;
}

$remaining = $upper-$cnt['ipcount'];

		$ipaddress = true;
}

$remaining = $upper-$cnt['ipcount'];

	if($remaining && $ipaddress)

	if($remaining && $ipaddress)

	{

	{

		$nextact = "17_dbchanges6";
$startat = $startat+$ipp;
$contents = "<p><input type=\"hidden\" name=\"ipspage\" value=\"$ipp\" /><input type=\"hidden\" name=\"ipstart\" value=\"$startat\" />Done. Click Next to move on to the next set of post ips.</p>";

		$nextact = "17_dbchanges6";
$startat = $startat+$ipp;
$contents = "<p><input type=\"hidden\" name=\"ipspage\" value=\"$ipp\" /><input type=\"hidden\" name=\"ipstart\" value=\"$startat\" />Done. Click Next to move on to the next set of post ips.</p>";

Zeile 527Zeile 527
	{
$nextact = "17_dbchanges7";
$contents = "<p>Done</p><p>All post ips have been succesfully repaired. Click next to continue.</p>";

	{
$nextact = "17_dbchanges7";
$contents = "<p>Done</p><p>All post ips have been succesfully repaired. Click next to continue.</p>";

	}
$output->print_contents($contents);


	}
$output->print_contents($contents);


	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";


	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";


Zeile 539Zeile 539
function upgrade17_dbchanges7()
{
global $db, $output;

function upgrade17_dbchanges7()
{
global $db, $output;

	



	$output->print_header("User IP Repair Conversion");

if(!$_POST['ipspage'])

	$output->print_header("User IP Repair Conversion");

if(!$_POST['ipspage'])

	{

	{

		$ipp = 5000;

		$ipp = 5000;

	}

	}

	else

	else

	{

	{

		$ipp = $_POST['ipspage'];
}


		$ipp = $_POST['ipspage'];
}


Zeile 556Zeile 556
		$startat = $_POST['ipstart'];
$upper = $startat+$ipp;
$lower = $startat;

		$startat = $_POST['ipstart'];
$upper = $startat+$ipp;
$lower = $startat;

	}

	}

	else

	else

	{

	{

		$startat = 0;
$upper = $ipp;
$lower = 1;
}

		$startat = 0;
$upper = $ipp;
$lower = 1;
}





	$query = $db->simple_select("users", "COUNT(uid) AS ipcount");
$cnt = $db->fetch_array($query);

	$query = $db->simple_select("users", "COUNT(uid) AS ipcount");
$cnt = $db->fetch_array($query);

	



	if($upper > $cnt['ipcount'])
{
$upper = $cnt['ipcount'];

	if($upper > $cnt['ipcount'])
{
$upper = $cnt['ipcount'];

	}

	}


$contents .= "<p>Repairing ip {$lower} to {$upper} ({$cnt['ipcount']} Total)</p>";


$contents .= "<p>Repairing ip {$lower} to {$upper} ({$cnt['ipcount']} Total)</p>";

	



	$ipaddress = false;
$update_array = array();

	$ipaddress = false;
$update_array = array();

	



	$query = $db->simple_select("users", "regip, lastip, uid", "", array('limit_start' => $lower, 'limit' => $ipp));
while($user = $db->fetch_array($query))
{

	$query = $db->simple_select("users", "regip, lastip, uid", "", array('limit_start' => $lower, 'limit' => $ipp));
while($user = $db->fetch_array($query))
{

Zeile 584Zeile 584
			'longregip' => intval(my_ip2long($user['regip'])),
'longlastip' => intval(my_ip2long($user['lastip']))
);

			'longregip' => intval(my_ip2long($user['regip'])),
'longlastip' => intval(my_ip2long($user['lastip']))
);

		



		$db->update_query("users", $update_array, "uid = '{$user['uid']}'");

		$db->update_query("users", $update_array, "uid = '{$user['uid']}'");

		



		$update_array = array();
$ipaddress = true;
}

		$update_array = array();
$ipaddress = true;
}

Zeile 608Zeile 608
	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";


	global $footer_extra;
$footer_extra = "<script type=\"text/javascript\">window.onload = function() { var button = $$('.submit_button'); if(button[0]) { button[0].value = 'Automatically Redirecting...'; button[0].disabled = true; button[0].style.color = '#aaa'; button[0].style.borderColor = '#aaa'; document.forms[0].submit(); }}</script>";


	$output->print_footer($nextact);	

	$output->print_footer($nextact);

}

}





function upgrade17_redoconfig()
{
global $db, $output, $orig_config, $mybb;

function upgrade17_redoconfig()
{
global $db, $output, $orig_config, $mybb;

	



	$config = $orig_config;

	$config = $orig_config;

	



	$output->print_header("Rewriting config.php");

	$output->print_header("Rewriting config.php");





	if(!is_array($config['memcache']))
{
// Backup our old Config file
@copy(MYBB_ROOT."inc/config.php", MYBB_ROOT."inc/config.backup.php");

	if(!is_array($config['memcache']))
{
// Backup our old Config file
@copy(MYBB_ROOT."inc/config.php", MYBB_ROOT."inc/config.backup.php");

		



		$fh = @fopen(MYBB_ROOT."inc/config.php", "w");
if(!$fh)
{

		$fh = @fopen(MYBB_ROOT."inc/config.php", "w");
if(!$fh)
{

Zeile 636Zeile 636
		{
$config['memcache_host'] = "localhost";
}

		{
$config['memcache_host'] = "localhost";
}

		



		if(!$config['memcache_port'])
{
$config['memcache_port'] = 11211;
}

		if(!$config['memcache_port'])
{
$config['memcache_port'] = 11211;
}

		



		$comment = "";

		$comment = "";

		



		if(!$db->db_encoding || !$config['database']['encoding'])

		if(!$db->db_encoding || !$config['database']['encoding'])

		{

		{

			$comment = " // ";
}

			$comment = " // ";
}

		



		if(!$config['database']['encoding'])
{
$config['database']['encoding'] = "utf8";

		if(!$config['database']['encoding'])
{
$config['database']['encoding'] = "utf8";

		}


		}


		// Update SQLite selection. SQLite 2 is depreciated.
if($config['database']['type'] == 'sqlite2' || $config['database']['type'] == 'sqlite3')
{
$config['database']['type'] = 'sqlite';
}

		// Update SQLite selection. SQLite 2 is depreciated.
if($config['database']['type'] == 'sqlite2' || $config['database']['type'] == 'sqlite3')
{
$config['database']['type'] = 'sqlite';
}

		



		// Do we have a read or a write database?
if($config['database']['read'])
{

		// Do we have a read or a write database?
if($config['database']['read'])
{

Zeile 706Zeile 706
\$config['database']['password'] = '{$config['database']['password']}';
";
}

\$config['database']['password'] = '{$config['database']['password']}';
";
}

		





		$configdata = "<?php
/**
* Database configuration
*

		$configdata = "<?php
/**
* Database configuration
*

 * Please see the MyBB Wiki for advanced

 * Please see the MyBB Docs for advanced

 * database configuration for larger installations

 * database configuration for larger installations

 * http://wiki.mybb.com/

 * http://docs.mybb.com/

 */

{$database_config}

 */

{$database_config}

Zeile 775Zeile 775

/**
* Database Encoding


/**
* Database Encoding

 *  If you wish to set an encoding for MyBB uncomment 

 *  If you wish to set an encoding for MyBB uncomment

 *  the line below (if it isn't already) and change
* the current value to the mysql charset:
* http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html

 *  the line below (if it isn't already) and change
* the current value to the mysql charset:
* http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html

Zeile 816Zeile 816
function upgrade17_updatecss()
{
global $db, $output, $orig_config, $mybb;

function upgrade17_updatecss()
{
global $db, $output, $orig_config, $mybb;

	



	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";

	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";

Zeile 828Zeile 828
	else
{
$output->print_error("Please make sure your admin directory is uploaded correctly.");

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

	}


	}


	$output->print_header("Updating CSS");

	$output->print_header("Updating CSS");

	



	$query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'");
while($theme = $db->fetch_array($query))
{
resync_stylesheet($theme);
}

	$query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'");
while($theme = $db->fetch_array($query))
{
resync_stylesheet($theme);
}

	



	$query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'");
while($theme = $db->fetch_array($query))
{
$theme['stylesheet'] = upgrade_css_140_to_160($theme['name'], $theme['stylesheet']);

	$query = $db->simple_select("themestylesheets", "*", "name='global.css' OR name='usercp.css'");
while($theme = $db->fetch_array($query))
{
$theme['stylesheet'] = upgrade_css_140_to_160($theme['name'], $theme['stylesheet']);

		



		// Create stylesheets
cache_stylesheet($theme['tid'], $theme['cachefile'], $theme['stylesheet']);

		// Create stylesheets
cache_stylesheet($theme['tid'], $theme['cachefile'], $theme['stylesheet']);





		$update_stylesheet = array(
"stylesheet" => $db->escape_string($theme['stylesheet']),
"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $update_stylesheet, "sid='{$theme['sid']}'");
}

		$update_stylesheet = array(
"stylesheet" => $db->escape_string($theme['stylesheet']),
"lastmodified" => TIME_NOW
);
$db->update_query("themestylesheets", $update_stylesheet, "sid='{$theme['sid']}'");
}

	



	echo "<p>The CSS has been successfully updated.</p>";
echo "<p>Click next to continue with the upgrade process.</p>";


	echo "<p>The CSS has been successfully updated.</p>";
echo "<p>Click next to continue with the upgrade process.</p>";


Zeile 866Zeile 866
{
// Update our CSS to the new stuff in 1.6
$parsed_css = css_to_array($css);

{
// Update our CSS to the new stuff in 1.6
$parsed_css = css_to_array($css);

	



	if($name == "global.css")
{
if(is_array($parsed_css))

	if($name == "global.css")
{
if(is_array($parsed_css))

		{

		{

			foreach($parsed_css as $class_id => $array)

			foreach($parsed_css as $class_id => $array)

			{		

			{

				switch($array['class_name'])
{
case '.navigation .active':

				switch($array['class_name'])
{
case '.navigation .active':

Zeile 889Zeile 889
						$parsed_css[$class_id]['values'] .= "\n\tcolor: #000;";
break;
default:

						$parsed_css[$class_id]['values'] .= "\n\tcolor: #000;";
break;
default:

				}		

				}

			}
}

			}
}

		



		$to_add = array(
md5('#panel .remember_me input') => array("class_name" => '#panel .remember_me input', "values" => "vertical-align: middle;\n\tmargin-top: -1px;"),
md5('.hiddenrow') => array("class_name" => '.hiddenrow', "values" => 'display: none;'),

		$to_add = array(
md5('#panel .remember_me input') => array("class_name" => '#panel .remember_me input', "values" => "vertical-align: middle;\n\tmargin-top: -1px;"),
md5('.hiddenrow') => array("class_name" => '.hiddenrow', "values" => 'display: none;'),

Zeile 911Zeile 911
			md5('.usercp_notepad') => array("class_name" => '.usercp_notepad', "values" => "width: 99%;"),
md5('.usercp_container') => array("class_name" => '.usercp_container', "values" => "margin: 5px;\n\tpadding: 8px;\n\tborder:1px solid #CCCCCC;"),
);

			md5('.usercp_notepad') => array("class_name" => '.usercp_notepad', "values" => "width: 99%;"),
md5('.usercp_container') => array("class_name" => '.usercp_container', "values" => "margin: 5px;\n\tpadding: 8px;\n\tborder:1px solid #CCCCCC;"),
);

	}


	}


	foreach($to_add as $class_id => $array)
{
if($already_parsed[$class_id])
{
$already_parsed[$class_id]++;
$class_id .= "_".$already_parsed[$class_id];

	foreach($to_add as $class_id => $array)
{
if($already_parsed[$class_id])
{
$already_parsed[$class_id]++;
$class_id .= "_".$already_parsed[$class_id];

		}

		}

		else
{
$already_parsed[$class_id] = 1;
}

		else
{
$already_parsed[$class_id] = 1;
}

		



		$array['name'] = "";
$array['description'] = "";

		$array['name'] = "";
$array['description'] = "";

		



		$parsed_css[$class_id] = $array;
}

		$parsed_css[$class_id] = $array;
}

	



	$css = "";
foreach($parsed_css as $class_id => $array)
{

	$css = "";
foreach($parsed_css as $class_id => $array)
{

Zeile 940Zeile 940
			if($array['name'])
{
$array['css'] .= "Name: {$array['name']}";

			if($array['name'])
{
$array['css'] .= "Name: {$array['name']}";

				



				if($array['description'])
{
$array['css'] .= "\n";
}
}

				if($array['description'])
{
$array['css'] .= "\n";
}
}

			



			if($array['description'])
{
$array['css'] .= "Description: {$array['description']}";
}

			if($array['description'])
{
$array['css'] .= "Description: {$array['description']}";
}

			



			$array['css'] .= " */\n";
}

			$array['css'] .= " */\n";
}

		



		$css .= "{$array['class_name']} {\n\t{$array['values']}\n}\n";
}

		$css .= "{$array['class_name']} {\n\t{$array['values']}\n}\n";
}

	



	return $css;
}
?>

	return $css;
}
?>