summaryrefslogtreecommitdiffstats
path: root/include/newgame.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2009-01-15 21:40:35 -0800
committerArun Persaud <arun@nubati.net>2009-01-15 21:40:35 -0800
commit4b622dbdb85fbb3512a881ec4786a05f6cd4701c (patch)
treebc3ee3fc89b39fa29c8c74ca38ff1d9d53d36c3d /include/newgame.php
parent8114e8920b56b4f078d2b3ff8d283cdf4d18c679 (diff)
downloade-DoKo-4b622dbdb85fbb3512a881ec4786a05f6cd4701c.tar.gz
e-DoKo-4b622dbdb85fbb3512a881ec4786a05f6cd4701c.tar.bz2
e-DoKo-4b622dbdb85fbb3512a881ec4786a05f6cd4701c.zip
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.
Diffstat (limited to 'include/newgame.php')
-rw-r--r--include/newgame.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/newgame.php b/include/newgame.php
index 7349e7e..7a88a80 100644
--- a/include/newgame.php
+++ b/include/newgame.php
@@ -23,10 +23,20 @@ else
if( !myisset("PlayerA", "PlayerB","PlayerC","PlayerD","dullen","schweinchen","callrule" ))
{
- $names = DB_get_all_names();
+ /* only get players that want to be in new games */
+ $names = DB_get_all_user_names_open_for_games();
+
+ /* add player if he is not open for games */
+ if(!in_array($names,$_SESSION["name"]))
+ $names[]=$_SESSION["name"];
+
+ /* add some randomness */
+ shuffle($names);
+
echo "<div class=\"user\">\n";
output_form_for_new_game($names);
echo "</div>\n";
+
display_user_menu($myid);
}
else