Skip to Content Skip to Menu

'onBeforeUsersListBuildQuery' plugin

  • base64
  • base64
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
15 years 4 months ago #101275 by base64
'onBeforeUsersListBuildQuery' plugin was created by base64
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!B)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum