< Back to Localization and Mapping
Geolocation
Geolocation allows you to detect your visitor's physical location and show them listings near where they are, via a location-based toplist or via the search box (which will list their guessed location as the default for distance searches). The IP geolocation can also set the user's timezone, and both geolocation methods will autoselect the appropriate country name on the submit listing page. There are three ways to do geolocation in WSN.
Standard method: Since 7.0.0, WSN can load the free
MaxMind GeoIP Lite database to provide city-level geolocation.* Just keep the geolocation box checked during installation to load it. If you didn't select it during installation, you can install it by going to YourAdminPanelURL/loaddata.php?filled=1&datasource[1]=geosql&dataindex=1&part=0 . Maxmind's geolocation determines location based on the visitor's IP address, and is usually accurate to the nearest big city within 25 miles, and almost always at least accurate to the country level. The distance search (if you've enabled distance range searching on your switches page) will pre-fill with location of the user, and submissions awaiting validation will list the city of the submitter with a national flag. You will be able to ban members by location as well, blocking a whole city when desired. It also detects the visitor's timezone so that everything on your site is shown in the local time of the person viewing the page. You can also create any localized toplists you wish to create at Admin Panel -> Themes -> Toplist Generator (this can be especially useful for targeting listings in a business directory to show them to nearby people). Finally, you'll also be able to use the template variable {THISMEMBERIPLOCATION} to display the location of the viewer in text wherever you wish.
Approximately monthly, the geolocation data is updated. To be sure you have the latest data you can download
http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz , extract the gz to a .dat file, and rename it to GeoIP.dat before uploading to your /schemas/ subdirectory. You can also get a correctly-named .dat from
http://www.wsnforum.com/data/geoipdat/GeoIP.dat but that is likely to be older.
Mobile method: Smartphone web apps may request the exact current location of the user down the street level using browser geolocation (Admin Panel -> Settings -> Switches -> Browser geolocation). The user's browser will prompt them to accept or deny the location request. Do not use this with a non-mobile audience, as it will annoy them without providing information any more accurate than the standard method!
* Legal note: This product includes GeoLite data created by MaxMind, available from
http://maxmind.com/