+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;
+ }
+ }
+