LAYOUT: only display user menu if it's your turn in some games
authorArun Persaud <arun@nubati.net>
Sat, 24 May 2008 21:50:34 +0000 (14:50 -0700)
committerArun Persaud <arun@nubati.net>
Sat, 24 May 2008 21:50:34 +0000 (14:50 -0700)
the user menu now only has the list of games in it, so no need to display it, if it is nor your turn in any games

Signed-off-by: Arun Persaud <arun@nubati.net>
include/functions.php

index 31fc28646cd1d0ba19267910629b41a226bb6904..9f58f51f969fb610a024637213c5ff9cdd726d5a 100644 (file)
@@ -847,7 +847,6 @@ function display_table ()
 function display_user_menu()
 {
   global $WIKI,$myid,$INDEX;
-  echo "<div class=\"usermenu\">\n";
 
   $result = DB_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand".
                     " LEFT JOIN Game On Hand.game_id=Game.id".
@@ -861,6 +860,9 @@ function display_user_menu()
   $i=0;
   while( $r = DB_fetch_array($result))
     {
+      if($i==0)
+       echo "<div class=\"usermenu\">\n";
+
       $i++;
       echo "<a href=\"".$INDEX."?action=game&me=".$r[0]."\">game ".DB_format_gameid($r[1])." </a><br />\n";
       if($i>4)
@@ -870,7 +872,8 @@ function display_user_menu()
        }
     }
 
-  echo  "</div>\n";
+  if($i)
+    echo  "</div>\n";
   return;
 }