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.

 

Showing login module only in own country - not working

Showing login module only in own country - not working

Joomla: 2.5.20
MetaMod: v1.6.0


Unable to show the login module only for my country:
I want to show the fronend login module (position: superlogin; shown on all pages) only to users in one country: 'SG'.

What I have done:
Set metamod to postion 'superlogin' (same as the login module)
In Adv. Module Manager, did not assign the published login module to any menu; and postion is 'superlogin'.
Downloaded from MaxMind the free version of GeoIP and added it to domainroot/geoip.

To test, I did this in Metamod:
GeoIP > 'Only these countries' set to US (without quotes; I'm not in the US, so login mod should not show for me).
PHP, added this:      if ( $fromCountryId == "US" ) return "268";    (where 268 is login module id; it is in double quotes)
Rest of the settings are default for metamod.

When I refreshed the site, the login module still shows for me in SG.
If it had worked, I would have replaced "US" on those two settings above to SG.

What am I doing wrong?

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

Re: Showing login module only in own country - not working

Hi gurdip,

sorry for the delayed reply on this.

There are 3 things I would check:
1 - ensure that in the MetaMod parameters you select "Enable GeoIP/GeoCity: GeoLiteCity (free)"
2 - if you want to do a simple country select, you don't need to enter any PHP. Just enter US into the "only these countries" box, and put the target module id into the "Quick module id or position include" box. Wipe out all the contents of the PHP box.
3 - If it's not (1) or (2), I wonder if it's a strange interaction with Advanced Module Manager? Instead of having the MetaMod and the "target" module both set to the "superlogin" module position, try altering the target module to be in a fake module position "superadmin-metamod". This will ensure that it does not show up unless/until the MetaMod displays it.

I expect that one of those will fix it!

It's also theoretically possible that your IP address is actually resolving as a US IP address. We can check that too as a last resort.

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
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5914
Total Posts Today:
1
User Info:
 
Total Users:
10816
Newest User:
sakmy567q
Members Online:
0
Guests Online:
159

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