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.

 

Question about GeoIP country

Question about GeoIP country

Hi,
I want to use
if ( $fromCountryId == "US" ) return 55;
and so for several countries.
but i would like to add something like this:

else if ()return 56; for example ( not sure how to make it right)

My goal is to display different module each country i add above and for the other countries to show one specific module.

Thanks in advance

delxy
Beginner Modder
ranks
useravatar
Offline
8 Posts
Administrator has disabled public posting

Re: Question about GeoIP country

Hi,

your last line can just be:

return 56;

so the entire rule looks like:

if ( $fromCountryId == "US" ) return 55;
if ( $fromCountryId == "CA" ) return 54;
if ( $fromCountryId == "GB" ) return 53;
return 56;


When a "return" statement is used, that stops the PHP code immediately. So if the code was US, CA or GB, it never gets to the last line, so 56 is not returned.

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

Re: Question about GeoIP country

Yes , i get it .

Thanks a lot:)

P.S.
Great support as usual

delxy
Beginner Modder
ranks
useravatar
Offline
8 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10796
Newest User:
mokao3
Members Online:
0
Guests Online:
101

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