Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.


sregisters
Beginner Modder
ranks
useravatar
User Info

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!


Administrator has disabled public posting
metamodguy
useravatar
User Info

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

Administrator has disabled public posting
bajed15
Beginner Modder
ranks
useravatar
User Info

Re: display content based on visitors location

oh thanks.


Administrator has disabled public posting
lindamegasun
Beginner Modder
ranks
useravatar
User Info

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


Administrator has disabled public posting
IamJim
Beginner Modder
ranks
useravatar
User Info

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


Administrator has disabled public posting
metamodguy
useravatar
User Info

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

Administrator has disabled public posting

Board Info

Board Stats:   Total Users: 3088  Total Topics: 1195  Total Polls: 7  Total Posts: 4450  Total Posts Today: 2
User Info:   Newest User :  timothy.brown2@gmail.com   Members Online: 1   Guests Online: 70
Online 
Jeff78
Topic
New
Locked
Topic
New
Locked
Sticky
Active
New/Active
Sticky
Active
New/Active
New/Closed
New Sticky
Closed/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky Active Locked
Active/Sticky
Sticky/Locked
Sticky/Active/Locked