From 2666bb58429c385b716d2ffd5d5fe9a9e7af4f45 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Mon, 20 Oct 2008 19:54:13 -0700 Subject: BUGFIX: make user menu and personal notes appear again had them only shown when player was logged in, but there is really no reason to not show them to players who are not logged in in an ongoing game (only the correct player should get to a page with an ongoing game) Signed-off-by: Arun Persaud --- include/functions.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index d09408c..ecb9811 100644 --- a/include/functions.php +++ b/include/functions.php @@ -857,20 +857,14 @@ function display_table () } -function display_user_menu() +function display_user_menu($id) { global $WIKI,$INDEX; - /* get the id we are looking for */ - if(isset($_SESSION['id'])) - $myid = $_SESSION['id']; - else - return; - $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='$myid'". - " AND ( Game.player='$myid' OR ISNULL(Game.player) )". + " WHERE Hand.user_id='$id'". + " AND ( Game.player='$id' OR ISNULL(Game.player) )". " AND Game.status<>'gameover'". " ORDER BY Game.session" ); @@ -884,7 +878,8 @@ function display_user_menu() } $i++; - echo "game ".DB_format_gameid($r[1])."
\n"; + echo "game ".DB_format_gameid($r[1])."
\n"; if($i>4) { echo "...
\n"; -- cgit v1.2.3-18-g5258