Active
Project:
Sports Club Management
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2010 at 04:18 UTC
Updated:
10 Sep 2011 at 07:11 UTC
What is the process for adding new sport types? I am interested in building a youth baseball league site with your module. I think it has a lot of potential. Is it as easy as modifying an existing sport.inc file with baseball terms, or is there some magic to it?
Thanks for the help,
Jason
Comments
Comment #1
ombeletw commentedI would assume the first place to look is the sport module (sport_core.module) and adding an inc file as you said.
I'm trying to achieve the same, let me know how it works out. Good luck.
Comment #2
corriepotter commentedWatching... Doing the same thing. I added curling to the sport_core.module
function sport_core_sport_types() {
return array(
'basketball' => t('Basketball'),
'floorball' => t('Floorball'),
'football' => t('Football'),
'icehockey' => t('Ice Hockey'),
'rugby' => t('Rugby'),
'soccer' => t('Soccer'),
'volleyball' => t('Volleyball'),
'curling' => t('Curling'),
);
}
And created a include file called curling.inc and it looks like this
<?php
// $Id: curling.inc,v 1.1.2.2 2009/10/11 20:42:18 roetzi Exp $
/**
* @file
* Information for Curling
*/
function sport_core_type_curling() {
return array(
'team role function' => 'sport_core_curling_roles',
'staff role function' => 'sport_core_default_staff_roles',
'result parse function' => 'sport_core_default_result_parse',
'result display function' => 'sport_core_default_result_display',
);
}
function sport_core_curling_roles() {
return array(
'skip' => t('Skip'),
'vice-skip' => t('Vice Skip'),
'second' => t('Second'),
'lead' => t('Lead'),
'alternate' => t('Alternate'),
);
}
The only thing that I cannot get to work is the Standings. For some reason it does not add up the wins and losses.
Comment #3
pstead commentedAs I'm aware, you have to input the standings manually. There is no statistical function included in the module, which is a great shame.
Comment #4
joshicsinIs there any progress in this regard?
I want to use the same for my site.
Regards.
Comment #5
repoman commentedSo are you looking for the sports to be added via the UI then? I only ask because doing it via the code is fairly simple.
Comment #6
joshicsinI believe its fairly simple for any Drupal developer and they actually love to do that way. But think about those who can only administer the site. I was ended up with disabling all the sport types and added the one I wanted. I then make all the sport selection fields read only. This way I did not have to make the user to select that only sport.
Regards.
Comment #7
spidey121 commentedA sport that is being used widely that allows a wide variety of fighting techniques and skills, from a mixture of other combat sports.
mma fights