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

ombeletw’s picture

I 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.

corriepotter’s picture

Watching... 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.

pstead’s picture

As I'm aware, you have to input the standings manually. There is no statistical function included in the module, which is a great shame.

joshicsin’s picture

Is there any progress in this regard?
I want to use the same for my site.

Regards.

repoman’s picture

So 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.

joshicsin’s picture

I 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.

spidey121’s picture

A 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