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.
Results 1 to 11 of 11

Thread: dj next on air

  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile dj next on air

    I have seen a scipit for a news html scipt but i am trying to change it so i can add the times ect on it can anyone help me plz here is the scipit
    I hope u understand what i am trying to say



    Philip M done this one but i want to make it who is on next ect

    <html>
    <head>
    <title>Time Display</title>

    <script type="text/javascript">

    function DisplayTIME() {

    var currentTime = new Date();
    var dayname = currentTime.getDay()
    var hours = currentTime.getHours();

    var nd = new Date();
    nd = nd.getTimezoneOffset();
    var offset = Math.floor(nd / 60);
    var nextTime = (hours + offset) % 24 +1;
    if (nextTime < 10) {nextTime = "0" + nextTime}
    var message = "Our next live news bulletin on The Mix Radio is at ";
    if (offset == 0) {
    message += nextTime + ':00 GMT'
    }
    else {
    message += nextTime + ':00 Local Time '
    }
    document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
    }

    </script>
    </head>

    <body onload = "DisplayTIME()">

    <div id="yourdivid">Message about TMR News schedule</div>

    </body>
    </html>

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,073
    Thanks
    38
    Thanked 498 Times in 492 Posts
    So what are the times you are trying to add
    and how do you wish to display them?

    If you cannot do the JS, then at least layout the HTML
    so we can see where you are trying to go.

    BTW: You should enclose you script between [ code] and [ /code] tags (without the spaces)
    to make it more easily readable for the forum members.

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    on the home page we just want to see a dj who is next on it with there photo and time ect that is base

    like this

    if i am next my name will be show and my photo and time

    if someone start a scipit off im can change it also sorrry for the delay to get bk to u

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,910
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    What's a scipit?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #5
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <html>
    <head>
    <title>Time Display</title>

    <script type="text/javascript">

    function DisplayTIME() {

    var currentTime = new Date();
    var dayname = currentTime.getDay()
    var hours = currentTime.getHours();

    var nd = new Date();
    nd = nd.getTimezoneOffset();
    var offset = Math.floor(nd / 60);
    var nextTime = (hours + offset) % 24 +1;
    if (nextTime < 10) {nextTime = "0" + nextTime}
    var message = "Our next live news bulletin on The Mix Radio is at ";
    if (offset == 0) {
    message += nextTime + ':00 GMT'
    }
    else {
    message += nextTime + ':00 Local Time '
    }
    document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
    }

    </script>
    </head>

    <body onload = "DisplayTIME()">

    <div id="yourdivid">Message about TMR News schedule</div>

    </body>
    </html>

  • #6
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anyone can do a start for me please and im can add from there

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,910
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Please pay attention to post #2. People will be reluctant to assist you if you seem to ignore advice.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #8
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,502
    Thanks
    3
    Thanked 500 Times in 487 Posts
    Code:
    <html>
    <head>
    <title>Time Display</title>
    
    <script type="text/javascript">
    var DJ=[]
    DJ[0]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[1]=[[16,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[18,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[2]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[3]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[4]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[5]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[6]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    
    function DisplayTIME() {
     var currentTime = new Date();
     var dayname = currentTime.getDay()
     var hours = currentTime.getHours(),message ='';
    
     var nd = new Date();
     nd = nd.getTimezoneOffset();
     var offset = Math.floor(nd / 60);
     nd=new Date(currentTime.getFullYear(),currentTime.getMonth(),currentTime.getDate(),(hours + offset));
     hours = nd.getHours();
     var ary=DJ[nd.getDay()];
     for (var z0=0;z0<ary.length;z0++){
      if (ary[z0][0]>hours){
       message=ary[z0][1]+'<img src="'+ary[z0][2]+'" />';
       break;
      }
     }
     document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
    }
    
    </script>
    </head>
    
    <body onload = "DisplayTIME()">
    <div id="yourdivid">Message about TMR News schedule</div>
    
    
    </body>
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #9
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im tested ur html code out and all i see is a bink page

  • #10
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,502
    Thanks
    3
    Thanked 500 Times in 487 Posts
    you will need to change the start time for each DJ(marked in red)

    Code:
    <html>
    <head>
    <title>Time Display</title>
    
    <script type="text/javascript">
    var DJ=[]
    DJ[0]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[1]=[[16,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[18,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[2]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[3]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[4]=[[10,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[11,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[5]=[[14,'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[23,'cliff','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    DJ[6]=[[14,'tomjones1','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[23,'cliff1','http://www.vicsjavascripts.org.uk/StdImages/Cartoon2.gif']]; // sunday
    
    function DisplayTIME() {
     var currentTime = new Date();
     var dayname = currentTime.getDay()
     var hours = currentTime.getHours(),message ='';
    
     var nd = new Date();
     nd = nd.getTimezoneOffset();
     var offset = Math.floor(nd / 60);
     nd=new Date(currentTime.getFullYear(),currentTime.getMonth(),currentTime.getDate(),(hours + offset));
     hours = nd.getHours();
     var ary=DJ[nd.getDay()];
     for (var z0=0;z0<ary.length*2;z0++){
      if (ary[z0%6][0]>hours){
       message=ary[z0][1]+'<img src="'+ary[z0][2]+'" />';
       break;
      }
     }
     document.getElementById('yourdivid').innerHTML = '<p>'+message+'<p>';
    }
    
    </script>
    </head>
    
    <body onload = "DisplayTIME()">
    <div id="yourdivid">Message about TMR News schedule</div>
    
    
    </body>
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #11
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,073
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Lightbulb Alternate attempt ...

    This is my take on the problem.
    Modify the arrays for the times and names to display at any particular hour of the day.
    Code:
    <html>
    <head>
    <title>Time Display</title>
    
    <script type="text/javascript">
    
    function DisplayTIME() {
      var currentTime = new Date();
      var dayname = currentTime.getDay()
      var hours = currentTime.getHours();
    
      var nd = new Date();
      nd = nd.getTimezoneOffset();
      var offset = Math.floor(nd / 60);
      var nextTime = (hours + offset) % 24 +1;
      if (nextTime < 10) { nextTime = "0" + nextTime; }
      var message = "Our next live news bulletin on The Mix Radio is at ";
      if (offset == 0) {
        message += nextTime + ':00 GMT';
      } else {
        message += nextTime + ':00 Local Time ';
      }
      document.getElementById('yourdivid').innerHTML = '<p>'+message;
      document.getElementById('currentDJ').innerHTML = CurrentDJ(hours);
    }
    var baseURL = 'http://www.nova.edu/hpd/otm/pics/4fun/';
    var imgNoDJ = 'http://www.vicsjavascripts.org.uk/StdImages/frogs.jpg';
    var imgList = ['','','','','','','','','11.jpg', // midnight to 8am
        '11.jpg','12.jpg','12.jpg','13.jpg',         // 9am to noon
        '13.jpg','14.jpg','14.jpg','15.jpg',         // 1pm to 4pm
        '15.jpg','21.jpg','21.jpg','22.jpg',         // 5pm to 8pm
        '22.jpg','23.jpg','23.jpg','',               // 9pm to midnight
    ];
    var DJList = ['','','','','','','','','John',    // midnight to 8am
        'John','Jacob','Jacob','Jingle-Heimer',      // 9am to noon
        'Jingle-Heimer','Smith','Smith','Mary',      // 1pm to 4pm
        'Mary','Susan','Susan','Ophelia',            // 5pm to 8pm
        'Ophelia','Wolfman','Wolfman','',            // 9pm to midnight
    ];
    function CurrentDJ(hrs) {
      var tmp = imgList[hrs];
      var msg = '';
      if (tmp == '') { tmp = imgNoDJ;
                       msg = '<p>Currently we are Off-Air'; }
                else { tmp = baseURL+imgList[hrs]; 
                       msg = '<p>Currently On-Air is: '+DJList[hrs]; }
      document.getElementById('DJpicture').src = tmp;
      return msg;
    }
    </script>
    </head>
    
    <body onload = "DisplayTIME()">
    
    <div id="yourdivid">Message about TMR News schedule</div>
    <div id="currentDJ">Off Air</div>
    <img id="DJpicture" src="">
    </body>
    </html>


  •  

    Posting Permissions

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