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.

 

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 05:27:12

swimman13
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

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

Hi,

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

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
Total Posts Today:
1
User Info:
 
Total Users:
10075
Newest User:
rsker57
Members Online:
0
Guests Online:
255

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