<?php

  /*
  
      global_preferences.php

      Imports the preferences from the tbl_System_Preferences
      table in the database.
    
      Changelog:
        2005-04-23 arne_sf: 
      
      ## PAGE CONTAINS HANDYANDY MYSQL MODS ##
      ## Copyright (C) 2005 Andy Deakin (handyandy.org.uk) ##

      ----

      THIS FILE HAS DATABASE SPECIFIC FUNCTIONS, therefore, if a
      database migration occurs, this page must be updated.

      ----

      Copyright (C) 2002  David Thorne (davethorne@gmail.com)
  
      This program is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License
      as published by the Free Software Foundation version 2.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.

      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

  */

  // Ensure this is called from within the index.php file (for security)
  if (strpos($_SERVER["SCRIPT_NAME"], basename(__FILE__, '.php')) !== false) {
    header("location: index.php");
  }

  // Create an associative array and populate it with the system preferences
  $result = db_recordset("SELECT * FROM tbl_System_Preferences");
  $global_prefs = Array();
  foreach ($result as $pref) {
    $global_prefs[$pref[identifier]] = $pref[value];
  }

?>
