Ignore:
Timestamp:
Apr 27, 2006, 11:08:50 PM (18 years ago)
Author:
plg
Message:

merge -r1281:1283 from branch 1.6 to trunk (bug 228 fixed one more time, and
other little things)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/functions.inc.php

    r1221 r1284  
    882882}
    883883
     884/**
     885 * Add configuration parameters from database to global $conf array
     886 *
     887 * @return void
     888 */
     889function load_conf_from_db()
     890{
     891  global $conf;
     892 
     893  $query = '
     894SELECT 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}
    884916?>
Note: See TracChangeset for help on using the changeset viewer.