From ed0ffd0d14904b661622a29e95661fc03728c2c4 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Fri, 16 Jan 2009 20:39:42 -0800 Subject: [PATCH] LAYOUT: add names of players to end of score table for long sessions if a session has more than 12 games, add the names of the players also at the end of the score table. --- include/functions.php | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/include/functions.php b/include/functions.php index f693abc..51fadbb 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1070,39 +1070,60 @@ function format_score_table_html($score,$userid) if(sizeof($score)==0) return ""; - $output = "
\n\n \n \n"; + $output = "
\n
\n"; /* output header */ - $output.= " "; + $header = ""; + $header.= " \n \n"; + $header.= " "; foreach($score[0]['players'] as $id=>$points) { $name = DB_get_name('userid',$id); /*TODO*/ - $output.= ""; + $header.= ""; } - $output.="\n \n \n \n"; + $header.="\n \n \n"; + /* use the same as footer */ + $footer = ""; + $footer.= " \n \n"; + $footer.= " "; + foreach($score[0]['players'] as $id=>$points) + { + $name = DB_get_name('userid',$id); /*TODO*/ + $footer.= ""; + } + $footer.="\n \n \n"; + + /* body */ + $body = ""; + $body.= " \n"; $i=0; foreach($score as $game) { $i++; - $output.=" "; + $body.=" "; $userhash = DB_get_hash_from_gameid_and_userid($game['gameid'],$userid); /* create link to old games only if you are logged in and its your game*/ if(isset($_SESSION['id']) && $_SESSION['id']==$userid) - $output.=" "; + $body.=" "; else - $output.=" "; + $body.=" "; foreach($game['players'] as $id=>$points) - $output.=""; - $output.=""; + $body.="\n"; + $body.= " S"; + $body.="\n"; } + $output.=$header; + if($i>12) + $output.=$footer; + $output.=$body; + $output.=" \n
No
No ".substr($name,0,2)." ".substr($name,0,2)." P
P
No ".substr($name,0,2)." P
$i $i$i$i".$points."".$game['points']; + $body.="".$points."".$game['points']; /* check for solo */ if($game['solo']) - $output.= " S"; - $output.="
\n
\n"; return $output; -- 2.25.1