Tagged: buddypress location based search
I want to create a location based search in buddypress for members by just putting location like “Alabama” in the menu and when clicked, the search should come out as members from Alabama only. Can anyone help?
Hi Vineeta,
Welcome to BuddyDev Forum. Please explain me bit more. Tell me what exactly you want.
1. Will it be a simple text based search to find the members under a particular location. If Yes it can be done easily.
2. Will it be a search based on location such as geo location to find out the member with in the certain range. If yes then it would be a strategical job and will take time.Please let me know. What exactly your requirement is?.
Thank You
RaviYes, I need to do both kinds of searc. Geo location based is also needed. How to do it?
thanksHi Vineeta,
In that case please think about this:-
1. How do you want to collect user location data?
2. Do you want to store the location as lat/lang pair or as spatial data type. MySQL dos have support for basic gis functionality/spatial data types, so you should create a new table and store user/point combination there. The Point is spatial data type and you will be storing WKT here.3. If you have used the data type point, you may use spatial functions ST_DWithin/ST_Distance to accomplish your task.
https://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.htmlIf you are not comfortable with GIS data, you may store the user location as latitude/longitude pair. This tutorial (It is old when mysql had no support for spatial data types), by Google should help
https://developers.google.com/maps/articles/phpsqlsearch_v3
All the best
Brajesh
You must be logged in to reply to this topic.