Hello,
I found the solution for the calculation of offensive’s and defensive’s points for the French rugby championship (Top 14 and Pro D2).
Go to the rugby.php at line 117 or the item “re-calculate points”
Change the totality function calculatePoints by this code :
function 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';
/* Calcul du point de bonus offensif : 3 essais de plus que l'adversaire */
if ( $match->winner_id == $team_id && abs($match->tries['home']-$match->tries['away']) >= 3 )
$points['plus'] += 1;
/* Calcul du point de bonus défensif : défaite par 7 points d'écart ou moins */
if ( $match->loser_id == $team_id && abs($match->home_points-$match->away_points) <= 7 )
$points['plus'] += 1;
}
return $points;
}
Jér?me