Hello! I am new to joomla/CB and have just applied a small hack to allow a zipcode radius search to be applied in the context of the 'zipcode' field when someone searches a user list.
I was hoping that someone here could help be implement this as a plugin instead, so that I can better learn the plugin framework.
Here is my current code which I placed immediately after the 'onBeforeUsersListBuildQuery' event is triggered in comprofiler.php around line 1027:
if(strlen($searchVals->zipcode))
{
$zipList = calc_radius($searchVals->zipcode,25);
$tablesWhereSQL = preg_replace('/\(ue\.`zipcode` = \''.$searchVals->zipcode.'\'\)/',
'(ue.`zipcode` IN ('.implode(',',$zipList).'))',
$tablesWhereSQL);
}
Any help is much appreciated!