diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/db.php | 6 | ||||
-rw-r--r-- | include/functions.php | 17 | ||||
-rw-r--r-- | include/game.php | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/include/db.php b/include/db.php index 3d9d98c..b8b184d 100644 --- a/include/db.php +++ b/include/db.php @@ -1149,4 +1149,10 @@ function DB_played_by_others($gameid) $gameids[]=$r[0]; return $gameids; } + +function DB_get_number_of_tricks($gameid,$position) +{ + $r = DB_query_array("SELECT COUNT(winner) FROM Trick Where game_id='$gameid' and winner='$position'"); + return $r[0]; +} ?>
\ No newline at end of file diff --git a/include/functions.php b/include/functions.php index e57c2e5..3e21e6d 100644 --- a/include/functions.php +++ b/include/functions.php @@ -816,6 +816,7 @@ function display_table () $call = $r[5]; $hash = $r[7]; $timezone = $r[8]; + $wins = DB_get_number_of_tricks($gameid,$pos); date_default_timezone_set($defaulttimezone); $lastlogin = strtotime($r[6]); date_default_timezone_set($timezone); @@ -939,6 +940,22 @@ function display_table () "last login: ".date("Y-m-d H:i:s",$lastlogin)."\">". "<img src=\"pics/button/time-info.png\" class=\"tinybutton\" alt=\"time info\" />". "</span>\n"; + + /* show how many tricks the person made */ + switch($wins) + { + case 0: + echo "#tricks 0"; break; + case 1: + echo "#tricks 1"; break; + case 2: + case 3: + case 4: + echo "#tricks few"; break; + default: + echo "#tricks many"; break; + } + echo " </div>\n"; } diff --git a/include/game.php b/include/game.php index f9daf65..a11e6b6 100644 --- a/include/game.php +++ b/include/game.php @@ -1295,6 +1295,7 @@ switch($mystatus) /* end of trick? */ if($seq==4) { + $winner = get_winner($play,$gametype); /* returns the position */ echo " </div>\n </li>\n"; /* end div trick, end li trick */ } } |