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.

 

Watch now on our TV - can metamod do that - please I need it urgent

Watch now on our TV - can metamod do that - please I need it urgent

Hello all
First of all I want to say, that is my first post in this great and beautiful forum, that makes me happy.
I need a module for TV channel (TV station) site, that enables me to show the now ongoing programs according to its time automatically and dynamically.
e.g : at 8.00 pm goes program number 1, at 8.50 pm goes the next program. I want to show these Programs in a module on the site according to its time automatically and dynamically without manual editing.
Could you tell me
can this module (Metamod) help me to do that or no??
If yes, please tell me how to set the parameters of the module ??  please
Thanks all
I'm waiting for your reply

Edited By: meto
10-Feb-10 13:25:21

meto
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Watch now on our TV - can metamod do that - please I need it urgent

Hi meto,

first of all, please read through the Quick Start guide: http://www.metamodpro.com/get-started/quick-start

Then once you know how to set this up, do the following:

1- create all the different modules for the different shows. For convenience, unpublish them all so that they don't all show up on the site together.
2- create the MetaMod in the module position where you want the other modules to appear. Ensure it is published.
3- in the MetaMod, make a rule something like this:

if (MM_TIME >= 80000 and MM_TIME < 85000) return AAA; //08:00:00 to 08:50:00
if (MM_TIME >= 85000 and MM_TIME < 93000) return BBB; // 08:50:00 to 09:30:00
if (MM_TIME >= 93000 and MM_TIME < 143000) return CCC; // 09:30:00 to 14:30:00
// add more rules as necessary...

You need to replace AAA, BBB, CCC etc with the module id for the module that you want to display at that time.

Note about times:
the numbers e.g. 85000 are made up of up to 2 digits for the hour, up to 2 digits for minutes, and up to 2 digits for seconds.

DO NOT put a "0" at the start of any time, or PHP will interpret the number wrongly. 085000 is different to 85000. Midnight is 0. Half an hour after midnight is simply 3000, not 003000.

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

Re: Watch now on our TV - can metamod do that - please I need it urgent

Thank you my friend
That is very very great module and great forum and you are very great Moderator smile . Thank you it works very well.
but I still have a small problem:
The previous code works very well with all programs except 2 programs, because the 2 programs should be displayed in 2 different days of the week (e.g Monday and Wednesday).
And there are some other programs, that should be displayed just at one day of the week (e.g just at Saturday) (or just at Friday ... etc)
How can i use MM_DAY_OF_WEEK and MM_TIME variables together?
And could you explain me the number of the days of the week ? (e.g Monday =1). What about the other days? because I'm still a small coder smile
hope you reply
Thank you again

meto
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Watch now on our TV - can metamod do that - please I need it urgent

MM_DAY_OF_WEEK = 0 for Sunday, 1 for Monday, up to 6 for Saturday.

You can combine these easily with your time rules:

if (MM_DAY_OF_WEEK == 3 and MM_TIME >= 80000 and MM_TIME < 85000) return AAA; //08:00:00 to 08:50:00 Wednesday

If you want something to appear on 2 days, then you have to put parentheses around the days of the week like this:

if (
  ( MM_DAY_OF_WEEK == 3 or MM_DAY_OF_WEEK == 4 )
  and MM_TIME >= 80000 and MM_TIME < 85000
  ) return AAA; //08:00:00 to 08:50:00 Wednesday

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

Re: Watch now on our TV - can metamod do that - please I need it urgent

Thank you very very much my dear friend.
It is very good.
I find no words to express my happiness.
Thank you smile smile smile smile smile smile

meto
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Watch now on our TV - can metamod do that - please I need it urgent

smile

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

Re: Watch now on our TV - can metamod do that - please I need it urgent

Thank you my friend again
Excuse me
Last Question please:
I have times on the TV channel which have no programs, and I want to display that is no programs at the time now.
I will display it of course with custom module.
How can I write it with "if" rule in the php code?
thanks again
hope you reply

meto
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Watch now on our TV - can metamod do that - please I need it urgent

Easy. At the end of all the list of the other rules, just put:

return XXX; // replace XXX with id of default module

Because it appears after the other rules, PHP will only reach that one if all the other ones do not apply.

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

Re: Watch now on our TV - can metamod do that - please I need it urgent

you mean:
at the end of rules put return XXX;  without "if" ???

meto
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: Watch now on our TV - can metamod do that - please I need it urgent

yes.

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

Board Info

Board Stats:
 
Total Topics:
1675
Total Polls:
6
Total Posts:
5917
Posts this week:
6
User Info:
 
Total Users:
11585
Newest User:
tom6221
Members Online:
1
Guests Online:
198

Online: 
tom6221

Forum Legend:

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