I want to create knockout competitions for LeagueSite. Obviously, these would fit into a season and I guess could be classed as a special kind of 'league'. My main thoughts are the following, please input if you have an opinion on this!

Should the user have full control over all the matches and the teams playing in the matches, or are the next matches automatically created when the previous match results are entered? (e.g. two winning teams automatically added to next game)

What about group games? If teams are playing in groups before they play the knockout stages, can people just create leagues for this, or should they be still classed as a tournament? Will creating mini leagues for each tournament just crowd the league listings?

Should tournaments even be in the season, or should they be in their own structure?

Please add helpful opinions on this. I appreciate your help.
Thanks
Alun

Comments

zeezhao’s picture

Came across this, in case it may be useful:

http://drupal.org/project/bracket

Alun’s picture

Status: Active » Postponed

Thanks zeezhao, I've contacted the author of that module and he said he will get an API interface sorted so that I can work with his module. Saves me work, and avoids duplication of functionality :-)
I'll mark as postponed until I hear that the API is all good.

MasterChief’s picture

Status: Postponed » Active

Hello Alun!

As promised I give you my ideas, firstly the integration of the Bracket module would be really great to manage the display of results.

My point of view on the tournaments, the ideal for me is that tournaments are completely independents to leagues, tournaments doesn't belong in a season, they have their own structure, so no link with the leagues.

For groups, they must be part of the tournament, when I speak about groups I mean for example, 4 groups of 4 teams(or players) who battle one time, after 3 games, two participants go to the next step and the tournament switches to single elimination (in this example 8 people are qualified, then 1/4 finals 1/2 finals and finals).

So there are 3 types of tournaments, single elimination tournament, double elimination and tournaments starting with groups and then passing in knockout after qualifying. (In this case we need to make groups and during this phase draw is possible, the goal difference should also be taken in account, it would be good that the table is sorted by rank, so to make the rank we take points in first, then goal difference).

It is also important for me that we can manage not only teams but also tournaments with only single players, this argument is also valid for the alpha 3(the league part). For my part, I see the side purely online, the user have a ID (uid = player_id?), so we can list all the matches made by one person and make statistics and this means of course that the user is logged on the website but it is essential to follow the player up but I will return later on the statistical aspect.

If you have any question don't hesitate, i will answer with pleasure :)

Alun’s picture

Status: Active » Postponed

Hi MasterChief, thanks for your post, I'm glad you like the idea of using Brackets, as I think that will be the fastest, and easiest way to go! In the case of this, the tournaments won't be used inside seasons, so your other concerns are not a problem. I will have to think about how matches are integrated once the API is complete for me to use.

I can see what you mean about single players, not teams. As it looks, you could have a 'team' with one person in it. If the person creates their own 'team' then they can manage their own results in a league. You can obviously change all mentions of 'teams' to 'players' and as far as the presentation of the module goes, no one will know any different.
As for adding UID for actual user accounts into leagues, I would have to think about that more in depth. Its not something I thought would be straightforward, so I would imagine it could take some time to implement.
Statistics is indeed something we can revisit, but I'm pretty sure that we can sort out something for that when the time comes.
Thanks for your input!

PS I'll leave this postponed, as I am waiting for jimbullington, the developer of Brackets to come back to me about an API I can use. Until then, I cannot progress on the knockout competitions!

MasterChief’s picture

It's me again :)

Finally the most important point is the concept of UID whatsoever for leagues or tournaments, I'll give you an example, I would like to profile a user appears the recent matches, and that appears in this view "Match vs. Mr. X (link to this player so the user profile) in League 1 (link to this league) and a link that will take on the match sheet" and then line 2 ""Match vs. Mr. Y (link to this player) in Tournament 1 (link to this tournament) and a link that will take on the match sheet"

janis_lv’s picture

in my case the matches should be auto generated.

thank you for your effort Alun.

MasterChief’s picture

Hi Alun,

i post a message here to know if you will integrate this feature in the alpha 4 release ?

I saw you say that you hope to make the alpha 4 soon and this feature is in the alpha 4 in the leaguesite roadmap, so i ask :)

Do you test the API of jimbullington ?

Thanks for your answer.

Alun’s picture

Hi MasterChief, I'm afraid I haven't looked into it yet, I might have to set it back - I have added so many new features, I might have to work on knockout tournaments for the next release. I know this is not what I was going on for the road map, but it was only a guess. Once I have sorted out the current issues, its my next focus!

MasterChief’s picture

Oki, thanks for your answer and your work :)

Alun’s picture

Hi all
I have started a forum post below to get some discussion going on the integration with bracket.
Your input would be much appreciated!
http://www.drupal.org/node/919066

Alun’s picture

Status: Postponed » Active

As soon as I get my broken laptop files back, I'll be back on track with this!

Alun’s picture

Title: Knockout Competitions » Integration with Bracket

I am working on this again! I will hopefully commit something at the end of the week to give people an idea of whats going on!
Thanks
Alun

MasterChief’s picture

Great!

I will test this update when it will be available :)

Alun’s picture

I added some code yesterday for this, so you can try it out - please backup before updating.
I have added some documentation to go over the basic functions of the module currently, have a look.
Feedback is more than welcome.
Thanks
Alun

Documentation is here:
http://drupal.org/node/947100

MasterChief’s picture

Hi Alun,

i downloaded the last dev version, but i have a problem, when i am going on update.php i have a blank page => update.php?op=info

I tested and i found it's the dev version which do this, so could you fix this ?

I will test when this problem will disapear :)

Alun’s picture

How odd. Any error messages showing?
Make sure you have error displaying turned on in PHP, so you can see the problem.

MasterChief’s picture

Hi again Alun!

Here the error in PHP error log:

PHP Parse error: syntax error, unexpected $end in C:\wamp\www\mysite\sites\all\modules\leaguesite\leaguesite_league\leaguesite.admin.inc on line 555

Alun’s picture

Whoops! This is what happens when I try to do things without my trusty laptop - the file outlined above is missing a bracket at the end!
Literally go to the last line (line 555) and add a curly bracket - } to fix it.
I have committed it too.
Thanks!
Alun

MasterChief’s picture

i have this error message on routing page :

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_league_bracket_route_edit_form' was given in C:\wamp\www\mysite\includes\theme.inc on line 656.

Alun’s picture

Thanks Masterchief, I'll take a look at it - looks like I misnamed it and it should be theme_leaguesite_bracket_route_edit_form
I'll get back to you on this one, I'm not near my computer!
Thanks
Alun

MasterChief’s picture

The error in #19 is still here, thank you for your help :)

the right message is :

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'theme_leaguesite_bracket_route_edit_form' was given in C:\wamp\www\mysite\includes\theme.inc on line 656.

MasterChief’s picture

Did you have found time to check this error Alun or tlaurent ?

tlaurent’s picture

No, sorry, I'm swamped at the moment and I don't know much about Bracket. But if I can find some time, I'll have a look at it.

MasterChief’s picture

Hi Alun and tlaurent!

I hope you will find time to solve this error.

Alun i know Jimbullington will make soon an user/node reference for brackets.

Maybe it can help you to uid integration ?

If you need help to make patches, don't hesitate to ask, i am contributing in another module actually so i learn how to make clean patches and if i am able to fix an issue i could provide patches ready to commit.

Alun’s picture

Hi MasterChief, feel free to submit patches onto issue queues if you can fix an issue, that would be great. Just post them on the issue, and they can be submitted to code by myself or tlaurent.
I am hoping I'll get some time to clear some issues this week and next, but I'm not promising anything just yet!
I'll keep an eye on Bracket and see if I can use UID aswell.
Thanks
Alun

MasterChief’s picture

Hi Alun!

I made a patch for you ready to commit here :

http://drupal.org/node/1069492

I would like to know if you think to know what is making the error in #21.

And i have an idea maybe for uid, you could make maybe a new sub module which let us create a match with 2 opponents with no seasons or brackets, it will be a test and it will be maybe more easy to begin the uid integration.

The idea it's to make a content type like match but with no dependencies which permit to enter results which said who is the winner and the looser, you can select the two members with an username autocomplete field (or another way ?).

Let me know what you think about that :)

MasterChief’s picture

Hi Alun!

Just a message to have some news about the previous post.

Have a good day :)

MasterChief’s picture

Another message to have some news about #26.

I made a patch here ready to commit :

http://drupal.org/node/1069492

MasterChief’s picture

Ok i found another error when you go on players in a match :

* user warning: Unknown column 'leaguesite_player.player_id' in 'field list' query: SELECT node.title, leaguesite_player.player_id, node.nid FROM node LEFT JOIN leaguesite_player ON node.nid = leaguesite_player.nid WHERE node.nid = -1 OR node.nid = -1; in C:\wamp\www\mysite\sites\all\modules\leaguesite\leaguesite_player\leaguesite_player.admin.inc on line 422.
* user warning: Unknown column 'leaguesite_player.player_id' in 'on clause' query: SELECT node.*, leaguesite_player.*, leaguesite_player_team.position, leaguesite_player_team.team_id FROM node LEFT JOIN leaguesite_player ON node.nid = leaguesite_player.nid LEFT JOIN leaguesite_player_team ON leaguesite_player.player_id = leaguesite_player_team.player_id LEFT JOIN leaguesite_relation ON leaguesite_player_team.season_id = leaguesite_relation.sid WHERE leaguesite_relation.relation_id = 7 AND (leaguesite_player_team.team_id = -1 OR leaguesite_player_team.team_id = -1) ORDER BY leaguesite_player.last_name; in C:\wamp\www\mysite\sites\all\modules\leaguesite\leaguesite_player\leaguesite_player.admin.inc on line 428.
* warning: Invalid argument supplied for foreach() in C:\wamp\www\mysite\sites\all\modules\leaguesite\leaguesite_player\leaguesite_player.admin.inc on line 489.

The column player_id doesn't exist in the table leaguesite_player so the error it's normal :)