• threelegs

    (@threelegs)


    Hi

    Firstly I have been using LeagueManager for about 1 month and it is an excellent plugin and the flexibility provided to basically allow any sport to use it is very well designed.

    I have created my own sport files to run the leagues I am managing. We have mens and ladies competitions which have different methods of calculating points and ranking and there are 5 criteria for each league.

    The problem is whilst I can override and create my own rankTeam() function to correctly sort the rank, when the code falls back into the main library code it calls a method named “isTie” to work out if they are tied.

    This uses points, diff and points2 which is returning true when I would need it to return false. This is messing up the ranking and they are not ordering correctly.

    Would it be possible to add a filter so that isTie can be overridden on a sport basis?

    On a separate note, I am not setting diff or points2 for my sport as I don’t think they are needed, even if I did set them I don’t have enough criteria options but I wanted to ask in case there is some other functionality I am hindering by not setting it.

    Many thanks

    http://wordpress.org/extend/plugins/leaguemanager/

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

    (@lamontef)

    You’re stepping into a hornets nest with this line of questions!

    The last two weeks I’ve been working on the tie function, have a look at this:

    http://wordpress.org/support/topic/team-ranking?replies=28

    and you’ll see what we’ve been talking about.

    I’m looking to change the isTie() function and pulling it out of core.php, so that what you’re seeing goes away. The plan is to create a series of tie break options that each user would be able to select on an as-needed basis.

    That’s all fine and well, I just need to get over one technical hurdle and then I’ll be working on starting the library of tie-breaker options. The two team ties will be fairly simple, it’s when we get into multiple teams things get a bit dicey.

    What sport are you working with? Do you have any code that you feel could be considered for inclusion in the core product?

    Glad you like LeagueManger and hope to make things work even better (keep in mind, I didn’t write the core product, but have been added on over the last month for support and enhancements).

    LaMonte

    Thread Starter threelegs

    (@threelegs)

    That sounds like a better solution as it probably needs that extra layers of granularity when ranking the teams.

    The sport I am working with is Crown Green Bowls and I am happy to contribute back if you feel that my templates are suitable. This is the first time I have posted on wordpress forums, is there a way I can send private message explaining the templates so that it doesn’t clog up your support board?

    One final question I have is regarding the templates. I have created a template to display fixtures in a slightly different way and I wanted to override the “match.php” so that instead of just seeing the score “6-4” I also can see the chalks which I am storing in the custom field?

    Is there a way to implement my own “Match.php” display in a template fashion like the main “matches-xxx.php”

    Thanks again

    Plugin Author LaMonte Forthun

    (@lamontef)

    If you’ve got some code you’d like to send me, send it to lamontef (at) yahoo (.) com

    If you have a template you want to replace, you have two options (from the documentation):

    If you want to modify existing templates copy it to

    your_theme_dir/leaguemanager/

    The plugin will then first look in your theme directory. Further it is possible to design own templates, e.g. multiple standings templates. Assume you create a template called standings-sample1.php. To load this template use the following code.

    [standings league_id=ID template=sample1]

    I’ve actually never put a template in the theme directory, I always rename so things are all in the same location and it’s easier to keep track.

    The nice thing about LeagueManger is that Kolja (the developer) made it very modular, so you can add items based on your sport file and add templates that suite your needs. I think a lot of users (myself included) think that modifying core code is necessary when making changes. I can’t tell you how much I’m backtracking now that I’ve been working on the core and have a very worn out installation that I’ve tweaked to work for me. Now I’ve had to go back in and pull things out that I added to the database when I didn’t need to, modified core code I didn’t need to, etc., etc.

    What code can I add to core.php so that a tie would rank the tieing teams according to PCT rather than their Team#?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘IsTie function’ is closed to new replies.