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.

 

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.

tom123
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

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

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

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.

tom123
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Help with php schedule code

I thought I might as well give more info. The time zone I selected is "antigua" (my target country) and I use metamod version 2.8b.

I hope this helps.

tom123
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Help with php schedule code

Hello metamodguy,
I upgraded to the latest version, and abualla, now it says:

The time is 185554 and the day of week is 2

I believe it will work okay now. thank you for the great support! definitely gonna + metamod on joomla.

tom123
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

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

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

Re: Help with php schedule code

Hi, metamodguy
I would be able to update (refresh) the time module in the server automatically at certain times, including time zone.

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

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

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

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5933
Posts this week:
3
User Info:
 
Total Users:
4401
Newest User:
jason59312
Members Online:
0
Guests Online:
181

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