Standings for soccer
-
Lamonte,
I noticed that the sorting rules for the standings table are not correct for soccer. When two teams have equal points, but one team has played less games, the latter team is higher in the standings. I have modified soccer.php to reflect this. Can you add this in a future release?
I have added the variable $done to the multi sort array as follows (lines 61 and beyond)/** * rank Teams * * @param array $teams * @return array of teams */ function rankTeams( $teams ) { foreach ( $teams AS $key => $row ) { $points[$key] = $row->points['plus']+$row->add_points; $diff[$key] = $row->diff; $goals[$key] = $row->points2['plus']; $done[$key] = $row->done_matches; } array_multisort( $points, SORT_DESC, $done, SORT_ASC, $diff, SORT_DESC, $goals, SORT_DESC, $teams ); return $teams; }
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Standings for soccer’ is closed to new replies.