// make database connection $db->connect($vbulletin->config['Database']['dbname'], $vbulletin->config['MasterServer']['servername'], $vbulletin->config['MasterServer']['port'], $vbulletin->config['MasterServer']['username'], $vbulletin->config['MasterServer']['password'], $vbulletin->config['MasterServer']['usepconnect'], $vbulletin->config['SlaveServer']['servername'], $vbulletin->config['SlaveServer']['port'], $vbulletin->config['SlaveServer']['username'], $vbulletin->config['SlaveServer']['password'], $vbulletin->config['SlaveServer']['usepconnect'], $vbulletin->config['Mysqli']['ini_file'], $vbulletin->config['Mysqli']['charset']); //30443 Right now the product doesn't work in strict mode at all. Its silly to make people have to edit their //config to handle what appears to be a very common case (though the mysql docs say that no mode is the default) //we no longer use the force_sql_mode parameter, though if the app is fixed to handle strict mode then we //may wish to change the default again, in which case we should honor the force_sql_mode option. //added the force parameter //The same logic is in includes/init.php and should stay in sync. //if (!empty($vbulletin->config['Database']['force_sql_mode'])) if (empty($vbulletin->config['Database']['no_force_sql_mode'])) { $db->force_sql_mode(''); } // ############################################################################# // fetch options and other data from the datastore // grab the MySQL Version once and let every script use it. $mysqlversion = $db->query_first("SELECT version() AS version"); define('MYSQL_VERSION', $mysqlversion['version']); if (VB_AREA == 'Upgrade') { $optionstemp = false; $db->hide_errors(); $optionstemp = $db->query_first("SELECT template FROM template WHERE title = 'options' AND templatesetid = -1"); $db->show_errors(); // ## Found vB2 Options so use them... if ($optionstemp) { eval($optionstemp['template']); $vbulletin->options =& $vboptions; $vbulletin->versionnumber = $templateversion; } else { // we need our datastore table to be updated properly to function $db->hide_errors(); $db->query_write("ALTER TABLE " . TABLE_PREFIX . "datastore ADD unserialize SMALLINT NOT NULL DEFAULT '2'");