Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


Switching two moduels in the same postion based on time of day

Switching two moduels in the same postion based on time of day

I need a receipt to switch two modules based on the time of day as follows.  Both need to display in the same showcase position.

09:00 - 20:00 display modID 123 -  Open for Business
20:00 - 09:00 display modID 456 - After Hours

The problem is the second module comes back with end time has passed via debug.  So far I have only tried using the quick start approach as I'm not a wiz at php coding.

Edited By: swimman13
12-Apr-13 04:27:12

Beginner Modder
1 Posts
Administrator has disabled public posting

Re: Switching two moduels in the same postion based on time of day


I'd like to suggest the PHP approach as it's more precise - and I trust you'll understand how it works.

Try this:

if ($core_genius->inTimeSpan("09:00:00 - 20:00:00")) return 123;
if ($core_genius->inTimeSpan("20:00:00 - 09:00:00")) return 456;

or this one, even easier:

if ($core_genius->inTimeSpan("09:00:00 - 20:00:00")) return 123;
else return 456;

The reason you can't do this so easily with the start time and stop time boxes is that you can't specify which module will be used as an alternative, if you are NOT in the time zone.

Also, please bear in mind that if you use caching on your page, this may stop the changed page from appearing. So you'll need to turn off the caching in the module, and not use the "system - cache" plugin.

Lastly, ensure that you have the correct time zone set in the dropdown in MetaMod.

Best regards,

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

3319 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Posts this week:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

Forum Legend:

 New Sticky