Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Question about GeoIP country
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
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
- Index
- » MetaMod
- » MetaMod General Support
- » Question about GeoIP country
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Posts this week:
- 2
- User Info:
- Total Users:
- 7643
- Newest User:
- ulmer60661
- Members Online:
- 1
- Guests Online:
- 141
- Online:
- ulmer60661
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked