3.8.8.5 – Rugby – Bonus Points
-
Hi there, great plugin – making things so easy ??
In the rugby sports module the bonus point system needs an update (ok, there are different systems available, but this one is most common):
Bonus Point Try: more or equal than 4
Bonus Point Lost: less or equal than 7function calculatePoints( $points, $team_id, $rule ) { global $leaguemanager; extract($rule); $matches = $leaguemanager->getMatches( "(<code>home_team</code> = {$team_id} OR <code>away_team</code> = {$team_id})" ); foreach ( $matches AS $match ) { $index = ( $match->home_team == $team_id ) ? 'home' : 'away'; if ( $match->tries[$index] >= 4 ) $points['plus'] += 1; // Current Team Lost Match with less than 6 points if ( $match->loser_id == $team_id && abs($match->home_points-$match->away_points) <= 7 ) $points['plus'] += 1; } return $points; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘3.8.8.5 – Rugby – Bonus Points’ is closed to new replies.