diff options
Diffstat (limited to 'include/game.php')
-rw-r--r-- | include/game.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/game.php b/include/game.php index 377d0aa..845a562 100644 --- a/include/game.php +++ b/include/game.php @@ -215,12 +215,23 @@ if($session) $finalscore = array_pop($tmpscore); $finalscore = $finalscore['players']; - echo " <div class=\"sessionscore\">Score: \n"; - foreach($finalscore as $user=>$value) + echo " <div class=\"sessionscore\">"; + if($finalscore) + { + echo "Score: \n"; + /* output the final score on the front page */ + foreach($finalscore as $user=>$value) + { + $name = DB_get_name('userid',$user); + echo " ".substr($name,0,2).": $value "; + } + } + else { - $name = DB_get_name('userid',$user); - echo " ".substr($name,0,2).": $value "; + /* first game, no score yet */ + echo " "; } + echo format_score_table_html($score,$myid); echo " </div>\n"; |