WordPress.org

Ready to get started?Download WordPress

Forums

LeagueManager
[resolved] Table by Group (8 posts)

  1. uili
    Member
    Posted 1 year ago #

    I running it on a soccer championship mode and I have 4 groups (A, B, C , D) with 5 teams each (20 teams total)... but the standings table show all the teams together... i would like to have 4 standings table(one for each Group) with those 5 teams on each!

    Then when i get to the final, it can be all together, just like it is now!
    Any idea how i can make this work on widget and standings template?

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

  2. uili
    Member
    Posted 1 year ago #

    ok.. that was easy...
    i made one template called championship-compact.php

    with this code:

    <?php foreach ( $championship->getGroups() AS $key => $group ) : ?>
    <?php $teams = $leaguemanager->getTeams( "<code>league_id</code> = '".$league->id."' AND <code>season</code> = '".$league->season."' AND <code>group</code> = '".$group."'" ); ?>
    <?php $matches = $leaguemanager->getMatches( "<code>league_id</code>= '".$league->id."' AND <code>season</code> = '".$league->season."' AND <code>final</code> = '' AND <code>group</code> = '".$group."'" ); ?>
    
    <h4><?php printf(__('Group %s', 'leaguemanager'), $group) ?></h4>
    <?php leaguemanager_standings( $league->id, array('season' => $league->season, 'group' => $group, 'template' => 'compact', 'logo' => false) ); ?>
    
    <?php endforeach; ?>

    and on my widgets i added a text block with this shortcode:

    [championship league_id=1 template=compact]

  3. SimplyCJ
    Member
    Posted 1 year ago #

    So I tried this but I get MYSql errors. Any idea?

    http://bfl.cp3designs.com/teams/

  4. LaMonte Forthun
    Member
    Plugin Author

    Posted 1 year ago #

    I'm not sure what the '' and '' tags are for, but those are causing your problem from what it looks like.

    Just curious, have you tried this:

    [standings league_id=1 group=A]

    The standings will list all teams unless you request a certain group. If I have a league with the same four groups, I have

    [standings league_id=1 group=A]
    [standings league_id=1 group=B]
    [standings league_id=1 group=C]
    [standings league_id=1 group=D]

    and get four tables, one for each group. Is that what you're looking for?

  5. SimplyCJ
    Member
    Posted 1 year ago #

    I cant seem to find my group IDs anywhere. I've tried that not getting anything to show up.

  6. LaMonte Forthun
    Member
    Plugin Author

    Posted 1 year ago #

    The Groups are set up in the league preferences and then the teams have to be set up within the groups for it to work properly.

  7. SimplyCJ
    Member
    Posted 1 year ago #

    Right I have the groups setup for instance. I'm using this for a Madden Football league and I have the groups setup as divisions. AFC East, AFC West, etc etc. I also have the teams established in the groups. When I use your code

    [standings league_id=3 group=AFC East]
    [standings league_id=1 group=A]
    [standings league_id=1 group=1]

    None of those show anything when I save it on a page.

  8. LaMonte Forthun
    Member
    Plugin Author

    Posted 1 year ago #

    If you want I can take a look at it from the inside and see what I can come up with.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.