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.

 

[solved] JomGenius Params in Chameleon???

[solved] JomGenius Params in Chameleon???

Hi,

I installed Chameleon on Joomla 3.2.

How can I use Chameleon like JomGenius?
For example:
if ($core_genius->inTimeSpan( "mon; wed; fri") )echo "It's either Mon, Wed or Fri";
etc. etc.

I want to use Chameleon in my custom extensions. I want to 'do stuff' when a visitor comes from outside The Netherlands for example.

Please let me know...

Regards,

Gosling

Edited By: metamodguy
21-Nov-13 20:24:05

goslingcools
Beginner Modder
ranks
useravatar
Offline
5 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] JomGenius Params in Chameleon???

Hi Gosling,

you can use JomGenius by including the JomGenius Class, then instantiating the different geniuses (genii???)

e.g.

include_once JPATH_SITE . '/components/com_chameleon/JomGenius.class.php';
$core_genius = JomGenius("core");
// and/or any of the following that you want to use:
$content_genius = JomGenius("content");
$menu_genius = JomGenius("menu");
$k2 = JomGenius("k2");
$vm = JomGenius("virtuemart");
$hs = JomGenius("hikashop");


Note however that the GeoIP functions are not exposed through JomGenius. What you might want to do is use the PHP fields in the Succeed and Fail actions to set global variables, then in other code you check for the presence of these global variables to do things.

e.g. in a Succeed action:

global $visitor_country;
$visitor_country = $fromCountryId; // make sure you enable GeoIP in this rule, of course

Then in your own extension you can use it like this:

global $visitor_country;
if ($visitor_country != 'NL') {
// do something
}

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

Re: [solved] JomGenius Params in Chameleon???

Thanks Stephen!

goslingcools
Beginner Modder
ranks
useravatar
Offline
5 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1685
Total Polls:
6
Total Posts:
5940
Total Posts Today:
1
User Info:
 
Total Users:
5186
Newest User:
Totosite
Members Online:
0
Guests Online:
123

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