Zeile 25 | Zeile 25 |
---|
// We need to globalize $db here because when this script is called // during load_module $db is not globalized in the function global $db;
|
// We need to globalize $db here because when this script is called // during load_module $db is not globalized in the function global $db;
|
$collation = $db->build_create_table_collation();
| |
// FIRST STEP IS FOR INTEGER CONVERSION PROJECT
|
// FIRST STEP IS FOR INTEGER CONVERSION PROJECT
|
|
|
function upgrade12_dbchanges() { global $db, $output, $mybb;
|
function upgrade12_dbchanges() { global $db, $output, $mybb;
|
|
|
$output->print_header("Integer Conversion Project");
$perpage = 10000;
| $output->print_header("Integer Conversion Project");
$perpage = 10000;
|
Zeile 76 | Zeile 74 |
---|
$current_table = array_keys($to_int); $current_table = $current_table[0]; echo "<p>MyBB 1.4 represents a huge leap forward for the MyBB project.</p><p>Due to this, lots of information in the database needs to be converted to a new format.</p>";
|
$current_table = array_keys($to_int); $current_table = $current_table[0]; echo "<p>MyBB 1.4 represents a huge leap forward for the MyBB project.</p><p>Due to this, lots of information in the database needs to be converted to a new format.</p>";
|
}
| }
|
echo "<p>MyBB is now currently converting a section of data to the new format, this may take a while.</p>";
| echo "<p>MyBB is now currently converting a section of data to the new format, this may take a while.</p>";
|
Zeile 222 | Zeile 220 |
---|
}
function upgrade12_dbchanges_post1()
|
}
function upgrade12_dbchanges_post1()
|
{ 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>"; echo "<p>Adding index to posts table ... "; flush(); // This will take a LONG time on huge post databases, so we only run it isolted from most of the other queries
|
echo "<p>Performing necessary upgrade queries..</p>"; echo "<p>Adding index to posts table ... "; flush(); // This will take a LONG time on huge post databases, so we only run it isolted from most of the other queries
|
$db->write_query("ALTER TABLE ".TABLE_PREFIX."posts ADD INDEX ( `visible` )"); echo "done.</p>"; flush(); $contents = "<p>Click next to continue with the upgrade process.</p>"; $output->print_contents($contents);
| $db->write_query("ALTER TABLE ".TABLE_PREFIX."posts ADD INDEX ( `visible` )"); echo "done.</p>"; flush(); $contents = "<p>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>";
$output->print_footer("12_dbchanges_post2"); }
|
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("12_dbchanges_post2"); }
|
|
|
function upgrade12_dbchanges_post2() { global $db, $output, $mybb;
|
function upgrade12_dbchanges_post2() { global $db, $output, $mybb;
|
|
|
$output->print_header("Performing Queries");
|
$output->print_header("Performing Queries");
|
|
|
echo "<p>Performing necessary upgrade queries..</p>"; if($db->field_exists('longipaddress', "posts")) { echo "<p>Dropping longipaddress column in posts table ... ";
|
echo "<p>Performing necessary upgrade queries..</p>"; if($db->field_exists('longipaddress', "posts")) { echo "<p>Dropping longipaddress column in posts table ... ";
|
flush();
| flush();
|
$db->write_query("ALTER TABLE ".TABLE_PREFIX."posts DROP longipaddress;");
| $db->write_query("ALTER TABLE ".TABLE_PREFIX."posts DROP longipaddress;");
|
Zeile 269 | Zeile 267 |
---|
flush(); $db->write_query("ALTER TABLE ".TABLE_PREFIX."posts ADD longipaddress int(10) NOT NULL default '0' AFTER ipaddress");
|
flush(); $db->write_query("ALTER TABLE ".TABLE_PREFIX."posts ADD longipaddress int(10) NOT NULL default '0' AFTER ipaddress");
|
echo "done.</p>"; flush(); $contents = "<p>Click next to continue with the upgrade process.</p>"; $output->print_contents($contents);
global $footer_extra;
| echo "done.</p>"; flush(); $contents = "<p>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>";
|
$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("12_dbchanges_user"); }
function upgrade12_dbchanges_user()
|
$output->print_footer("12_dbchanges_user"); }
function upgrade12_dbchanges_user()
|
{
| {
|
global $db, $output, $mybb;
$output->print_header("Performing Queries");
| global $db, $output, $mybb;
$output->print_header("Performing Queries");
|
Zeile 294 | Zeile 292 |
---|
// This will take a LONG time on huge user databases, so we only run it isolted from most of the other queries $db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD INDEX ( `lastvisit` )");
|
// This will take a LONG time on huge user databases, so we only run it isolted from most of the other queries $db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD INDEX ( `lastvisit` )");
|
$db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD INDEX ( `regdate` )");
| $db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD INDEX ( `regdate` )");
|
echo "done.</p>"; flush(); $contents = "<p>Click next to continue with the upgrade process.</p>"; $output->print_contents($contents);
|
echo "done.</p>"; flush(); $contents = "<p>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>";
|
Zeile 326 | Zeile 324 |
---|
if($db->field_exists('deletetime', "privatemessages")) { $db->write_query("ALTER TABLE ".TABLE_PREFIX."privatemessages DROP deletetime;");
|
if($db->field_exists('deletetime', "privatemessages")) { $db->write_query("ALTER TABLE ".TABLE_PREFIX."privatemessages DROP deletetime;");
|
}
| }
|
$db->write_query("ALTER TABLE ".TABLE_PREFIX."privatemessages ADD deletetime bigint(30) NOT NULL default '0' AFTER dateline"); if($db->field_exists('maxpmrecipients', "usergroups"))
| $db->write_query("ALTER TABLE ".TABLE_PREFIX."privatemessages ADD deletetime bigint(30) NOT NULL default '0' AFTER dateline"); if($db->field_exists('maxpmrecipients', "usergroups"))
|
Zeile 426 | Zeile 424 |
---|
$db->drop_table("promotions"); $db->drop_table("promotionlogs"); $db->drop_table("massemails");
|
$db->drop_table("promotions"); $db->drop_table("promotionlogs"); $db->drop_table("massemails");
|
| $collation = $db->build_create_table_collation();
|
$db->write_query("CREATE TABLE ".TABLE_PREFIX."massemails ( mid int unsigned NOT NULL auto_increment,
| $db->write_query("CREATE TABLE ".TABLE_PREFIX."massemails ( mid int unsigned NOT NULL auto_increment,
|
Zeile 615 | Zeile 615 |
---|
if($db->field_exists('emailnotify', "users")) {
|
if($db->field_exists('emailnotify', "users")) {
|
$db->update_query("users", array('emailnotify' => 1), "emailnotify='no' OR emailnotify='0'");
| $db->update_query("users", array('emailnotify' => 0), "emailnotify='no' OR emailnotify='0'");
|
$db->update_query("users", array('emailnotify' => 2), "emailnotify='yes' OR emailnotify='1'"); $db->update_query("users", array('emailnotify' => 0), "emailnotify != 1 AND emailnotify != 2"); $db->write_query("ALTER TABLE ".TABLE_PREFIX."users CHANGE emailnotify subscriptionmethod int(1) NOT NULL default '0'");
| $db->update_query("users", array('emailnotify' => 2), "emailnotify='yes' OR emailnotify='1'"); $db->update_query("users", array('emailnotify' => 0), "emailnotify != 1 AND emailnotify != 2"); $db->write_query("ALTER TABLE ".TABLE_PREFIX."users CHANGE emailnotify subscriptionmethod int(1) NOT NULL default '0'");
|
Zeile 1795 | Zeile 1795 |
---|
else { @fclose($cachewritable);
|
else { @fclose($cachewritable);
|
@my_chmod(MYBB_ROOT.'cache', 0777); @my_chmod(MYBB_ROOT.'cache/test.write', 0777);
| @my_chmod(MYBB_ROOT.'cache', '0777'); @my_chmod(MYBB_ROOT.'cache/test.write', '0777');
|
@unlink(MYBB_ROOT.'cache/test.write'); }
| @unlink(MYBB_ROOT.'cache/test.write'); }
|
Zeile 1826 | Zeile 1826 |
---|
else { @fclose($themewritable);
|
else { @fclose($themewritable);
|
@my_chmod(MYBB_ROOT.'cache/themes', 0777); @my_chmod(MYBB_ROOT.'cache/themes/test.write', 0777);
| @my_chmod(MYBB_ROOT.'cache/themes', '0777'); @my_chmod(MYBB_ROOT.'cache/themes/test.write', '0777');
|
@unlink(MYBB_ROOT.'cache/themes/test.write'); }
| @unlink(MYBB_ROOT.'cache/themes/test.write'); }
|