X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Ffunctions.php;h=7b29a28fe311dbd12e27fd1e2af53d1a6250cc5d;hp=9f58f51f969fb610a024637213c5ff9cdd726d5a;hb=98fcfc10d9f2ae7bc90713f47e809fa1f6eccf15;hpb=671da1a387eb879aec526ea9b7614ff9381e7c0f diff --git a/include/functions.php b/include/functions.php index 9f58f51..7b29a28 100644 --- a/include/functions.php +++ b/include/functions.php @@ -734,7 +734,7 @@ function display_table () if(!$debug) echo " $name \n"; else - echo " $name\n"; + echo " $name\n"; /* add hints for poverty, wedding, solo, etc */ if( $gametype != "solo") @@ -854,17 +854,18 @@ function display_user_menu() " AND Game.player='$myid'". " AND Game.status<>'gameover'". " ORDER BY Game.session" ); - if(DB_num_rows($result)) - echo "It's your turn in these games:
\n"; $i=0; while( $r = DB_fetch_array($result)) { if($i==0) - echo "
\n"; - + { + echo "
\n"; + echo "It's your turn in these games:
\n"; + } + $i++; - echo "game ".DB_format_gameid($r[1])."
\n"; + echo "game ".DB_format_gameid($r[1])."
\n"; if($i>4) { echo "...
\n"; @@ -934,6 +935,8 @@ function generate_score_table($session) function generate_global_score_table() { + $return = array(); + /* get all ids */ $gameids = DB_get_gameids_of_finished_games_by_session(0); @@ -967,7 +970,6 @@ function generate_global_score_table() } } - echo "\n \n"; function cmp($a,$b) { if($a['nr']==0 ) return 1; @@ -981,14 +983,15 @@ function generate_global_score_table() return ($a > $b) ? -1 : 1; } usort($player,"cmp"); + foreach($player as $pl) { + /* limit to players with at least 10 games */ if($pl['nr']>10) - echo " \n"; + $return[] = array( $pl['name'], round($pl['points']/$pl['nr'],3) ); } - echo "
",$pl['name'],"",round($pl['points']/$pl['nr'],3),"
\n"; - return; + return $return; }