Forum Replies Created

Viewing 4 replies - 571 through 574 (of 574 total)
  • Plugin Author LaMonte Forthun

    (@lamontef)

    The basketball ‘sports’ file has a few problems that you’ll most likely run into, such as how it adds scores for an overtime game. I’ve made a number of changes to this particular file, so if you would like to see it I can send it with explanations of what I did.

    The matter at hand though is fairly simple and I think will give you what you want for your standings. If you’re using the basketball rules, I was mistaken about why you’re results aren’t working as you want. What’s happening with the basketball rules is the sort is points first, then basket differential, then games played.

    Open the basketball.php file in the the ‘sports’ folder and find the following at line 71:

    $diff[$key] = $row->diff;
    }
    array_multisort( $points, SORT_DESC, $diff, SORT_DESC, $done, SORT_ASC, $teams );

    Replace the above with this (I’ve removed the indents to make it easier to read):

    $diff[$key] = $row->diff;
    $GA[$key] = ($row->points2_plus)/($row->points2_minus);
    $WinPerc[$key] = (($row->won_matches) > 0 ? (($row->lost_matches) > 0 ? (($row->won_matches)/($row->lost_matches)) : 1.00) : 0.00);
    }
    array_multisort( $points, SORT_DESC, $WinPerc, SORT_DESC, $GA, SORT_DESC, $teams );

    The first line hasn’t changed, the rest is what you need.

    What this does is this:

    $GA[$key] gives you a baskets for/baskets against ratio

    $WinPerc[$key] gives you a win percentage taking into account division by zero issues.

    The new sort is based first on points, then win percentage, then for/against ratio

    So far it seems to be how I want it to, so I think everything is ok, but let me know if you

    Plugin Author LaMonte Forthun

    (@lamontef)

    The standings are going to be dependent on which scoring rule you use (set in League Preferences). If the selected rule awards any points for a loss, team A would be placed in the top spot because the standings are based on points earned for wins, losses and ties, not by win percentage. From what I remember, the rule that is selected by default when you set up a new league gives 2 points for a win and 1 for a loss.

    I’m using LM for a basketball site as well and have found that the best rule for me is user defined and only awarding 2 points for a win. I’ve also modified the code to sort the standings further to allow of for point for/point against percentage to determine placings for teams with the same record, which is common in International competition.

    It’s a great plug-in with great potential, but needs some work in a few areas…

    Plugin Author LaMonte Forthun

    (@lamontef)

    Did you figure this out Trotterellone? I’m using LM for basketball leagues as well and I I have point difference showing, so if you haven’t, I might be able to help out…

    Hi Zack,

    Great looking plugin, it looks like it’s going to be an amazing organizational tool for our news site…

    I wanted to jump in on this thread, even though it’s a bit old. I too post on an exact time basis and have guidelines that we are trying to loosely keep for time between posts in various categories. Looking at the calendar and seeing the time rounded to the hour doesn’t work very well for me, so I implemented the above code and it’s definitely better for us. If you’ve got a better way to handle this, I’d be very grateful to hear it.

    I’d also vote for a check box preference if possible on the screen options right after ‘Time of Day’. That would be perfect…

    Thanks again,

    LaMonte Forthun

Viewing 4 replies - 571 through 574 (of 574 total)