Forums

LeagueManager (League Manager Plugin) - Bonus Points (3 posts)

  1. emzquem
    Member
    Posted 9 months ago #

    Hi Everyone,

    I am trying to amend the Leaguemanager Plugin to allow the league table to calculate a bonus point if a team loses but comes within 5 points.

    I have tried a couple of hacks but I keep hacking myself into a corner.

    Does anyone have any suggestions? I am happy to get stuck into the code.

    I am thinking that the easiest way is to amend the sql statement for the loss:
    "SELECT COUNT(ID) FROM {$wpdb->leaguemanager_matches} WHERE loser_id = '".$team_id."'"

    If I could amend it so it added an additional point to the count for all of the 'lost' games for a team where they meet the criteria i.e. 'home_points-away_points<=5 or away_points-home_points<=5' that would be great.

    Alternative suggestions welcome - I am pulling my hair out here.

    Thanks,
    Emily

  2. emzquem
    Member
    Posted 9 months ago #

    It's actually more complex than that...

    Losing Bonus (within 5 points of opposing team)=2
    Losing Bonus (score half goals of opposing team) =1

    Nothing for Losing badly.

    Thoughts welcome :)

  3. emzquem
    Member
    Posted 9 months ago #

    I've sorted it. A serious hack to the admin.php file but it works a treat.

Reply

You must log in to post.

About this Topic