Пример #1
0
            $vbulletin->datastore->fetch($specialtemplates);
        }
    } else {
        if (VB_AREA == 'Install') {
            // load it up but don't actually call fetch, we need the ability to overwrite fields.
            $datastore_class = !empty($vbulletin->config['Datastore']['class']) ? $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);
        }
    }
    // ## Load latest bitfields, overwrite datastore versions (if they exist)
    // ## (so latest upgrade script can access any new permissions)
    require_once DIR . '/includes/class_bitfield_builder.php';
    if (vB_Bitfield_Builder::build_datastore() !== false) {
        $myobj =& vB_Bitfield_Builder::init();
        require_once DIR . '/includes/functions.php';
        require_once DIR . '/includes/functions_misc.php';
        foreach (array_keys($myobj->datastore) as $group) {
            $vbulletin->{'bf_' . $group} =& $myobj->datastore["{$group}"];
            foreach (array_keys($myobj->datastore["{$group}"]) as $subgroup) {
                $vbulletin->{'bf_' . $group . '_' . $subgroup} =& $myobj->datastore["{$group}"]["{$subgroup}"];
            }
        }
    } else {
        trigger_error('Error Building Bitfields', E_USER_ERROR);
    }
}
// setup an empty hook class in case we run some of the main vB code
require_once DIR . '/includes/class_hook.php';
Пример #2
0
 /**
  * Saves Data into database
  *
  * @return	boolean
  */
 function save($dbobject)
 {
     $obj =& vB_Bitfield_Builder::init();
     if (vB_Bitfield_Builder::build_datastore() === false) {
         return false;
     }
     // save
     build_datastore('bitfields', serialize($obj->datastore), 1);
     return true;
 }
 /**
  * Saves Data into database
  *
  * @return	boolean
  */
 static function save()
 {
     global $vbulletin;
     $obj =& vB_Bitfield_Builder::init();
     if (vB_Bitfield_Builder::build_datastore() === false) {
         return false;
     }
     // Update registry
     foreach (array_keys($obj->datastore) as $group) {
         $vbulletin->{'bf_' . $group} =& $obj->datastore["{$group}"];
         foreach (array_keys($obj->datastore["{$group}"]) as $subgroup) {
             $vbulletin->{'bf_' . $group . '_' . $subgroup} =& $obj->datastore["{$group}"]["{$subgroup}"];
         }
     }
     // save
     build_datastore('bitfields', serialize($obj->datastore), 1);
     return true;
 }