function z__fp_get_system_settings

6.x db.inc z__fp_get_system_settings($force_rebuild = FALSE)

File

includes/db.inc, line 1013
This file contains mostly db shortcuts.

Code

function z__fp_get_system_settings($force_rebuild = FALSE) {
  depricated_message("Using fp_get_system_settings() is deprecated.");

  if ($force_rebuild == FALSE && isset($GLOBALS ["fp_system_settings"])) {
    return $GLOBALS ["fp_system_settings"];
  }

  // Get all of our settings from the variables table.
  $res = db_query("SELECT * FROM variables");
  while ($cur = db_fetch_array($res)) {
    $name = $cur ["name"];
    $val = unserialize($cur ["value"]);

    if ($val == "BOOLEAN_FALSE_PLACEHOLDER") {
      $val = FALSE;
    }

    $settings [$name] = $val;
    $GLOBALS ["fp_system_settings"][$name] = $val;

  }


  // Make sure some important settings have _something_ set, or else it could cause
  // problems for some modules.
  if ($settings ["current_catalog_year"] == "") {
    $settings ["current_catalog_year"] = 2006;
  }
  if ($settings ["earliest_catalog_year"] == "") {
    $settings ["earliest_catalog_year"] = 2006;
  }

  $GLOBALS ["fp_system_variables"] = $settings;

  return $settings;

}