Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 3 123 LastLast
Results 1 to 15 of 40
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    I need help with an On Air script for a radio station website.

    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

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,603
    Thanks
    80
    Thanked 4,500 Times in 4,464 Posts
    So are you wanting the display to change when the show changes?

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

  • #3
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,109
    Thanks
    38
    Thanked 498 Times in 492 Posts
    A similar question was posed here: http://www.webdeveloper.com/forum/sh...=schedule+time
    See if you can use it.

  • #4
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Yes..there will be listeners hopefully visiting the site from around the world..but the station is in the CST...

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,159
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    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 ) I would leave it and simply say that the schedule is CST.


    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)"}
    }
    
    
    document.getElementById("dj").innerHTML = "On air now: " + show;
    </script>
    Last edited by Philip M; 06-16-2009 at 06:48 PM. Reason: Typo noticed

  • Users who have thanked Philip M for this post:

    chuckwilliams10 (06-17-2009)

  • #6
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Radio Script

    I am not sure how to complete the script...if you have time can you help me finish the script....thanks a ton....

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,159
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    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.
    Last edited by Philip M; 06-16-2009 at 06:02 PM.

  • Users who have thanked Philip M for this post:

    chuckwilliams10 (06-17-2009)

  • #8
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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>

  • #9
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,159
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    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.
    Last edited by Philip M; 06-16-2009 at 07:32 PM.

  • Users who have thanked Philip M for this post:

    chuckwilliams10 (06-17-2009)

  • #10
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    5
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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

  • #11
    New Coder
    Join Date
    Sep 2009
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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

  • #12
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    welcome to CF.

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

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #13
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,159
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    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">

  • Users who have thanked Philip M for this post:

    Bonzai (09-18-2009)

  • #14
    New Coder
    Join Date
    Sep 2009
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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>

  • #15
    New Coder
    Join Date
    Sep 2009
    Posts
    16
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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 ((


  •  
    Page 1 of 3 123 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •