Beispiel #1
0
 $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'");
         $db->show_errors();
         $datastore_class = (!empty($vbulletin->config['Datastore']['class']) and !defined('STDIN')) ? $vbulletin->config['Datastore']['class'] : 'vB_Datastore';
         if ($datastore_class != 'vB_Datastore') {
             require_once DIR . '/includes/class_datastore.php';
         }
         $vbulletin->datastore = new $datastore_class($vbulletin, $db);
         $vbulletin->datastore->fetch($specialtemplates);
     }
 } else {
     if (VB_AREA == 'Install' or VB_AREA == 'tools') {
         // load it up but don't actually call fetch, we need the ability to overwrite fields.
         $datastore_class = (!empty($vbulletin->config['Datastore']['class']) and !defined('STDIN')) ? $vbulletin->config['Datastore']['class'] : 'vB_Datastore';
         if ($datastore_class != 'vB_Datastore') {
             require_once DIR . '/includes/class_datastore.php';
         }