. */ /*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 */ $setup = array(); $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; } } //Contact info $setup['ContactInfo'] = ""; if( strlen($setup['EventName']) > 0 ) $setup['ContactInfo'] .= "\t".$setup['EventName']."\n"; if( strlen($setup['EventCareOf']) > 0 ) $setup['ContactInfo'] .= "\tc/o ".$setup['EventCareOf']."\n"; if( strlen($setup['EventStreet']) > 0 ) $setup['ContactInfo'] .= "\t".$setup['EventStreet']."\n"; if( strlen($setup['EventCountryCode']) > 0 ) $setup['ContactInfo'] .= "\t".$setup['EventCountryCode']." - "; if( strlen($setup['EventZIP']) > 0 ) $setup['ContactInfo'] .= $setup['EventZIP']." "; if( strlen($setup['EventCity']) > 0 ) $setup['ContactInfo'] .= $setup['EventCity']; $setup['ContactInfo'] .= "\n"; if( strlen($setup['EventPhone']) > 0 ) $setup['ContactInfo'] .= "\tPhone: ".$setup['EventPhone']."\n"; if( strlen($setup['EventFax']) > 0 ) $setup['ContactInfo'] .= "\tFax: ".$setup['EventFax']."\n"; if( strlen($setup['EventEmail']) > 0 ) $setup['ContactInfo'] .= "\tE-mail: ".$setup['EventEmail']."\n"; if( strlen($setup['EventUrl']) > 0 ) $setup['ContactInfo'] .= "\tWebsite: ".$setup['EventUrl']."\n"; //EventID $h = strtotime($setup['EventDateStart']); $EVENTNUMID = sprintf("%03d", (date("y", $h)*12 + date("m", $h))); define("EVENTNUMID", $EVENTNUMID); ?>