Support

  1. sergio0187
  2. General
  3. Saturday, February 16 2019, 11:34 AM
  4.  Subscribe via email
Hi,

Is it possible to search by place and if place itself isn't found that it will give results of people around the entered place?

Kind regards
Accepted Answer
admin Accepted Answer
Admin
Hi,
unfortunately we have not tested previous changes, now I have made some modification to the code at file gmap.php and now seems to work.

$fields = array('locatie_voor_verwijslijst','locatie_2','locatie_3'); /* Change the strings alias1, alias2 and alias3 with alias of your Google map fields */
$where = array();
foreach ($fields as $f){
$where[] = '( '.$const.' * acos( cos( radians('.JFactory::getApplication()->input->get($field->alias.'_lat',null,'raw').') ) * cos( radians( b.'.$db->quoteName($f.'_lat').' ) ) * cos( radians( b.'.$db->quoteName($f.'_lng').' ) - radians('.JFactory::getApplication()->input->get($field->alias.'_lng',null,'raw').') ) + sin( radians('.JFactory::getApplication()->input->get($field->alias.'_lat',null,'raw').') ) * sin( radians( b.'.$db->quoteName($f.'_lat').' ) ) ) ) < '.$radius;
}
$query->where('('.implode(' OR ',$where).')');
admin Accepted Answer
Admin
Hi,
sorry for late reply, it's a weekend :D

Easy Profile allow you to search for locations into Google Maps fields's types, you can see an example at https://www.easy-profile.com/users-list.html (address field).

It allow you to search for users in an area around the specified address (Radius)
  1. more than a month ago
  2. General
  3. # 1
sergio0187 Accepted Answer
Pro
Thank you for support and this is exactly what I need!

I use the Easyprofile Search and Map module on this page:
https://www.vhyp.be/hypnotherapeuten

How can I add that radius field?

Kind regards
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
you need to make searchable and available in search form the Google Maps field, "Plaats" seems a simple text type.
  1. more than a month ago
  2. General
  3. # 3
sergio0187 Accepted Answer
Pro
Hi, thanks for your help!

So do I need to change all the place text fields to Google Maps field?
https://www.screencast.com/t/5vK5ijvBw

These fields already have values from users, is it possible to change this field type afterwards?

Thanks again.

Kind regards
  1. more than a month ago
  2. General
  3. # 4
admin Accepted Answer
Admin
So do I need to change all the place text fields to Google Maps field?
No, from your user list page I can see that you already have a field of type Google Map with alias "locatie_voor_verwijslijst". You should set this field to be searchable in the your search module.

These fields already have values from users, is it possible to change this field type afterwards?
No, this is not possible.
  1. more than a month ago
  2. General
  3. # 5
sergio0187 Accepted Answer
Pro
Thanks.

Some users have 3 locations of their company. Can I have it so it can search in three location fields in one time?
  1. more than a month ago
  2. General
  3. # 6
admin Accepted Answer
Admin
Sorry this is not possible without some code change :(
  1. more than a month ago
  2. General
  3. # 7
sergio0187 Accepted Answer
Pro
And can I hire you for custom code :) ?
  1. more than a month ago
  2. General
  3. # 8
admin Accepted Answer
Admin
Hi,
no problem, it is very easy for us.

In file /administrator/components/com_jsn/helpers/fields/gmap.php at line 304 replace this:
$query->where('( '.$const.' * acos( cos( radians('.JFactory::getApplication()->input->get($field->alias.'_lat',null,'raw').') ) * cos( radians( b.'.$db->quoteName($field->alias.'_lat').' ) ) * cos( radians( b.'.$db->quoteName($field->alias.'_lng').' ) - radians('.JFactory::getApplication()->input->get($field->alias.'_lng',null,'raw').') ) + sin( radians('.JFactory::getApplication()->input->get($field->alias.'_lat',null,'raw').') ) * sin( radians( b.'.$db->quoteName($field->alias.'_lat').' ) ) ) ) < '.$radius);
with this
$fields = array('alias1','alias2','alias3'); /* Change the strings alias1, alias2 and alias3 with alias of your Google map fields */
$where = array();
foreach ($fields as $f){
$where[] = '(( '.$const.' * acos( cos( radians('.JFactory::getApplication()->input->get($f.'_lat',null,'raw').') ) * cos( radians( b.'.$db->quoteName($f.'_lat').' ) ) * cos( radians( b.'.$db->quoteName($f.'_lng').' ) - radians('.JFactory::getApplication()->input->get($f.'_lng',null,'raw').') ) + sin( radians('.JFactory::getApplication()->input->get($f.'_lat',null,'raw').') ) * sin( radians( b.'.$db->quoteName($f.'_lat').' ) ) ) ) < '.$radius.')';
}
$query->where(implode(' OR ',$where));


NOTE: You need to apply this patch every Easy Profile update. This code is not tested and not supported.
  1. more than a month ago
  2. General
  3. # 9
sergio0187 Accepted Answer
Pro
Hi,
Thank you so much.
I have entered the custom code, but now it can't search anymore.
Attached you find the code entered and also a screenshot of the aliases.

In site details you also find login credentials if you need to check.

Thank you in advance for help.

Kind regards
References
  1. The page to test is: https://www.vhyp.be/hypnotherapeuten
  1. 3 weeks ago
  2. General
  3. # 10
sergio0187 Accepted Answer
Pro
And hereby the screenshots I refered to.
Attachments (2)
  1. 3 weeks ago
  2. General
  3. # 11
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy ProfileĀ® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.