X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=functions.php;h=0ce3104701f2175c24d53f6e63053904ba8846d7;hp=1e80c31665c733d1dd6a4dadd3540bc50a29764d;hb=becb5e1267866b1fa858c08125fdba81003dfc65;hpb=24b4c073220b00bc0cb2c004351a051659b2f03b diff --git a/functions.php b/functions.php index 1e80c31..0ce3104 100644 --- a/functions.php +++ b/functions.php @@ -390,26 +390,6 @@ function display_cards($me,$myturn) return; } -function return_timezone($offset) -{ - switch($offset) - { - case '1': - $zone = "Europe/Berlin"; - break; - case '-8': - $zone = "America/Vancouver"; - break; - case '13': - $zone = "Pacific/Auckland"; - break; - default: - $zone = "Europe/London"; - } - - return $zone; -} - function have_suit($cards,$c) { global $CARDS; @@ -660,7 +640,7 @@ function can_call($what,$hash) 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, ". @@ -669,14 +649,15 @@ function display_table () " Hand.sickness as sickness, ". " Hand.point_call, ". " User.last_login, ". - " Hand.hash ". + " Hand.hash, ". + " User.timezone ". "FROM Hand ". "LEFT JOIN User ON User.id=Hand.user_id ". "WHERE Hand.game_id='".$gameid."' ". "ORDER BY position ASC"); echo "
\n". - " \"table\"\n"; + " \"table\"\n"; while($r = mysql_fetch_array($result,MYSQL_NUM)) { $name = $r[0]; @@ -685,18 +666,18 @@ function display_table () $party = $r[3]; $sickness = $r[4]; $call = $r[5]; - $lastlogin = strtotime($r[6]); $hash = $r[7]; - - $offset = DB_get_user_timezone($user); - $zone = return_timezone($offset); - date_default_timezone_set($zone); + $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")); echo "
\n"; if(!$debug) echo " $name \n"; else - echo " $name\n"; + echo " $name\n"; /* add hints for poverty, wedding, solo, etc */ if($GT=="poverty" && $party=="re") @@ -790,7 +771,7 @@ function display_table () } echo "
\n"; - echo " local time\n"; + echo " local time\n"; echo " last login\n"; echo "
\n"; @@ -804,29 +785,30 @@ function display_table () function display_user_menu() { - global $wiki,$myid,$host; + global $wiki,$myid,$INDEX,$STATS; echo "
\n". - " go to my user page "; + " Go to my user page "; $result = mysql_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'". - " AND Game.status<>'gameover'" ); + " AND Game.status<>'gameover'". + " ORDER BY Game.session" ); if(mysql_num_rows($result)) echo "
It's your turn in these games:
\n"; while( $r = mysql_fetch_array($result,MYSQL_NUM)) { - echo "game ".DB_format_gameid($r[1])."
\n"; + echo "game ".DB_format_gameid($r[1])."
\n"; } - echo "
start a new game\n"; + echo "
Start a new game\n"; - echo "
Statistics\n"; + echo "
Statistics\n"; echo - "
Report bugs in the wiki\n"; + "
Report bugs in the wiki\n"; echo "
\n"; return; }