Web Analytics Made Easy -
StatCounter dj next on air - CodingForum

Announcement

Collapse
No announcement yet.

dj next on air

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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

      Comment


      • #4
        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.

        Comment


        • #5
          <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>

          Comment


          • #6
            anyone can do a start for me please and im can add from there

            Comment


            • #7
              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.

              Comment


              • #8
                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/

                Comment


                • #9
                  im tested ur html code out and all i see is a bink page

                  Comment


                  • #10
                    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]=[[[COLOR="Red"]14[/COLOR],'tomjones','http://www.vicsjavascripts.org.uk/StdImages/Cartoon1.gif'],[[COLOR="Red"]23[/COLOR],'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/

                    Comment


                    • #11
                      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>

                      Comment

                      Working...
                      X
                      😀
                      🥰
                      🤢
                      😎
                      😡
                      👍
                      👎