NEW FEATURE: always show current score on main page
authorArun Persaud <arun@nubati.net>
Sat, 17 Jan 2009 05:29:18 +0000 (21:29 -0800)
committerArun Persaud <arun@nubati.net>
Sat, 17 Jan 2009 05:29:18 +0000 (21:29 -0800)
show the current score as the link to the score table

include/functions.php
include/game.php

index cb09d6c6ad33a55b83283ea11eb96238b15c9a0d..9103c6f517fc9e19501fc2364f1283315e66f582 100644 (file)
@@ -727,7 +727,7 @@ function can_call($what,$hash)
 
 function display_table ()
 {
 
 function display_table ()
 {
-  global $gameid, $GT, $debug,$INDEX,$defaulttimezone;
+  global $gameid, $GT, $debug,$INDEX,$defaulttimezone,$session;
   global $RULES,$GAME,$gametype;
 
   $result = DB_query("SELECT  User.fullname as name,".
   global $RULES,$GAME,$gametype;
 
   $result = DB_query("SELECT  User.fullname as name,".
@@ -863,8 +863,8 @@ function display_table ()
        }
 
       echo "    <br />\n";
        }
 
       echo "    <br />\n";
-      echo "    <span title=\"".date("Y-m-d H:i:s",$timenow).  "\">local time</span>\n";
-      echo "    <span title=\"".date("Y-m-d H:i:s",$lastlogin)."\">last login</span>\n";
+      echo "    <span title=\"local time: ".date("Y-m-d H:i:s",$timenow).  " ".
+                            "last login: ".date("Y-m-d H:i:s",$lastlogin)."\">time info</span>\n";
       echo "   </div>\n";
 
     }
       echo "   </div>\n";
 
     }
index bb3202d0619ce2349ccd42b4cd76204c432cbc99..086a2f9074501c9bbd98e3c23ba47ad0414cbc4d 100644 (file)
@@ -174,10 +174,23 @@ if($session)
     echo "       schweinchen: {$RULES['schweinchen']} <br />\n";
     echo "       call:        {$RULES['call']}        <br />\n";
     echo "  </div>\n  </div>\n";
     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);
     $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";
     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;
     $hashes = DB_get_hashes_by_session($session,$myid);
     $next     = NULL;
     $i = 1;