. */ /*The database for setup consists of the following parts: * SetupID smallint(5): unique ID of the option * Name varchar(30): the name of the variable ($setup['Name']=Value) * Value varchar(150): the value for the variable * RegEx varchar(100): the regular expresion the value should comply with. You can use the following: * [a|b|c]: Value should be 'a', 'b' or 'c'. It can be more than one character * [url]: A url should be provided, starting with http(s):// * [email]: An e-mail address should be provided * [int]: An integer value should be provided * /( )/: Value will be checked against the regular expresion * [date]: A date in the format dd.mm.yyyy * [phone]: A phone/fax number should be provided * [bool]: 'true' or 'false' should be provided. It will be transfered to a real bool * Explain varchar(10): A text explaining the variable * ac_edit enum('yes','no'): people with edit access can change the value * ac_editall enum('yes','no'): people with editall access can change the value * ac_localorg enum('yes','no'): people with localorg access can change the value * ac_chair enum('yes','no'): people with chair access can change the value * ac_admin enum('yes','no'): people with admin access can change the value */ $res = doquery("SELECT `Name`, `Value`, `RegEx` FROM `setup`"); while( $row=mysql_fetch_array($res) ) { switch( $row['RegEx'] ) { case "[bool]": if( $row['Value']=="true" ) $setup[ $row['Name'] ]=true; else $setup[ $row['Name'] ]=false; break; default: $setup[ $row['Name'] ]=$row['Value']; break; } } ?>