...

View Full Version : I need help with an On Air script for a radio station website.



chuckwilliams10
06-15-2009, 10:42 PM
This is the programming schedule I need help with for a javascript to show On Air Now based off the the time of day..

5a – 9a Mon – Sat The Tom Joyner Morning Show
9a – 2p Mon – Sat Carl T
2p – 6p Mon – Fri Tommy C
6p – 11p Mon - Thu Keith Sweat

Friday Lineup
6p – 10p Friday G.L. Haywood (House Party)

Saturday Lineup
6a – 8a Saturday The Tom Joyner Morning Show: Right Back At Cha!
9a – 2p Saturday Carl T
2p – 8p Saturday George Fisher
8p – 10p Saturday Chief Chris Omigee & Momanite Nurse
10p – til Saturday House Party

Sunday Lineup
5a – 10a Sunday Porsha Evans (Gospel)
10a –12p Sunday The Cravins Brothers Zydeco and Info Show with Charles & Donald Cravins
12p – 5p Sunday George Fisher
5p – 9p Sunday Dr. Boogie Live


Any help would be greatly appreciated....the time-zone is CST..

Thanks a ton

Old Pedant
06-15-2009, 11:09 PM
So are you wanting the display to change when the show changes?

And do you have any listeners outside of CST?? (Not CDT???)

jmrker
06-16-2009, 12:35 AM
A similar question was posed here: http://www.webdeveloper.com/forum/showthread.php?t=149601&highlight=schedule+time
See if you can use it.

chuckwilliams10
06-16-2009, 01:42 PM
Yes..there will be listeners hopefully visiting the site from around the world..but the station is in the CST...

Philip M
06-16-2009, 04:05 PM
This will give you a start - I don't have time to do all of it for you, and if you do not understand how it works you will not be able to change it as required. The relevant show appears in relation to the time as defined by the user's computer. This will be fine for users in the CST zone but of course will not be correct for anywhere else. It is possible to allow for this by using UTC time throughout, but there are still problems with daylight saving time.

Unless you are genuinely sure that there will be a significant number of listeners from outside the CST time zone (pretty unlikely looking at the schedule :D:D) I would leave it and simply say that the schedule is CST.



<div id = "dj"></div>

<script type = "text/javascript">
var show = "No show scheduled at present";
var now = new Date();
var dy = now.getDay(); // day of week 0-6
var hh = now.getHours();

// Tip - for testing purposes you can put here
//dy = 6;
//hh = 18;
// or whatever to check that the right show appears at that day/time.

if (dy >=1 && dy <=6) { // days in Javascript are 0 Sunday - 6 Saturday
if (hh >=5 && hh <= 9) {show = "The Tom Joyner Morning Show"}
if (hh >=9 && hh <= 14) {show = "Carl T"}
}

if (dy >=1 && dy <=5) {
if (hh >=14 && hh <=18) {show ="Tommy C"}
}

if (dy >= 1 && dy <=4) {
if (hh >=18 && hh <= 23) {show = "Keith Sweat"}
}

if (dy == 5) {
if (hh >=18 && hh <= 22) {show = "G.L.Haywood (House Party)"}
}


document.getElementById("dj").innerHTML = "On air now: " + show;
</script>

chuckwilliams10
06-16-2009, 04:48 PM
I am not sure how to complete the script...if you have time can you help me finish the script....thanks a ton....

Philip M
06-16-2009, 05:58 PM
This forum is not a free coding service. As I say, if you do not understand how it works you will not be able to change the schedule in the future as required. It should be very obvious from the example code I gave you. Make an effort, and if you still have genuine problems back here and post your code.

In any case your schedule does not make sense:-

5a – 9a Mon – Sat The Tom Joyner Morning Show
6a – 8a Saturday The Tom Joyner Morning Show: Right Back At Cha!
9a – 2p Saturday Carl T


You need to do Saturday and Sunday. Here is a start:-

if (dy == 6) { // Saturday Note the two = signs to mean equals
if (hh >= 6 && hh <= 8) {show = "The Tom Joyner Morning Show: Right Back At Cha!" }

// other Saturday shows similarly (in order of increasing time)

} //end of Saturday

Now fill in the rest.

chuckwilliams10
06-16-2009, 07:13 PM
I finished the script with the rest of the Saturday and Sunday shows....and now when the script runs...there is no text at all.....I must have did something wrong.....

here is the code:

<div id = "dj"></div>

<script type = "text/javascript">
var show = "No show scheduled at present";
var now = new Date();
var dy = now.getDay(); // day of week 0-6
var hh = now.getHours();

// Tip - for testing purposes you can put here
//dy = 6;
//hh = 18;
// or whatever to check that the right show appears at that day/time.

if (dy >=1 && dy <=6) { // days in Javascript are 0 Sunday - 6 Saturday
if (hh >=5 && hh <= 9) {show = "The Tom Joyner Morning Show"}
if (hh >=9 && hh <= 14) {show = "Carl T"}
}

if (dy >=1 && dy <=5) {
if (hh >=14 && hh <=18) {show ="Tommy C"}
}

if (dy >= 1 && dy <=4) {
if (hh >=18 && hh <= 23) {show = "Keith Sweat"}
}

if (dy == 5) {
if (hh >=18 && hh <= 22) {show = "G.L.Haywood (House Party)"}
}

if (dy == 6) { // Saturday Note the two = signs to mean equals
if (hh >= 6 && hh <= 8) {show = "The Tom Joyner Morning Show: Right Back At Cha!" }
if (dy == 6) {
if (hh >= 9 && hh <= 14) {show = "Carl T}
if (hh >=14 && hh <= 20) {show = "George Fisher"}
if (hh >=20 && hh <= 22) {show = "Chief Chris Omigee & Momanite Nurse"}
if (hh >=22 && hh <= 24) {show = "House Party"}
} //End of Saturday Shows

if (dy == 0) { //Sunday Shows
if (hh >= 5 && hh <= 10) {show = "Porshe Evans (Gospel)"}
if (hh >=10 && hh <= 12) {show = "The Cravins Brothers Zydeco and Info Show with Charles & Donald Cravins"}
if (hh >=12 && hh <= 17) {show = "George Fisher"}
if (hh >=17 && hh <= 21) {show = "Dr. Boogie Live"}
}

document.getElementById("dj").innerHTML = "On air now: " + show;
</script>

Philip M
06-16-2009, 07:30 PM
Two errors:-

if (hh >= 9 && hh <= 14) {show = "Carl T"} // missing quotes are enough to prevent the script from running

if (hh >= 6 && hh <= 8) {show = "The Tom Joyner Morning Show: Right Back At Cha!" }
if (dy == 6) { // Delete this line

It works then.

But there is no show scheduled on Saturday from 8-9

You should also change
if (dy >=1 && dy <=6) { // days in Javascript are 0 Sunday - 6 Saturday
to
if (dy >=1 && dy <=5) {
as Saturday has a complete schedule of its own.


BTW, please follow the posting guidelines and wrap your code in [code] tags. This means use the octothorpe or # button on the toolbar which will insert opening [ code ] and closing [ /code ] tags - omit the spaces. You can edit your previous post.

chuckwilliams10
06-16-2009, 08:09 PM
Thanks a ton..it works fine..for me to add images....I can just the path for the images under the quotes....at that point I would image basic HTML...thanks a ton

Bonzai
09-18-2009, 07:15 PM
Hey Hallo guys

So i like to change color text style from the scrip, is this possible?

by preference : Verdana FF8000 etc ...

salutions from luxembourg

bazz
09-18-2009, 07:29 PM
welcome to CF.

Best place to change the foint and text colour, is in your css.

bazz

Philip M
09-18-2009, 07:32 PM
Use CSS - either a stylesheet or inline.

<span id = "dj" style="font-family: Verdana, Arial, sans-serif; font-size:30px; font-weight:700; color: 'FF8000';"></span><img src = "One.gif" id = "theImage">

Bonzai
09-18-2009, 10:06 PM
hi Philipe thx for the help:

i would like to make the days with the hours in this example!
------------------------
but now you can make me the insert for the image?

here is the link for the image: http://www.inthemixradio.lu/DjOnAir/Oli.png



<div id = "dj"></div>

<script type = "text/javascript">
var show = "Non Stop Music";

var now = new Date();
var dy = now.getDay(); // day of week 0-6
var hh = now.getHours();

// Tip - for testing purposes you can put here
//dy = 6;
//hh = 18;
// or whatever to check that the right show appears at that day/time.




if (dy == 5) { //Fryday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Dj Lghas</A><BR><A></A><BR><A>Sendung : </A><BR><A>Shake It"}
} //End of Fryday Shows




document.getElementById("dj").innerHTML = "Animateur On Air : </A><BR>" + show;
document.getElementById("dj").style.color = 'AFAFAF';
document.getElementById("dj").style.fontSize = "12";
document.getElementById("dj").style.fontFamily = "Verdana";
document.getElementById("dj").align = "center";


</script>

Bonzai
09-18-2009, 10:09 PM
the image fom me have just to be see now (Dj Lghas) from 23:00 to 24:00

when no body is in the studio i will take a picture like this:

http://www.inthemixradio.lu/DjOnAir/Image.png

I think is not easy hm i'ts my first day on Java :(((

Philip M
09-19-2009, 10:38 AM
the image fom me have just to be see now (Dj Lghas) from 23:00 to 24:00

when no body is in the studio i will take a picture like this:

http://www.inthemixradio.lu/DjOnAir/Image.png

I think is not easy hm i'ts my first day on Java :(((


Be aware that Java and Javascript are entirely different programming languages, in spite of the confusingly similar names.

<span id = "dj" style="font-family: Verdana, Arial, sans-serif; font-size:30px; font-weight:700; color: 'FF8000';"></span> <img src = "One.gif" id = "theImage">

Naturally you will want to show the image apppropriate to the DJ.

Example:-


if (dy >=1 && dy <=5) { // days in Javascript are 0 Sunday - 6 Saturday
if (hh >=5 && hh <9) {show = "The Tom Joyner Morning Show"; document.getElementById("theImage").src = "Four.gif"}
if (hh >=9 && hh <14) {show = "Carl T"; document.getElementById("theImage").src = "Two.gif"}
}

Bonzai
09-19-2009, 03:09 PM
Hallo thx man but hm can you make me the insert? look end of script pls!

Salutions to you :)


<div id = "dj"></div>


<script type = "text/javascript">
var show = "Non Stop Music";

var now = new Date();
var dy = now.getDay(); // day of week 0-6
var hh = now.getHours();

// Tip - for testing purposes you can put here
//dy = 6;
//hh = 18;
// or whatever to check that the right show appears at that day/time.



if (dy == 1) { //Monday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Monday Shows


if (dy == 2) { //Tuesday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Tuesday Shows


if (dy == 3) { //Wednesday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Wednesday Shows


if (dy == 4) { //Thursday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Thursday Shows


if (dy == 5) { //Fryday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Fryday Shows


if (dy == 6) { //Saturday Shows
if (hh >=00 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Saturday Shows


if (dy == 0) { //Sunday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Sunday Shows


document.getElementById("dj").innerHTML = "Animateur On Air : </A><BR>" + show;
document.getElementById("dj").style.color = 'AFAFAF';
document.getElementById("dj").style.fontSize = "12";
document.getElementById("dj").style.fontFamily = "Verdana";
document.getElementById("dj").align = "left";



</script>

Bonzai
09-19-2009, 09:27 PM
Hey Man
Pls here the Finished i hope all is ok inthe sript pls re look

here the test page http://www.inthemixradio.lu/2009


here the script:):)

<div id = "dj"></div>
<span id = "dj" style= > </A><BR><img src = "http://www.inthemixradio.lu/DjOnAir/Image.png" id = "theImage">
<script type = "text/javascript">
var show = "Non Stop Music";

var now = new Date();
var dy = now.getDay(); // day of week 0-6
var hh = now.getHours();

// Tip - for testing purposes you can put here
//dy = 6;
//hh = 18;
// or whatever to check that the right show appears at that day/time.



if (dy == 1) { //Monday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Monday Shows


if (dy == 2) { //Tuesday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Tuesday Shows


if (dy == 3) { //Wednesday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Wednesday Shows


if (dy == 4) { //Thursday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Thursday Shows


if (dy == 5) { //Fryday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}

if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Fryday Shows


if (dy == 6) { //Saturday Shows
if (hh >=00 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Olivier</A><BR><A></A><BR><A>Sendung : </A><BR><A>Late Night Show"; document.getElementById("theImage").src = "http://inthemixradio.lu//DjOnAir/Oli.png"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Saturday Shows


if (dy == 0) { //Sunday Shows
if (hh >=24 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
if (hh >=23 && hh <=24) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Pc Non Stop Music"}
} //End of Sunday Shows


document.getElementById("dj").innerHTML = "Animateur On Air : </A><BR>" + show;
document.getElementById("dj").style.color = 'AFAFAF';
document.getElementById("dj").style.fontSize = "12";
document.getElementById("dj").style.fontFamily = "Verdana";
document.getElementById("dj").align = "left";


</script>

Bonzai
10-15-2009, 07:58 PM
hi guys works powerfull but now i would to insert a 2 nd image can you help me pls thx

Bonzai
04-23-2010, 11:46 PM
hi hallo i will now make the text linket look expl pls


in red exp linked to this page
http://www.inthemixradio.lu

in magen linked to this page
http://www.inthemixradio.lu/..........

so when i click on the text new page will open the text color pls some insert color for the link!

hope some one help me :)

thx

-------------------------------

if (dy == 1) { //Monday Shows
if (hh >=00 && hh <= 1) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 1 && hh <= 2) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 2 && hh <= 3) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 3 && hh <= 4) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 4 && hh <= 5) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 5 && hh <= 6) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 4 && hh <= 7) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 7 && hh <= 8) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 8 && hh <= 9) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >= 9 && hh <=10) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=10 && hh <=11) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=11 && hh <=12) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=12 && hh <=13) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=13 && hh <=14) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=14 && hh <=15) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=15 && hh <=16) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=16 && hh <=17) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=17 && hh <=18) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=18 && hh <=19) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=19 && hh <=20) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=20 && hh <=21) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=21 && hh <=22) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=22 && hh <=23) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
if (hh >=23 && hh <=00) {show ="Pc</A><BR><A></A><BR><A>Sendung : </A><BR><A>Non Stop Music"}
} //End of Monday Shows

Philip M
04-24-2010, 07:35 AM
When posting here please help us to help you by following the posting guidelines and wrapping your code in CODE tags. This means use the octothorpe or # button on the toolbar which will insert the tags. You can (and should) edit your previous post.

Finally, I am afraid that your English is too fractured for me to understand you. "hi hallo i will now make the text linket look expl pls" :confused: Textspeak is particularly inappropriate when your first langauge is not English.

The short answer is to use CSS to control the style of the display.

xuraco
05-08-2012, 01:48 PM
I know this is an old thread but I recently used this code and it works wounders, a little question though, is there anyway i can make it refresh ever so often, as for the moment it only changes when the page reloads ? thanks

jmrker
05-08-2012, 03:11 PM
I know this is an old thread but I recently used this code and it works wounders, a little question though, is there anyway i can make it refresh ever so often, as for the moment it only changes when the page reloads ? thanks

What is the "refresh ever so often" interval?
Hourly, Minutes, Seconds? Milliseconds would probably be over kill!

SeanUK
09-15-2012, 04:47 PM
Here is my schedule I am working on but I would like to make all shows hyperlink to a new page how do I add this.


<div id="npdj"></div>
<script type = "text/javascript">
var show = "No show scheduled at present";
var now = new Date();
var dy = now.getDay(); // day of week 0-6
var hh = now.getHours();


// Tip - for testing purposes you can put here
//dy = 0;
//hh = 8;
// or whatever to check that the right show appears at that day/time.

if (dy >= 0) { // days in Javascript are 0 Sun
if (hh >= 00 && hh <= 8) { }
if (hh >= 8 && hh <= 10) { show = "Sunday Breakfast"; document.getElementById("theImage").src = "images/npimg.png"; }
if (hh >= 10 && hh <= 12) { show = "Sunday Brunch" }
if (hh >= 12 && hh <= 15) { show = " Sunday Afternoons" }
if (hh >= 15 && hh <= 22) { }
if (hh >= 22 && hh <= 00) { show = "The Late Show" }
}

if (dy >= 1) { // days in Javascript are 1 Mon
if (hh >= 00 && hh <= 7) { }
if (hh >= 7 && hh <= 10) { show = "Weekday Breakfast"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 10 && hh <= 12) { show = "Weekday Mornings" }
if (hh >= 12 && hh <= 15) { show = " Weekday Afternoons" }
if (hh >= 15 && hh <= 18) {show = "Drive Time"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 18 && hh <= 22) { }
if (hh >= 22 && hh <= 00) { show = "The Late Show" }
}

if (dy >= 2) { // days in Javascript are 2 Tues
if (hh >= 00 && hh <= 7) { }
if (hh >= 7 && hh <= 10) { show = "Weekday Breakfast"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 10 && hh <= 12) { show = "Weekday Mornings" }
if (hh >= 12 && hh <= 15) { show = " Weekday Afternoons" }
if (hh >= 15 && hh <= 18) { show = "Drive Time"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 18 && hh <= 22) { }
if (hh >= 22 && hh <= 00) { show = "The Late Show" }
}

if (dy >= 3) { // days in Javascript are 3 Wed
if (hh >= 00 && hh <= 7) { }
if (hh >= 7 && hh <= 10) { show = "Weekday Breakfast"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 10 && hh <= 12) { show = "Weekday Mornings" }
if (hh >= 12 && hh <= 15) { show = " Weekday Afternoons" }
if (hh >= 15 && hh <= 18) { show = "Drive Time"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 18 && hh <= 22) { }
if (hh >= 22 && hh <= 00) { show = "The Late Show" }
}

if (dy >= 4) { // days in Javascript are 4 Thurs
if (hh >= 00 && hh <= 7) { }
if (hh >= 7 && hh <= 10) { show = "Weekday Breakfast"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 10 && hh <= 12) { show = "Weekday Mornings" }
if (hh >= 12 && hh <= 15) { show = " Weekday Afternoons" }
if (hh >= 15 && hh <= 18) { show = "Drive Time"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 18 && hh <= 22) { }
if (hh >= 22 && hh <= 00) { show = "The Late Show" }
}

if (dy >= 5) { // days in Javascript are 5 Fri
if (hh >= 00 && hh <= 7) { }
if (hh >= 7 && hh <= 10) { show = "Weekday Breakfast"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 10 && hh <= 12) { show = "Weekday Mornings" }
if (hh >= 12 && hh <= 15) { show = " Weekday Afternoons" }
if (hh >= 15 && hh <= 18) { show = "Drive Time"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 18 && hh <= 20) { }
if (hh >= 20 && hh <= 22) { show = "Friday Night Fever" }
if (hh >= 22 && hh <= 00) { show = "The Late Show" }
}

if (dy >= 6) { // days in Javascript are 6 Sat
if (hh >= 00 && hh <= 8) { }
if (hh >= 8 && hh <= 10) { show = "Saturday Breakfast"; document.getElementById("theImage").src = "images/npimg.png" }
if (hh >= 10 && hh <= 12) { show = "Saturday Brunch" }
if (hh >= 12 && hh <= 15) { show = "Saturday Afternoons" }
if (hh >= 15 && hh <= 20) { }
if (hh >= 20 && hh <= 22) { show = "Saturday Night Fever" }
if (hh >= 22 && hh <= 00) { show = "The Late Show" }

}

document.getElementById("npdj").innerHTML = "On Air: " + show;
</script>

Philip M
09-15-2012, 06:15 PM
Here is my schedule I am working on but I would like to make all shows hyperlink to a new page how do I add this.



In the usual way. Example:-


if (hh >= 8 && hh <= 10) { show = "<a href = 'http://www.google.com'>Sunday Breakfast</a>" }

if (dy >= 0) { // days in Javascript are 0 Sun
should be
if (dy == 0) { // days in Javascript are 0 Sun


“Pessimist: One who, when he has the choice of two evils, chooses both.”
Oscar Wilde (Irish Poet, Novelist, Dramatist and Critic, 1854-1900)

SeanUK
09-15-2012, 07:06 PM
thanks I was trying this way
if (hh >= 8 && hh <= 10) { show = "<a href = "schedule.html">Sunday Breakfast</a>"; document.getElementById("theImage").src = "images/npimg.png" }

Philip M
09-15-2012, 07:20 PM
thanks I was trying this way
if (hh >= 8 && hh <= 10) { show = "<a href = "schedule.html">Sunday Breakfast</a>"; document.getElementById("theImage").src = "images/npimg.png" }

show = "<a href = "schedule.html">Sunday Breakfast</a>";

You have double quotes within double quotes. You should use single quotes for the url.

jmrker
09-16-2012, 01:24 AM
Based upon your code of post #24, and need for hourly change notifications,
you could eliminate a lot of duplicated logic with a change to something like this...



<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
<title> Radio Times </title>
<script type="text/javascript">

var showTimes = [ // ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'], // for each hour 0...23
['','','','','','',''], // hour 0
['','','','','','',''], // hour 1
['','','','','','',''], // hour 2
['','','','','','',''], // hour 3
['','','','','','',''], // hour 4
['','','','','','',''], // hour 5
['','','','','','',''], // hour 6
['', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', ''], // hour 7
['Sunday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Saturday Breakfast'], // hour 8
['Sunday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Weekday Breakfast', 'Saturday Breakfast'], // hour 9
['Sunday Brunch', 'Weekday Mornings', 'Weekday Mornings', 'Weekday Mornings', 'Weekday Mornings', 'Weekday Mornings', 'Saturday Brunch'], // hour 10
['Sunday Brunch', 'Weekday Mornings', 'Weekday Mornings', 'Weekday Mornings', 'Weekday Mornings', 'Weekday Mornings', 'Saturday Brunch'], // hour 11
['Sunday Afternoon', 'Weekday Afternoons','Weekday Afternoons', 'Weekday Afternoons', 'Weekday Afternoons', 'Weekday Afternoons', 'Saturday Afternoon'], // hour 12
['Sunday Afternoon', 'Weekday Afternoons','Weekday Afternoons', 'Weekday Afternoons', 'Weekday Afternoons', 'Weekday Afternoons', 'Saturday Afternoon'], // hour 13
['Sunday Afternoon', 'Weekday Afternoons','Weekday Afternoons', 'Weekday Afternoons', 'Weekday Afternoons', 'Weekday Afternoons', 'Saturday Afternoon'], // hour 14
['', 'Drive Time', 'Drive Time', 'Drive Time', 'Drive Time', 'Drive Time', ''], // hour 15
['', 'Drive Time', 'Drive Time', 'Drive Time', 'Drive Time', 'Drive Time', ''], // hour 16
['', 'Drive Time', 'Drive Time', 'Drive Time', 'Drive Time', 'Drive Time', ''], // hour 17
['', 'Supper Break', 'Supper Break', 'Supper Break', 'Supper Break', 'Supper Break', ''], // hour 18
['','','','','','',''], // hour 19 // Evening Bluegrass
['','','','','','',''], // hour 20 // Evening Dowop
['','','','','','',''], // hour 21 // Evening Jazz
['The Late Show', 'The Late Show', 'The Late Show', 'The Late Show', 'The Late Show', 'The Late Show', 'The Late Show'], // hour 22
['The Late Show', 'The Late Show', 'The Late Show', 'The Late Show', 'The Late Show', 'The Late Show', 'The Late Show'] // hour 23
];

var showTimeLinks = [];
showTimeLinks['Weekday Breakfast'] = '<a href="wbSchedule.html">'; // each link needs to be defined as an HTML file
showTimeLinks['Weekday Mornings'] = '<a href="wmSchedule.html">';
showTimeLinks['Weekday Afternoons'] = '<a href="waSchedule.html">';
showTimeLinks['Sunday Breakfast'] = '<a href="subSchedule.html">';
showTimeLinks['Sunday Brunch'] = '<a href="subrSchedule.html">';
showTimeLinks['Saturday Breakfast'] = '<a href="sabSchedule.html">';
showTimeLinks['Saturday Brunch'] = '<a href="sabrSchedule.html">';
showTimeLinks['Drive Time'] = '<a href="dtSchedule.html">';
showTimeLinks['The Late Show'] = '<a href="lsSchedule.html">';

// similar logic as above to set any image links
// showTimeLinks['Weekday Breakfast'] = '<a href="wbSchedule.html"><img src="wbImage.jpg>'; // each link needs to be defined as an HTML file

</script>
<style type="text/css">

</style>
</head>
<body>
<div id="npdj" />
<script type="text/javascript">
var now = new Date();
var dy = now.getDay(); // day of week 0-6
var hh = now.getHours();

// Tip - for testing purposes you can put here
// dy = 3;
// hh = 15;
// or whatever to check that the right show appears at that day/time.

var tmp = showTimes[hh][dy]
var show = "On Air: "+showTimeLinks[tmp]+tmp+"</a>";
if (showTimes[hh][dy] == '') { show = "<a href='schedule.html'>On Air</a>: No show scheduled at present"; }

document.getElementById("npdj").innerHTML = show;
</script>

</body>
</html>

Images could be easily added as shown in sample change above.

Philip M
09-16-2012, 08:43 AM
Based upon your code of post #24, and need for hourly change notifications,
you could eliminate a lot of duplicated logic with a change to something like this...


Hmm. A lot harder to edit, IMO, and excludes the possibility of sometimes changing the program at other the full hour. Mine is easily adjusted with hours as a decimal, say 9.5 for 9:30. I prefer clarity/simplicity to efficiency/elegance! And single quotes ['','','','','','',''], is frought with risk of mistyping " instead of ''. But à chacun son goût as the Germans would say. :D

jmrker
09-16-2012, 03:15 PM
Hmm. A lot harder to edit, IMO, and excludes the possibility of sometimes changing the program at other the full hour. Mine is easily adjusted with hours as a decimal, say 9.5 for 9:30. I prefer clarity/simplicity to efficiency/elegance! And single quotes ['','','','','','',''], is frought with risk of mistyping " instead of ''. But à chacun son goût as the Germans would say. :D

Never said it was better, just an alternative solution.
This post has been around for what seems to be forever and people still cannot seem to get the logic right.
For example:


if (hh >= 12 && hh <= 15) ...
// followed by
if (hh >= 15 && hh <= 22) ...

The array set-up bypasses all this redundant code and
does not use if logic at the top of the hour where display would be set twice.
True, the array is setup for hourly changes only, but that was the OP's requirements,
but it does only need to be created correctly once, so I don't know the editing would be a problem.

Plus I have no idea what the German's would say. :D

djultra
03-05-2013, 11:38 PM
hi there i was just wondering if anyone has
fully finished the code for on air off air

as i would like one

djultra
03-05-2013, 11:40 PM
hi there i had a simular sort of code

wich is



<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h+1;

// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 4 && $h < 8) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 8 && $h < 12) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 12 && $h < 14) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 16 && $h < 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h < 0) $img = 'images2/dj/images/autodj.jpg';

// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h >= 4 && $h < 8) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h >= 8 && $h < 12) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h >= 12 && $h < 13) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h >= 13 && $h < 15) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h >= 15 && $h < 17) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h >= 17 && $h < 20) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 2 && $h >= 20) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 3 && $h < 0) $img = 'images2/dj/images/autodj.jpg';

// WEDNESDAY SCHEDULE
else if ($d == 3 && $h >= 4 && $h < 8) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 3 && $h >= 22 && $h < 00) $img = 'images2/dj/images/djultra.jpg';
else if ($d == 3 && $h >= 8 && $h < 12) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 3 && $h >= 12 && $h < 13) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 3 && $h >= 13 && $h < 15) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 3 && $h >= 15 && $h < 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 3 && $h >= 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 4 && $h < 0) $img = 'images2/dj/images/autodj.jpg';

// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 4 && $h >= 4 && $h < 8) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 4 && $h >= 8 && $h < 12) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 16 && $h < 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 4 && $h >= 13 && $h < 15) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 4 && $h >= 15 && $h < 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 4 && $h >= 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h < 0) $img = 'images2/dj/images/autodj.jpg';

// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 4 && $h < 8) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 8 && $h < 10) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 10 && $h < 12) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 12 && $h < 13) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 13 && $h < 15) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 15 && $h < 18) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 18 && $h < 20) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 20 && $h < 22) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 5 && $h >= 22) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h < 0) $img = 'images2/dj/images/autodj.jpg';

// SATURDAY SCHEDULE
else if ($d == 6 && $h >= 3 && $h < 22) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 22 && $h < 00) $img = 'images2/dj/images/djultra.jpg';
else if ($d == 6 && $h >= 5 && $h < 8) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 8 && $h < 9) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 9 && $h < 10) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 10 && $h < 11) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 11 && $h < 12) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 12 && $h < 13) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 13 && $h < 14) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 14 && $h < 15) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 15 && $h < 17) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h >= 16 && $h < 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 19 && $h < 22) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 6 && $h >= 22) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h < 0) $img = 'images2/dj/images/autodj.jpg';

// SUNDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 2) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 2 && $h < 4) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 4 && $h < 5) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 5 && $h < 6) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 6 && $h < 8) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 8 && $h < 9) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 9 && $h < 10) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 10 && $h < 11) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 11 && $h < 12) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 12 && $h < 16) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 16 && $h < 17) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 17 && $h < 18) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 18 && $h < 19) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 19 && $h < 21) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 0 && $h >= 21) $img = 'images2/dj/images/autodj.jpg';
else if ($d == 1 && $h < 0) $img = 'images2/dj/images/autodj.jpg';
?>

<html>
<head></head>
<body>
<p align="center"><img src="<?php echo $img; ?>"> </p>
</body>
</html>
<p>&nbsp;</p>

but this don't work for me? so i was wondering if anyone has a fully finished code like chucks one

Old Pedant
03-05-2013, 11:47 PM
Ummm...what is the point of your code? *ALL* of your images are the same: 'images2/dj/images/autodj.jpg'

Old Pedant
03-05-2013, 11:51 PM
And your code will never work, because of this:


$h = date('G'); //set variable $h to the hour of the day
$h = $h+1;

So now your $h value will be 1 through 24, *NOT* 0 through 23.

Which doesn't match up at all with the if conditions you are using.

Also, because you are doing this in PHP code, the image won't change when the hour changes, if the user still has the page open in his/her browser.

May I suggest you start a *NEW THREAD*, instead of piggy backing on this old one? And state explicitly what you are trying to do?

djultra
03-06-2013, 12:33 AM
thanks ive posted in a seprate forum over at
http://www.codingforums.com/showthread.php?p=1317938#post1317938

jmrker
03-07-2013, 01:37 AM
You can put your PHP code back into this example, but I saw no particular need for it using JS only.

Note your logic can be vastly compressed with a bit of forethought...
The value of $h (hours) can only be within the range of 0..23 in military time.
Therefore all you need to do is check for $h < hour starting a midnight and staying sequential in your test logic.

Also, you only need to check for the day once and not each and every time.
If the schedule stays the same for any one or more days, the logic could be compressed further.

Substitute your own path and image file names into the appropriate lines
and ask questions about the following logic if it does not make sense to you...


<html>
<head>
<title> DJ times </title>
</head>
<body>
<div id="DJtimes">
<img id="DJpix" src="" title='No show' alt="No show" style="font-size:3em; background-color:orange">
</div>

<script type="text/javascript">
function DJdisplay() {
var now = new Date();
var $d = now.getDay();

var $h = now.getHours(); // adjust for MST if necessary or use UTC time
// var $h = now.getMinutes(); // for testing purposes only before hh:24

var $year = now.getFullYear();

var baseURL = 'http://www.nova.edu/hpd/otm/pics/4fun/'; // change to: './images2/dj/images/
var $img = document.getElementById('DJpix');

/*
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h+1;
*/

if ($d == 1) { // MONDAY SCHEDULE
if ($h < 4) $img.src = baseURL+''
else if ($h < 8) $img.src = baseURL+'11.jpg'
else if ($h < 12) $img.src = baseURL+'12.jpg'
else if ($h < 14) $img.src = baseURL+'13.jpg'
else if ($h < 16) $img.src = baseURL+'13.jpg'
else if ($h < 19) $img.src = baseURL+'14.jpg'
else if ($h >= 19) $img.src = baseURL+'15.jpg';
}

if ($d == 2) { // TUESDAY SCHEDULE
if ($h < 4) $img.src = baseURL+''
else if ($h < 8) $img.src = baseURL+'21.jpg'
else if ($h < 12) $img.src = baseURL+'22.jpg'
else if ($h < 13) $img.src = baseURL+'23.jpg'
else if ($h < 15) $img.src = baseURL+'23.jpg'
else if ($h < 17) $img.src = baseURL+'24.jpg'
else if ($h < 20) $img.src = baseURL+'25.jpg'
else if ($h >= 20) $img.src = baseURL+'21.jpg';
}

if ($d == 3) { // WEDNESDAY SCHEDULE
if ($h < 4) $img.src = baseURL+''
else if ($h < 8) $img.src = baseURL+'31.jpg'
else if ($h < 12) $img.src = baseURL+'32.jpg'
else if ($h < 13) $img.src = baseURL+'33.jpg'
else if ($h < 15) $img.src = baseURL+'33.jpg'
else if ($h < 17) $img.src = baseURL+'34.jpg'
else if ($h < 20) $img.src = baseURL+'35.jpg'
else if ($h >= 20) $img.src = baseURL+'31.jpg';
}

if ($d == 4 ) { // THURSDAY SCHEDULE
if ($h < 4) $img.src = baseURL+''
else if ($h < 8) $img.src = baseURL+'41.jpg'
else if ($h < 12) $img.src = baseURL+'42.jpg'
else if ($h < 13) $img.src = baseURL+'43.jpg'
else if ($h < 15) $img.src = baseURL+'43.jpg'
else if ($h < 17) $img.src = baseURL+'44.jpg'
else if ($h < 20) $img.src = baseURL+'45.jpg'
else if ($h >= 20) $img.src = baseURL+'41.jpg';
}

if ($d == 5) { // FRIDAY SCHEDULE
if ($h < 4) $img.src = baseURL+''
else if ($h < 8) $img.src = baseURL+'51.jpg'
else if ($h < 12) $img.src = baseURL+'52.jpg'
else if ($h < 13) $img.src = baseURL+'53.jpg'
else if ($h < 15) $img.src = baseURL+'53.jpg'
else if ($h < 17) $img.src = baseURL+'54.jpg'
else if ($h < 20) $img.src = baseURL+'55.jpg'
else if ($h >= 20) $img.src = baseURL+'51.jpg';
}

if ($d == 6) { // SATURDAY SCHEDULE
if ($h < 5) $img.src = baseURL+''
else if ($h < 8) $img.src = baseURL+'11.jpg'
else if ($h < 9) $img.src = baseURL+'21.jpg'
else if ($h < 10) $img.src = baseURL+'31.jpg'
else if ($h < 11) $img.src = baseURL+'41.jpg'
else if ($h < 12) $img.src = baseURL+'51.jpg'
else if ($h < 13) $img.src = baseURL+'11.jpg'
else if ($h < 14) $img.src = baseURL+'21.jpg'
else if ($h < 15) $img.src = baseURL+'31.jpg'
else if ($h < 17) $img.src = baseURL+'41.jpg'
else if ($h < 19) $img.src = baseURL+'51.jpg'
else if ($h < 22) $img.src = baseURL+'11.jpg'
else if ($h >= 22) $img.src = baseURL+'21.jpg';
}

if ($d == 0) { // SUNDAY SCHEDULE
if ($h < 2) $img.src = baseURL+''
else if ($h < 4) $img.src = baseURL+'11.jpg'
else if ($h < 5) $img.src = baseURL+'21.jpg'
else if ($h < 6) $img.src = baseURL+'31.jpg'
else if ($h < 8) $img.src = baseURL+'41.jpg'
else if ($h < 9) $img.src = baseURL+'51.jpg'
else if ($h < 10) $img.src = baseURL+'11.jpg'
else if ($h < 11) $img.src = baseURL+'21.jpg'
else if ($h < 12) $img.src = baseURL+'31.jpg'
else if ($h < 16) $img.src = baseURL+'41.jpg'
else if ($h < 17) $img.src = baseURL+'51.jpg'
else if ($h < 18) $img.src = baseURL+'11.jpg'
else if ($h < 19) $img.src = baseURL+'21.jpg'
else if ($h < 21) $img.src = baseURL+'31.jpg'
else if ($h >= 21) $img.src = baseURL+'41.jpg';
}
}

window.onload = function () {
DJdisplay();
var interval = 60*60*1000; // 1 hour checks
// var interval = 60*100; // 1 minute checks for testing purposes only
var t = setInterval("DJdisplay()",interval);
}
</script>

</body>
</html>

Old Pedant
03-07-2013, 01:45 AM
See the other thread, jmrker.

The problem with doing it in PHP only is that it won't change if the user has his/her browser open and sitting on the site at the time a "shift" changes.

See my solution all in JS code except for being fed the base time from the server.

jmrker
03-07-2013, 01:50 AM
See the other thread, jmrker.

The problem with doing it in PHP only is that it won't change if the user has his/her browser open and sitting on the site at the time a "shift" changes.

See my solution all in JS code except for being fed the base time from the server.

I did not use the PHP solution, I used the setInterval() command instead.
If the page is open, the image does change.

I'll post my comment above to the new thread. :)

Old Pedant
03-07-2013, 01:58 AM
Whoops. Teach me not to read your entire post! Mea maxima culpa.

djultra89
11-01-2013, 02:00 AM
hi there i'm on the air wednesdays and sundays

8pm till 10pm doing the 80's shows? now is this
code rite.

if (dy == 8) { //Wednesday Shows
if (hh >=8 && 22 <= 1) {show ="ultra</A><BR><A></A><BR><A>80's music : </A><BR><A>ultra 80's music"}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum