Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » 3 values for if-statement
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
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
- Index
- » MetaMod
- » MetaMod General Support
- » 3 values for if-statement
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7630
- Newest User:
- welch84998
- Members Online:
- 0
- Guests Online:
- 126
- 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