WSN Knowledge Base https://scripts.webmastersite.net/wsnkb/manual en-us User Choice Between Miles and Kilometers How to let people choose which units to search in. https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/user-choice-between-miles-and-kilometers-633.html Wed, 07 May 2014 21:44:43 GMT https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/user-choice-between-miles-and-kilometers-633.html
<select name="mikm"><option value="miles">miles</option><option value="kilometers">kilometers</option></select>
]]>
Localization Overview How to make everything follow local custom. https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/localization-overview-608.html Wed, 12 Mar 2014 01:02:46 GMT https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/localization-overview-608.html At Admin Panel -> Settings -> Localization you have a variety of options to localize your site.

Date and time: Set the default timezone, the names of allowed timezones, the date formats and whether to use daylight saving time.

Money: Choose the currency symbol and three letter ISO currency code for the primary currency, and whether to offer additional alternate currencies.

Numbers: Choose the thousands separator and decimal seprator for formatted numbers.

Places: Choose geolocation, either IP-based or browser-based. Choose which countries to allow people to select, the default country, and the states/provinces for the default country. Also choose between miles and kilometers.

]]>
Local Maps How to display a map of local articles. https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/local-maps-576.html Sat, 14 Jul 2012 07:40:28 GMT https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/local-maps-576.html geolocation loaded, you can do this just by placing {FUNC_MAKELOCALMAP} somewhere in a template at Admin -> Themes -> Manage Templates.

That's the simple case, but there are lots of ways you may want to tweak the appearance or function of the map. You can do so by passing parameters:
{FUNC_MAKELOCALMAP[width <,> height <,> distance <,> location <,> cutoff]}
Width and height are the pixel size of the map -- default is 500 width 300 height. The distance parameter is the number of miles (or kilometers depending on localization settings) the article has to be within (note that the distance is computed from a specific latitude and longitude within the city, not from city limits, so you must set a distance at least as large as the radius of the city in order to get all articles within the city displayed). Location can be a city name but defaults to visitorlocation which uses the city the viewer is in. Cutoff is the maximum number of map pins to show, which is 500 by default (showing too many can lead to memory errors or timeouts).

Here's an example of a 700x350px map of 100 articles within 10 miles of San Francisco:
{FUNC_MAKELOCALMAP[700 <,> 350 <,> 10 <,> San Francisco, California, United States <,> 100]}


You can also use conditionals for fallback maps, although this can get very slow and server-intensive... example:
<IF {FUNC_HASLOCALMAPBOOL[10 <,> visitorlocation]}>{FUNC_MAKELOCALMAP[500 <,> 300 <,> 10]}<ELSE>{FUNC_MAKELOCALMAP[500 <,> 300 <,> 10 <,> San Jose, California, United States <,> 100]}</IF>


The {FUNC_HASLOCALMAPBOOL[10 <,> visitorlocation]} is a shorthand that sets the cutoff to 1 so that not so much time/memory/cpu is wasted checking if a pin exists on the map.]]>
State Selectors Using state selectors for as many countries as you want. https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/state-selectors-566.html Mon, 28 Nov 2011 10:33:28 GMT https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/state-selectors-566.html
In some cases, you want to have selectors for the states of multiple different countries. You can set this up in the tweaks.php file. Just add this in your tweaks file:

$secondarystatescountry[0] = 'Canada';
$secondarystateslist[0] = '
British Columbia
Alberta
...';
$secondarystatescountry[1] = 'Mexico';
$secondarystateslist[1] = '
Baja California
...';


Increment the array index to do as many countries as you want. Write one state name per line. By leaving the first line blank, you ensure there's no default selection.]]>
Geolocation Using a geolocation database. https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/geolocation-542.html Fri, 08 Oct 2010 15:55:47 GMT https://scripts.webmastersite.net/wsnkb/manual/localization-and-mapping/geolocation-542.html
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 articles 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/]]>