diff --git a/common.inc.php b/common.inc.php index c2c811d1..113b595c 100644 --- a/common.inc.php +++ b/common.inc.php @@ -5,14 +5,15 @@ mysql_select_db($DBNAME); session_start(); -//find out the fiar year -$q=mysql_query("SELECT * FROM config WHERE var='FAIRYEAR' AND year='0'"); -$r=mysql_fetch_object($q); -$FAIRYEAR=$r->val; -$config['FAIRYEAR']=$FAIRYEAR; +//find out the fair year and any other 'year=0' configuration parameters (things that dont change as the years go on) +$q=mysql_query("SELECT * FROM config WHERE year='0'"); +while($r=mysql_fetch_object($q)) +{ + $config[$r->var]=$r->val; +} //now pull the rest of the configuration -$q=mysql_query("SELECT * FROM config WHERE year='$FAIRYEAR'"); +$q=mysql_query("SELECT * FROM config WHERE year='".$config['FAIRYEAR']."'"); while($r=mysql_fetch_object($q)) { $config[$r->var]=$r->val; @@ -105,26 +106,26 @@ function send_header($title="")