BUGIFX: output was displayed twice
[e-DoKo.git] / functions.php
index c835f89897906c6f188690f70bacb022bcc5bf1f..0ce3104701f2175c24d53f6e63053904ba8846d7 100644 (file)
@@ -640,7 +640,7 @@ function can_call($what,$hash)
 
 function display_table ()
 {
 
 function display_table ()
 {
-  global $gameid, $GT, $debug,$host;
+  global $gameid, $GT, $debug,$INDEX,$defaulttimezone;
 
   $result = mysql_query("SELECT  User.fullname as name,".
                        "        Hand.position as position, ".
 
   $result = mysql_query("SELECT  User.fullname as name,".
                        "        Hand.position as position, ".
@@ -668,16 +668,16 @@ function display_table ()
       $call      = $r[5];
       $hash      = $r[7];
       $timezone  = $r[8];
       $call      = $r[5];
       $hash      = $r[7];
       $timezone  = $r[8];
+      date_default_timezone_set($defaulttimezone);
+      $lastlogin = strtotime($r[6]);
       date_default_timezone_set($timezone);
       $timenow   = strtotime(date("Y-m-d H:i:s"));
       date_default_timezone_set($timezone);
       $timenow   = strtotime(date("Y-m-d H:i:s"));
-      $lastlogin = strtotime($r[6]);
-
 
       echo "  <div class=\"table".($pos-1)."\">\n";
       if(!$debug)
        echo "   $name \n";
       else
 
       echo "  <div class=\"table".($pos-1)."\">\n";
       if(!$debug)
        echo "   $name \n";
       else
-       echo "   <a href=\"".$host."?me=".$hash."\">$name</a>\n";
+       echo "   <a href=\"".$INDEX."?me=".$hash."\">$name</a>\n";
 
       /* add hints for poverty, wedding, solo, etc */
       if($GT=="poverty" && $party=="re")
 
       /* add hints for poverty, wedding, solo, etc */
       if($GT=="poverty" && $party=="re")
@@ -785,9 +785,9 @@ function display_table ()
 
 function display_user_menu()
 {
 
 function display_user_menu()
 {
-  global $wiki,$myid,$host;
+  global $wiki,$myid,$INDEX,$STATS;
   echo "<div class=\"usermenu\">\n".
   echo "<div class=\"usermenu\">\n".
-    "<a href=\"index.php\"> Go to my user page </a>";
+    "<a href=\"".$INDEX."\"> Go to my user page </a>";
 
   $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand".
                        " LEFT JOIN Game On Hand.game_id=Game.id".
 
   $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.player from Hand".
                        " LEFT JOIN Game On Hand.game_id=Game.id".
@@ -800,15 +800,15 @@ function display_user_menu()
 
   while( $r = mysql_fetch_array($result,MYSQL_NUM))
     {
 
   while( $r = mysql_fetch_array($result,MYSQL_NUM))
     {
-      echo "<a href=\"".$host."?me=".$r[0]."\">game ".DB_format_gameid($r[1])." </a><br />\n";
+      echo "<a href=\"".$INDEX."?me=".$r[0]."\">game ".DB_format_gameid($r[1])." </a><br />\n";
     }
 
     }
 
-  echo "<hr /> <a href=\"".$host."?new\">Start a new game</a>\n";
+  echo "<hr /> <a href=\"".$INDEX."?new\">Start a new game</a>\n";
 
 
-  echo "<hr /> <a href=\"".substr($host,0,-9)."stats.php\">Statistics</a>\n";
+  echo "<hr /> <a href=\"".$STATS."\">Statistics</a>\n";
 
   echo
 
   echo
-    "<hr />Report bugs in the <a href=\"". $wiki."\">wiki</a>\n";
+    "<hr />Report bugs in the <a href=\"".$wiki."\">wiki</a>\n";
   echo  "</div>\n";
   return;
 }
   echo  "</div>\n";
   return;
 }