Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Help with php schedule code
Help with php schedule code
Help with php schedule code
I wrote this php code for the module:
if ( MM_TIME >= 110000 && MM_TIME <= 150000 && MM_DAY_OF_WEEK >=1 && MM_DAY_OF_WEEK <= 5)
return 116;
What I'm trying to do is show module id 116 from 11:00 AM to 3:00 PM from monday to friday. For some reason, it doesn't work.
I'd love some help.
Re: Help with php schedule code
Hi Tom,
At first glance, that should really work.
Can you please check that you have the most recent version of MetaMod installed, as a couple of the recent versions had some errors in time handling.
Then, ensure that you have the right time zone in the dropdown in MetaMod.
One way to check if the time on the server (including time zone calculation) is what you think it is, is to put this in the MetaMod:
echo "The time is " . MM_TIME . " and the day of week is " . MM_DAY_OF_WEEK;
Then take a look at the output in the front end, and see if that's coming up with the right time. e.g 112305 would mean 11:23:05.
Please let me know how you get on,
Stephen
Re: Help with php schedule code
Hello Stephen,
Something really wierd happened.
it said:
The time is 000000 and the day of week is 4
I just tried this.
I'm really sorry for the late response, i thought I would have been notified via email, but when it didn't come i checked it out.
Re: Help with php schedule code
Hi - glad you got this working. I have done some work on this recently which is why there was a fix in the most recent version of MetaMod.
Best regards,
Stephen
Re: Help with php schedule code
Hi allvisualweb,
If you are wanting to simply have different modules appearing at different times of the day, then check out this page for some recipes of how to do it:
http://www.metamodpro.com/metamod/recip … time-rules
You can set the time zone to be used in the MetaMod - there's a dropdown for it. The time zones include Daylight Savings (Summer Time).
If you want the page to automatically refresh at certain times of the day, then that's a different matter. There's some discussion of this on another thread:
http://www.metamodpro.com/forums/topic?id=438
However, there is no existing solution for this (and I am not going to create one myself), so it will have to wait for someone who is good at JS to write it. There are some clues about how to approach it in that last thread.
Hope that helps,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Help with php schedule code
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Posts this week:
- 2
- User Info:
- Total Users:
- 7642
- Newest User:
- mary26
- Members Online:
- 0
- Guests Online:
- 153
- 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