Home > Plugins > Uprading to LeagueManager 2.9.1

Uprading to LeagueManager 2.9.1

Everybody who has upgraded to Version 2.9 should first upgrade to 2.9.1 which will be out soon. This is crucial for everybody who upgrades to LeagueManager 2.9. You first need to add a new season and afterwards all teams and matches will be gone. Don’t despair, they just need to be put into the season you just created. Suppose the league ID is 1 and you have added a season named “2007″. You can then add all teams and matches to this season with the following function:

move_league_to_season( 1, 2007);

Now it is possible that you have created two different leagues to emulate two seasons. Let’s say League A 2007 (ID 1) and League B 2008 (ID 2) should belong to the same league, but only different seasons “2007″ and “2008″. First add the two seasons to League A. Then allocate season 2007 to all teams and matches in this league with the above command. Next you can move all teams and matches from League B 2008 to League A season 2008 with the following statement:

move_league_to_season( 2, 2008, 1);

In general the function looks like this

move_league_to_season( leagueID, season, new_leagueID, old_season);

leagueID is the ID you want to move teams and matchs to, season is the seaso. new_leagueID is only needed if you want to merge two leagues into one with different season. old_season should only be needed if you’ve already run the above functions and want to re-allocate teams and matches.

Note: This function is also available in Version 2.9, but the last two arguments are exchanged. So the call from above would look like this

move_league_to_season( 2, 2008, false, 1);

I hope this clarifies things and sorry for the inconvinience

Edit: The best way to do that is put the function call in functions.php of your theme.

Kolja Schleich Plugins

  1. May 26th, 2009 at 08:39 | #1

    Hi Kolja,

    I am waiting for this patch and I will give you a feedback again anyway ;)
    You have to know that this Plugin is one of the best what I am using! Thank you for your work :D

  2. May 28th, 2009 at 14:09 | #2

    Hi,

    I’v updated to 9.2.1 and Upgrade database, but there was an error message:
    Upgrade LeagueManager

    Upgrade database structure…

    WordPress database error: [Duplicate column name 'final']
    ALTER TABLE wp_leaguemanager_matches ADD `final` varchar( 150 ) NOT NULL
    finished

    Upgrade sucessfull

    After all I really don’t know where should I have to write these commands to complete moving leagues to seasons, so I’m in trap again :(

  3. May 28th, 2009 at 15:00 | #3

    If I add new leagueas then move them to new seasons then almost everything perfect except one:
    “[matches league_id=13 mode=]” code writes Round1 well at first time but if I would like to select Round 2 I got an SQL error message.

    So now I can use only a code like “[matches league_id=13 mode=all]” to show rounds but it will be cool if the 1st mode will be working well.

  4. Kolja Schleich
    May 28th, 2009 at 16:22 | #4

    fixed it

  5. December 1st, 2009 at 17:31 | #5

    Hi, I’m in the middle of redesigning a rugby website and the bosses want me to install an updatable league table. I’m new to making wordpress sites and not that great at php (sorry) I downloaded the latest version of LeagueManager, put in teams and a league table of matches that have happened. When I go to overview I get the message “You need to add at least one season”, I thought that happened when I entered the league table that has all the played matches? So do I have to manually place in all the matches that happened and if I have to write a function to make that happen, then there where does that go?
    Thanks.

  6. December 3rd, 2009 at 10:10 | #6

    D’oh! it’s ok I figured it out… still could do with a short video tutorial or something.

  1. No trackbacks yet.