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.

 

Show template based on IP address

Show template based on IP address

Hi there,

Is it possible to show templates based on IP address instead of geoip? I am testing a template on a production site and I don't want to bother my visitors.

Thanx in advance.

Regards,
Chris

chrischris2005
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Show template based on IP address

Hello? Anyone?

chrischris2005
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Show template based on IP address

Hi Chris,

yes, that's easy to do. Check out the JomGenius documentation for the "core genius" and the things it knows about...

In a nutshell, you can do this:

if ($core_genius->check("clientip = 123.45.67.89")) return true;

Then set the template to be used from the dropdown in the SUCCEED action.

If you want to check for all addresses in a range, you can change it to this:

if ($core_genius->check("clientip starts with 123.45.67.")) return true;

Or, if you have several discrete addresses to check for, use this (add as many to the list as you like):

if ($core_genius->check("clientip = 123.45.67.89, 123.45.67.111")) return true;


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

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10113
Newest User:
michael2066
Members Online:
1
Guests Online:
285

Online: 
michael2066

Forum Legend:

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