Changeset 1284 for trunk/include/functions.inc.php
- Timestamp:
- Apr 27, 2006, 11:08:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r1221 r1284 882 882 } 883 883 884 /** 885 * Add configuration parameters from database to global $conf array 886 * 887 * @return void 888 */ 889 function load_conf_from_db() 890 { 891 global $conf; 892 893 $query = ' 894 SELECT param,value 895 FROM '.CONFIG_TABLE.' 896 ;'; 897 $result = pwg_query($query); 898 899 if (mysql_num_rows($result) == 0) 900 { 901 die('No configuration data'); 902 } 903 904 while ($row = mysql_fetch_array($result)) 905 { 906 $conf[ $row['param'] ] = isset($row['value']) ? $row['value'] : ''; 907 908 // If the field is true or false, the variable is transformed into a 909 // boolean value. 910 if ($conf[$row['param']] == 'true' or $conf[$row['param']] == 'false') 911 { 912 $conf[ $row['param'] ] = get_boolean($conf[ $row['param'] ]); 913 } 914 } 915 } 884 916 ?>
Note: See TracChangeset
for help on using the changeset viewer.