DeeEmm

Pragmatism in code

Waxing lyrical about life the universe and everything software related since lunchtime 2006.

Dolphin - Add search by country to Groups

To add an extra search field to your groups - for example 'Country' do the following.

Edit

/modules/boonex/groups/classes/BxGroupsFormSearch.php

Find

$aCategories = $oCategories->getCategoriesList('bx_groups', (int)$iProfileId, true);

Add After

$aCountries = $oProfileFields->convertValues4Input('#!Country');        
$oProfileFields = new BxDolProfileFields(0);

Find

'inputs' => array(
'Keyword' => array(
'type' => 'text',
'name' => 'Keyword',
'caption' => _t('_bx_events_caption_keyword'),
'required' => true,
'checker' => array (
'func' => 'length',
'params' => array(3,100),
'error' => _t ('_bx_events_err_keyword'),
),
'db' => array (
'pass' => 'Xss',
),
),

Add After

'Country' => array(
'type' => 'select_box',
'name' => 'Country',
'caption' => _t('_bx_groups_caption_country'),
'values' => $aCountries,
'required' => true,
'checker' => array (
'func' => 'preg',
'params' => array('/^[a-zA-Z]{0,2}$/'),
'error' => _t ('_bx_groups_err_country'),
),
'db' => array (
'pass' => 'Preg',
'params' => array('/([a-zA-Z]{0,2})/'),
),
),

Add the following language keys -

_bx_groups_caption_country -> 'Country'

_bx_groups_err_country -> 'please specify country'

The same principle applies to any predefined lists, but an additional modification will need to be made to BxEventSearchResults.php to process the new search field.

/DM

Dolphin - Show Group / Events latest forum posts
Dolphin - Hide custom pages from non-members

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Guest
Wednesday, 13 December 2017
If you'd like to register, please fill in the username, password and name fields.

Captcha Image