echo " schweinchen: {$RULES['schweinchen']} <br />\n";
echo " call: {$RULES['call']} <br />\n";
echo " </div>\n </div>\n";
- echo " <div class=\"sessionscore\">Score \n";
+
+ /* show score */
$score = generate_score_table($session);
+ $tmpscore= $score;
+ $finalscore = array_pop($tmpscore);
+ $finalscore = $finalscore['players'];
+
+ echo " <div class=\"sessionscore\">Score: \n";
+ foreach($finalscore as $user=>$value)
+ {
+ $name = DB_get_name('userid',$user);
+ echo " ".substr($name,0,2).": $value ";
+ }
echo format_score_table_html($score,$myid);
echo " </div>\n";
+
+ /* figure out which game in a session we are in and link to the previous and next game if possible */
$hashes = DB_get_hashes_by_session($session,$myid);
+ $next = NULL;
$i = 1;
foreach($hashes as $hash)
{
$lasthash=$hash;
}
$i--;
+
+ if($j>1)
+ $previous = $hashes[$j-2];
+ else
+ $previous = NULL;
+ if($j<$i)
+ $next = $hashes[$j];
+ else
+ $next = NULL;
+
if(isset($_SESSION['id']) && $_SESSION['id']==$myid)
- echo "This is game number $j of <a href=\"{$INDEX}?action=game&me=$lasthash\">$i</a> in session $session.";
+ {
+ if($previous)
+ echo "<a href=\"{$INDEX}?action=game&me=$previous\">previous game</a> \n";
+ echo "This is game number $j of <a href=\"{$INDEX}?action=game&me=$lasthash\">$i</a> in session $session.\n";
+ if($next)
+ echo " <a href=\"{$INDEX}?action=game&me=$next\">next game</a> \n";
+ }
else
echo "This is game number $j of $i in session $session.";
echo "\n</div>\n";