Page 1 of 2

OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Nov 14, 2013 10:56 am
by Vanguard
I've got a tournament set up in OBBLM with 14 rounds.
Initially it all seemed ok, but I've now realised that there's an error in the code when I try to view any of the matches in Rounds 13 and 14.
It looks like OBBLM only expects up to 12 rounds. I've dug into it a little, and it seems that the global variable T_ROUNDS is what I'd need to change, but I can't find where this is declared. Can anyone point me in the right direction?

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Nov 14, 2013 11:32 am
by Vanguard
Ok, I've dug a little further and found $T_ROUNDS is an array declared in class_match.php. It seems to be an array of all the rounds in a tournament, with the named rounds (Final, Semi, etc) defined first and then this line:

Code: Select all

array_combine(range(1,12), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,12)))
which adds on Round1 to 12.
I changed the code to add Round 1 to 14:

Code: Select all

array_combine(range(1,12), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,12)))
This has had some success. I can now view the matches in rounds 13 and 14, although it still generates an error for the round number.

Code: Select all

Notice: Trying to get property of non-object in /home3/gravityp/public_html/obblm/lib/class_translations.php on line 64
Also, if I choose to reschedule a match there are now two blank entries below round12.
Obviously I'm still missing something...

(Also, if anyone knows how to reduce the size of the code boxes, please let me know :D )

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Nov 14, 2013 12:20 pm
by Vanguard
And after some further digging, I have discovered the lang/translations.xml file. This seems to be where the round names are taken from. I'd initially thought that they were systemically generated but it looks like they're actually specified in here. Adding two more lines below Round 12 seems to have fixed the problem.

I'll let you know if it all implodes when I turn my back. :)

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Nov 14, 2013 5:56 pm
by funnyfingers
Thank you for posting this. I implemented it on a league's site to fix the same problem. Would you mind creating a ticket at http://code.google.com/p/obblm?

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Fri Nov 15, 2013 12:47 am
by Vanguard
No problem, done!

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Jan 02, 2014 11:38 am
by Bakdal
Thanks for finding this and working on it. I ran into the issue in my leagues last season. I just figured I'd messed something up when I set up the tournament. My leagues next season will have 20 rounds and since I am not exactly good at coding I thought I'd ask if I got it right before I make any changes…

Code: Select all

So in "class_match.php" I am supposed to replace

array_combine(range(1,12), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,12))) 

with 

array_combine(range(1,20), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,20)))

Then in "lang/translations.xml" 

add 8 more lines below "Round 12" in 
That should fix it right? I am following it on http://code.google.com/p/obblm? but seeing as the season is starting up soon I figure I better fix what I can myself (with help from smarter guys than myself) rather than waiting for an official upgrade.

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Jan 02, 2014 4:42 pm
by funnyfingers
Thanks for the reminder. I'll try to post a proper update tonight so you can just download the 2 files, but you've stated this correctly.

If you are using the Mercury VPS OBBLM hosting, I can do the work for you.

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Jan 02, 2014 5:15 pm
by Bakdal
funnyfingers wrote:If you are using the Mercury VPS OBBLM hosting, I can do the work for you.
I am indeed using Mercury VPS hosting services and got a email about this just moments ago. So guess I don't have to worry about this issue anymore. Awesome :D Good to know that I understood Vanguard's post correctly, even if I don't have to apply the fix myself.

Good customer service.

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Tue Feb 04, 2014 8:16 pm
by mzukerman
Thank you for posting this. I expect we are soon going to have the same problem, especially when there are odd numbers of teams in our leagues, requiring bye-weeks.

Posted: Tue Feb 04, 2014 8:24 pm
by Shteve0
Agree on Mercury VPS service being excellent. Cant recommend it enough

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Fri Feb 07, 2014 11:15 am
by funnyfingers
Thank you very much, Steve.

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Wed Mar 12, 2014 9:09 pm
by Aronne320
I've changed the library as follows

$T_ROUNDS = array(
RT_FINAL => 'matches/tourmatches/roundtypes/final',
RT_3RD_PLAYOFF => 'matches/tourmatches/roundtypes/thirdPlayoff',
RT_SEMI => 'matches/tourmatches/roundtypes/semi',
RT_QUARTER => 'matches/tourmatches/roundtypes/quarter',
RT_ROUND16 => 'matches/tourmatches/roundtypes/rnd16')
+ array_combine(range(1,21), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,21)));

Cause i need a tournament with 21 rounds, but now "round 16" is overwritten with "round of 16"
How can i fix it? Maybe changing to

$T_ROUNDS = array(
RT_FINAL => 'matches/tourmatches/roundtypes/final',
RT_3RD_PLAYOFF => 'matches/tourmatches/roundtypes/thirdPlayoff',
RT_SEMI => 'matches/tourmatches/roundtypes/semi',
RT_QUARTER => 'matches/tourmatches/roundtypes/quarter',
RT_ROUND16 => 'matches/tourmatches/roundtypes/rndpre16')
+ array_combine(range(1,21), array_strpack("matches/tourmatches/roundtypes/rnd%s", range(1,21)));

But i fear it could corrupt something, plz help :)

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Wed Mar 26, 2014 2:54 pm
by funnyfingers
Did you change the translations file as well?

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Mar 27, 2014 10:55 am
by Aronne320
funnyfingers wrote:Did you change the translations file as well?
yes translation file is good

<tourmatches>
<roundtypes>
<final>Final</final>
<thirdPlayoff>3rd place playoff</thirdPlayoff>
<semi>Semi-finals</semi>
<quarter>Quarter-finals</quarter>
<rnd99>Round of 16</rnd99>
<rnd>Round</rnd>
<rnd1>Round 1</rnd1>
<rnd2>Round 2</rnd2>
<rnd3>Round 3</rnd3>
<rnd4>Round 4</rnd4>
<rnd5>Round 5</rnd5>
<rnd6>Round 6</rnd6>
<rnd7>Round 7</rnd7>
<rnd8>Round 8</rnd8>
<rnd9>Round 9</rnd9>
<rnd10>Round 10</rnd10>
<rnd11>Round 11</rnd11>
<rnd12>Round 12</rnd12>
<rnd13>Round 13</rnd13>
<rnd14>Round 14</rnd14>
<rnd15>Round 15</rnd15>
<rnd16>Round 16</rnd16>
<rnd17>Round 17</rnd17>
<rnd18>Round 18</rnd18>
<rnd19>Round 19</rnd19>
<rnd20>Round 20</rnd20>
<rnd21>Round 21</rnd21>
</roundtypes>

But somehow rnd16 still appear as round of 16

Re: OBBLM - More than 12 Rounds in a Tournament

Posted: Thu Mar 27, 2014 5:55 pm
by funnyfingers
No time to elaborate at the moment, but this touches on the round 16 thing: http://code.google.com/p/obblm/issues/detail?id=629