diff options
author | Arun Persaud <arun@nubati.net> | 2011-11-19 16:21:03 -0800 |
---|---|---|
committer | Arun Persaud <apersaud@lbl.gov> | 2011-11-19 16:21:03 -0800 |
commit | 022246b947178ed5c7b1cd6a6dcc21414559b260 (patch) | |
tree | 5d171ba2fe7b239baaae9a5dbb195a92ac6c47b8 | |
parent | 09c105d8a343e0c58fe18075abaf3af9a6f80115 (diff) | |
download | e-DoKo-022246b947178ed5c7b1cd6a6dcc21414559b260.tar.gz e-DoKo-022246b947178ed5c7b1cd6a6dcc21414559b260.tar.bz2 e-DoKo-022246b947178ed5c7b1cd6a6dcc21414559b260.zip |
LAYOUT, BUGFIX: don't show current game in "it's your turn" list, also fix layout for this on newgame.php
-rw-r--r-- | include/functions.php | 23 | ||||
-rw-r--r-- | include/game.php | 4 | ||||
-rw-r--r-- | include/newgame.php | 2 |
3 files changed, 19 insertions, 10 deletions
diff --git a/include/functions.php b/include/functions.php index 9d9856b..64c3e8b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1206,16 +1206,25 @@ function display_single_user($r) } -function display_user_menu($id) +function display_user_menu($id, $skiphash=NULL) { global $WIKI,$INDEX; - $result = DB_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand". - " LEFT JOIN Game On Hand.game_id=Game.id". - " WHERE Hand.user_id='$id'". - " AND ( Game.player='$id' OR ISNULL(Game.player) )". - " AND ( Game.status='pre' OR Game.status='play' )". - " ORDER BY Game.session" ); + if($skiphash) + $result = DB_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand". + " LEFT JOIN Game On Hand.game_id=Game.id". + " WHERE Hand.user_id='$id'". + " AND Hand.hash!='$skiphash'". + " AND ( Game.player='$id' OR ISNULL(Game.player) )". + " AND ( Game.status='pre' OR Game.status='play' )". + " ORDER BY Game.session" ); + else + $result = DB_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand". + " LEFT JOIN Game On Hand.game_id=Game.id". + " WHERE Hand.user_id='$id'". + " AND ( Game.player='$id' OR ISNULL(Game.player) )". + " AND ( Game.status='pre' OR Game.status='play' )". + " ORDER BY Game.session" ); $i=0; while( $r = DB_fetch_array($result)) diff --git a/include/game.php b/include/game.php index 1edcb85..99ff454 100644 --- a/include/game.php +++ b/include/game.php @@ -183,12 +183,12 @@ if(myisset('call') && $_REQUEST['call'] == '0' && can_call(0,$me)) if( $gamestatus != 'gameover' && isset($_SESSION['id']) ) { /* game isn't over, only valid user can get here, so show menu */ - display_user_menu($myid); + display_user_menu($myid, $me); } else if( $mystatus == 'gameover' && isset($_SESSION['id']) ) { /* user is looking at someone else's game, show the menu for the correct user */ - display_user_menu($_SESSION['id']); + display_user_menu($_SESSION['id'],$me); } else { diff --git a/include/newgame.php b/include/newgame.php index 68e0d15..6dbbd51 100644 --- a/include/newgame.php +++ b/include/newgame.php @@ -42,6 +42,7 @@ else if( !myisset("PlayerA", "PlayerB","PlayerC","PlayerD","dullen","schweinchen","callrule","lowtrump" )) { + display_user_menu($myid); /* only get players that want to be in new games */ $names = DB_get_all_user_names_open_for_games(); @@ -56,7 +57,6 @@ else output_form_for_new_game($names); echo "</div>\n"; - display_user_menu($myid); } else { |