From 4b622dbdb85fbb3512a881ec4786a05f6cd4701c Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Thu, 15 Jan 2009 21:40:35 -0800 Subject: NEW FEATURE: new user settings allows people to not be available for new games Players who set their preference on this setting to 'no' are not considered as players in a new game. --- include/preferences.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'include/preferences.php') diff --git a/include/preferences.php b/include/preferences.php index 775c4b2..616c5e2 100644 --- a/include/preferences.php +++ b/include/preferences.php @@ -110,6 +110,24 @@ if(myisset("sorting")) } } +if(myisset("open_for_games")) + { + $openforgames = $_REQUEST['open_for_games']; + if($openforgames != $PREF['open_for_games']) + { + /* check if we already have an entry for the user, if so change it, if not create new one */ + $result = DB_query("SELECT * from User_Prefs". + " WHERE user_id='$myid' AND pref_key='open for games'" ); + if( DB_fetch_array($result)) + $result = DB_query("UPDATE User_Prefs SET value=".DB_quote_smart($openforgames). + " WHERE user_id='$myid' AND pref_key='open for games'" ); + else + $result = DB_query("INSERT INTO User_Prefs VALUES(NULL,'$myid','open for games',". + DB_quote_smart($openforgames).")"); + $changed_openforgames=1; + } + } + if(myisset("password0") && $_REQUEST["password0"]!="" ) { @@ -200,6 +218,22 @@ echo " \n"; if($changed_sorting) echo "changed"; echo " \n"; +echo " Open for new games: "; + +echo " \n"; +if($changed_openforgames) echo "changed"; +echo " \n"; echo " Card set: "; echo "