- /* licence only valid until then */
- if($r[0]=="altenburg" && (time()-strtotime( "2009-12-31 23:59:59")<0) )
- $PREF["cardset"]="altenburg";
- else
- $PREF["cardset"]="english";
- }
- else
- $PREF["cardset"]="english";
-
- /* Email */
- $r = DB_query_array("SELECT value FROM User_Prefs".
- " WHERE user_id='$myid' AND pref_key='email'" );
- if($r)
- {
- if($r[0]=="emailaddict")
- $PREF["email"]="emailaddict";
- else
- $PREF["email"]="emailnonaddict";
- }
- else
- $PREF["email"]="emailnonaddict";
-
- /* Autosetup */
- $r = DB_query_array("SELECT value FROM User_Prefs".
- " WHERE user_id='$myid' AND pref_key='autosetup'" );
- if($r)
- {
- if($r[0]=='yes')
- $PREF['autosetup']='yes';
- else
- $PREF['autosetup']='no';
+ switch($pref[0])
+ {
+ case 'cardset':
+ /* licence only valid until then */
+ if($pref[1]=="altenburg" && (time()-strtotime( "2009-12-31 23:59:59")<0) )
+ $PREF["cardset"]="altenburg";
+ break;
+
+ case 'email':
+ if($pref[1]=="emailaddict")
+ $PREF["email"]="emailaddict";
+ break;
+
+ case 'autosetup':
+ if($pref[1]=='yes')
+ $PREF['autosetup']='yes';
+ break;
+
+ case 'sorting':
+ if($pref[1])
+ $PREF['sorting'] = $pref[1];
+ break;
+
+ case 'open for games':
+ if($pref[1])
+ $PREF['open_for_games'] = $pref[1];
+ break;
+
+ case 'vacation start':
+ if($pref[1])
+ $PREF['vacation_start'] = $pref[1];
+ break;
+
+ case 'vacation stop':
+ if($pref[1])
+ $PREF['vacation_stop'] = $pref[1];
+ break;
+
+ case 'vacation comment':
+ if($pref[1])
+ $PREF['vacation_comment'] = $pref[1];
+ break;
+ }