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.

 

Show/hide module depending on hour

Show/hide module depending on hour

Hello there,

I use joomla 3.5.x and Virtuemart 3.

I want to show/hide a module after a specific hour (I have to use GMT+2 for hours because clients buy from Greece only).

Is this possible somehow?

Thank you in advance

pm4698
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: Show/hide module depending on hour

Any ideas on this??

pm4698
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: Show/hide module depending on hour

Hi,

yes, it's quite easy to set this up.

1 - to take account of the time zone, in MetaMod there's a selector you can use to set the time zone that MetaMod will use. You can set that to Greece to make things easier to calculate.

2 - I guess that you want to show the module before a certain time, and hide it after that time.

3 - Set up the "target" module (the one you want to control). Set it to display on "Module assignment: no pages" so that it does not appear until the MetaMod tells it to.

4 - Set up the MetaMod. Assign it to ALL pages OR just the particular menu item that the module should appear on, if you have a certain menu item for that.
- use the following PHP code in the MetaMod:

if (MM_TIME < 163000) return 123;
// replace 123 with the module id of the target module

The '163000' means the time 16:30:00 (4:30PM).
If you need a time before 10:00:00 then DO NOT use a leading "0".
e.g. use 95959 not 095959.

Cheers,
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
Posts this week:
1
User Info:
 
Total Users:
10137
Newest User:
lexispoker1
Members Online:
1
Guests Online:
230

Online: 
liaskas

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked