Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » [solved] JomGenius Params in...
[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
21-Nov-13 21:24:05
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
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » [solved] JomGenius Params in...
Board Info
- Board Stats:
- Total Topics:
- 1693
- Total Polls:
- 6
- Total Posts:
- 5958
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 7842
- Newest User:
- seitz70123
- Members Online:
- 0
- Guests Online:
- 180
- 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