-
- if (!isset($_SESSION['SysPrefs']->prefs)) { // cached preferences
-
- $_SESSION['SysPrefs'] = new sys_prefs();
-
- $sql = "SELECT name, value FROM ".TB_PREF."sys_prefs";
- $result = @db_query($sql); // supress errors before 2.3 db structure upgrade
-
- if(!$result)
- return null;
-
- while($pref = db_fetch_assoc($result)) {
- $_SESSION['SysPrefs']->prefs[$pref['name']] = $pref['value'];
- }
-
- $SysPrefs = &$_SESSION['SysPrefs'];