Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    187
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Sorting users by Location

    I'm not even sure where to begin with this, but maybe someone can point me in the right direction. Our website has a number of registered users who fill out their location "city/country" and we have a "Members" page that lists everyone. What we would like to do is simply sort this list so that if you login from "Nashville, TN" it will show you other users from there, and then from nearby locations/cities...

    How exactly would one go about doing this... do we need to capture IP addresses and then reference somehow??

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    fill out their location "city/country"
    Kinda says your in Europe. In which case you should have a state column for people from the USA. Then to find people close to a new registered user search for city or country and display them as really close people. If you do the state, you can search on that, exclude the city and display as not so close and alphabetize. If you want to list by distance you will need to get Lon/Lat for every location and do Math.

    FYI: My IP puts me 250 miles away from where I really am.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •