Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Display visitor city
Display visitor city
Re: Display visitor city
Hi Laurent,
yes, you could do this in MetaMod this way:
1 - first make sure you download the GeoLiteCity database and install it
2 - in the MetaMod module make sure you indicate "Enable GeoIP/GeoCity: GeoLite City (free)"
3 - enter the following PHP code in the MetaMod:
$city = $geoip->city;
if ($city != '') echo "Obtenez un devis gratuit d'artisans proche de $city";
I've included a test in there to be certain that GeoLiteCity actually comes up with a city name. In many cases it doesn't, as the library is not particularly accurate in determining city names. So whenever it does come up with one, then it will display the entire message.
Hope that helps,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Display visitor city
Board Info
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked