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.

 

3 values for if-statement

3 values for if-statement

Hello,

I am using MetaMod, very nice to use.

No i am experiencing some trouble. I want to show a module on friday between 11.15 and 13.00

if ( MM_TIME >= 111500 && MM_TIME <= 130000 && MM_DAY_OF_WEEK == 5)
return 135;

How is it now possible to show this and when i change all the options to

if ( MM_TIME < 111500 && MM_TIME > 130000 && MM_DAY_OF_WEEK != 5)
return 136;

Is above code correct? So i like to show on friday between 11.15 and 13.00 module 135 and outside that timeslot i want to show 136.

Hope somebody can help me with this,....

Thanks in front! Best regards,

Fabian

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

Re: 3 values for if-statement

Ah, boolean algebra...

The reverse of "1 and 2 and 3" is "NOT (1 and 2 and 3)".

Therefore the reverse of

Code:

if ( MM_TIME >= 111500 && MM_TIME <= 130000 && MM_DAY_OF_WEEK == 5) 

return 135;

is

Code:

if ( ! (MM_TIME >= 111500 && MM_TIME <= 130000 && MM_DAY_OF_WEEK == 5 ) ) 

return 135;

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
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:
175

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