Page 1 of 1

Sport directory

Posted: Wed Dec 18, 2013 9:31 pm
by dyoung
What is the purpose of the config/sport/ directory with all the sport .php files.

Re: Sport directory

Posted: Wed Dec 18, 2013 9:55 pm
by GregS
The various files in there tell the system how to handle different sports. For example, you play Ultimate on a field, soccer on a pitch, hockey on a rink, baseball on a diamond, basketball on a court, etc., and each sport has its own list of positions.

At the moment, Zuluru only really supports one sport at a time, which you set by changing "ultimate" to the sport you want in config/options.php (or, better, by creating config/options_custom.php with something like this in it:

Code: Select all

$config['options']['sport'] = make_human_options(array(
        'soccer',
));
The valid options are any of the sports supported in the config/sport directory. If you've already created leagues without changing this, they are probably recorded as "ultimate", which you can change either directly in the database, or by editing and saving them (with no changes) after making this "options" change.

A future revision will bring full support for sites to run multiple sports at the same time. If you're thinking of adding more sports, there's more to it than just adding this one file, though; get in touch with me for details if that's your goal.

Re: Sport directory

Posted: Wed Dec 18, 2013 11:43 pm
by dyoung
So if I did a fresh install, to see how this works. Before I go to zuluru/install I should do the following:

I would create the options_custom.php file like you suggested. In my case, basketball, I would change your example from soccer to basketball.

I did this and I don't see much of a change. I am also looking to change "Fields" to "Courts" in the selection block.

Also, "ultimate" is still prevelent in schema/data/stat_types_data.php. Just wondering where I can changes thing over to basketball.

Re: Sport directory

Posted: Thu Dec 19, 2013 12:18 am
by GregS
No need to do a fresh install for this. Just add options_custom.php with basketball in it, then edit and save any leagues you've already created. The league edit page includes a field for setting the sport, but when there's only one option it gets hidden and set to that option, so editing and re-saving will update the sport from ultimate to basketball in all of your leagues. Everything else, including the word used in place of "field" will automatically change to match.

There's lots of ultimate references in stat_types_data, but lots of basketball references too, so that's fine!

Re: Sport directory

Posted: Thu Dec 19, 2013 9:07 am
by dyoung
I see that it changed the database and I see where the player positions have changed. In the selection box it still says "Fields". Just wondering what I missed.
basketball.png
basketball.png (33.87 KiB) Viewed 65063 times

Re: Sport directory

Posted: Thu Dec 19, 2013 9:34 am
by sulfur
dyoung wrote:I see that it changed the database and I see where the player positions have changed. In the selection box it still says "Fields". Just wondering what I missed.
I don't believe that menu item is affected by the sport change. It's other bits that are affected elsewhere. It might be better to name that one "Facilities", but I can see the logic behind "Fields". The issue there is that with multi-sport environments, it gets a bit tough to name that thing consistently and properly across the board.

Re: Sport directory

Posted: Thu Dec 19, 2013 1:34 pm
by GregS
Ah, forgot one thing. In config/install.php, change the $field value right near the bottom to 'court'. The variable does still need to be named $field, though, and the $config['ui'] settings right after that don't need to change at all. Sulfur is right that this is going to be tricky to make work well in a true multi-sport environment. And "facility" is the name already in use for a place that might have multiple fields (or courts or whatever), so that's not an option...

Re: Sport directory

Posted: Thu Dec 19, 2013 3:23 pm
by dyoung
As facility is already used, other options would be "Location", "Venue" or "Place".
Just some generic suggestions.

Made the change and thanks, it was exactly what I was looking for.

Re: Sport directory

Posted: Thu Dec 19, 2013 3:46 pm
by GregS
Yeah, I might have to resort to "location" as the generic term in the case of multi-sport systems, but for single-sport sites (which I expect will always be the majority), I think allowing it to be set this way improves the "understandability" of the site for new and casual members.