Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

display content based on visitors location

display content based on visitors location

Hello,
I am trying to test following php code in your MetaMod to display specific joomla module based on visitors location However it does not work. Please suggest.

switch ( $fromCountryId ) {
  case 'US': return 101; // module 101 for USA
  case 'CA': return 102; // module 102 for Canada
  case 'GB': return 103; // module 103 for United Kingdom
}

Thanks!

sregisters
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: display content based on visitors location

Hi sregisters,

have you done the following:

1 - downloaded the latest GeoIP database from Maxmind
2 - unzipped it
3 - placed the GeoIP.dat file into a folder called "geoip" at the root level of your web folder
4 - used the radio button in MetaMod form field "Enable GeoIP/GeoCity" to select "GeoIP Country (free or commercial)"

Also, try turning on advanced debug mode in your MetaMod. This should show what country it thinks you are in, and this may help to diagnose what's going on.

In the example you quote, you need to change 101, 102 and 103 for the actual module ids that you want to display for those countries.

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Re: display content based on visitors location

oh thanks.

bajed15
Beginner Modder
ranks
useravatar
Offline
1 Posts
User info in posts
Administrator has disabled public posting

Re: display content based on visitors location

metamodguy, thanks for your reply man!! I am also facing with the same problem, your solution will help me a lot!!

swimming goggles

lindamegasun
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: display content based on visitors location

Hello Stephen,

I purchased Pro and Chameleon 3 weeks ago and just having tome to try the. 

I am getting ready to download now, but not sure which one please?

http://www.maxmind.com/en/geolocation_landing

Jim

IamJim
Beginner Modder
ranks
useravatar
Offline
7 Posts
User info in posts
Administrator has disabled public posting

Re: display content based on visitors location

Hi Jim,

since you have Chameleon, you can use the GUI controls in Chameleon to manage the GeoIP databases. Both MetaMod and Chameleon will use the same database. So depending on which you want to use, click on the buttons in the configuration screen in Chameleon to download the GeoLiteCIty or GeoLiteCountry database. If you only need to use countries, use the Country database.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3328 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4421
Newest User:
rajajudi14
Members Online:
0
Guests Online:
93

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked