Remove 'Keyword' from Events Search

Hello there,

I'm trying to remove the Keyword search in Events (image attached), so that user will only search by country (drop-down menu). I read that this is a database thing, but couldn't find the solution. Please help.

 

Many thanks. 

Events - keyword.JPG · 13K · 206 views
Quote · 9 Jan 2018

/modules/boonex/events/classes/BxEventsFormSearch.php

 

code line 35-ish :

 

'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',

                    ),

                ),

You can set 'required' to false  and 'type' to hidden i think it is and it should go away  or just comment out that block of code...   

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 9 Jan 2018

Thanks for your quick response. I changed the 'required' to false, and the red asterisk went away; I also changed 'type' to hidden and 'Keyword' disappeared completely, which is fine, however, with a Country only search it didn't produce any results. So with Keyword results are produced, but not without it Frown

I have 'Events calendar version 2.0.1 by AndrewP' installed; not sure if that is causing some interference.

 

Thanks again.

 

Quote · 9 Jan 2018

change 'type' back to 'text' and 'required' back to 'true' and just comment out the block of code (see orange text below)...  just tried it on my version and it works with just country...

 

/* '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',

                    ),

                ), */

https://dolphin-techs.com - Skype: Dolphin Techs
Quote · 10 Jan 2018

Hello guys!

 

For proper work of search without kyeword also is better to change this line in modules/boonex/events/classes/BxEventsModule.php

 

$o = new BxEventsSearchResult('search', $oForm->getCleanValue('Keyword'), $oForm->getCleanValue('Country'));

 

to following one:

 

$o = new BxEventsSearchResult('search', '', $oForm->getCleanValue('Country'));

 

With the best regards, Leonid

Quote · 10 Jan 2018

Thanks both for your help. Problem solved! Just as an FYI: In addition to changing 'required' => true, to  'required' => false, I had to remove the 'checker' portion (example below).

 

'checker' => array (

                        'func' => 'preg',

                        'params' => array('/^[a-zA-Z]{0,2}$/'),

                        'error' => _t ('_bx_events_err_country'),

                    ),

Quote · 10 Jan 2018
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.