Sport directory

Anything that doesn't fit in another category

Sport directory

Postby dyoung » Wed Dec 18, 2013 9:31 pm

What is the purpose of the config/sport/ directory with all the sport .php files.
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Sport directory

Postby GregS » Wed Dec 18, 2013 9:55 pm

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.
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm

Re: Sport directory

Postby dyoung » Wed Dec 18, 2013 11:43 pm

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.
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Sport directory

Postby GregS » Thu Dec 19, 2013 12:18 am

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!
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm

Re: Sport directory

Postby dyoung » Thu Dec 19, 2013 9:07 am

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 10343 times
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Sport directory

Postby sulfur » Thu Dec 19, 2013 9:34 am

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.
sulfur
 
Posts: 38
Joined: Fri Nov 08, 2013 3:08 pm
Location: Kingston, ON

Re: Sport directory

Postby GregS » Thu Dec 19, 2013 1:34 pm

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...
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm

Re: Sport directory

Postby dyoung » Thu Dec 19, 2013 3:23 pm

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.
dyoung
 
Posts: 68
Joined: Mon Dec 09, 2013 5:33 pm

Re: Sport directory

Postby GregS » Thu Dec 19, 2013 3:46 pm

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.
GregS
Site Admin
 
Posts: 236
Joined: Thu Jan 06, 2011 4:58 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron