Web Analytics Made Easy -
StatCounter Php on-air script with image - CodingForum

Announcement

Collapse
No announcement yet.

Php on-air script with image

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

  • Php on-air script with image

    codingforums i need help! basically i have this code

    HTML Code:
     <div align="center"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <head>
    <div id="snow"></div>
    <title>Station Activity</title>
    
    <style type="text/css">
    td {
    font-size: 0.6em;
    }
    
    /* temporary for testing purposes */
    #NowOn {
    border: 0px solid black;
    font-size: 11.5px;
    color: blue;
    background: transparent;
    height: 65px;
    width: 350px;
    }
    main {
    width: 70px;
    height: 300px;
    border: 1px solid #c3c3c3;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    }
    
    main div {
    width: 70px;
    height: 70px;
    }
    
    </style>
    
    <script type="text/javascript">
    /* NOT CURRENTLY USED
    var thedate = new Date();
    var dayofweek = thedate.getDay();
    var hourofday = thedate.getHours();
    
    var GMT = new Date().getTimezoneOffset();
    var offsetGMT = +1 new Date().getTimezoneOffset()/01:00;
    */
    // Sun=0 1 2 3 4 5 Sat=6
    var DayOfWeek = new Array('Weekend', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Weekend');
    var NoShow = 'No Show Scheduled<br />for COOLVIBES';
    var DH = new Array(7);
    for (d = 0; d < 7; d++) {
    DH[d] = new Array(24);
    for (h = 0; h < 24; h++) {
    DH[d][h] = '';
    }
    }
    DH[1][10] = 'Monday at 8:00 AM<br>Mix And Match<br>with DJ Kayley';
    DH[1][08] = 'Monday at 12 AM<br>AUTOMIX<br>with auto';
    DH[1][12] = 'Auto mix<br>with auto parrott<br>Monday at Noon<br>No Genre';
    DH[1][14] = 'auto<br>with auto parrott<br>Monday at 2 PM<br>No Genre';
    DH[1][16] = 'No Show Name<br>with Katy Cox<br>Monday at 4 PM<br>Rap';
    DH[1][17] = 'The Greatest<br>with DJ Fresh<br>Monday at 5 PM<br>No Genre';
    DH[1][18] = 'Revolution Corner<br>with Randy Underwood<br>Monday at 6 PM<br>No Genre';
    DH[1][20] = 'Daily Affirmation<br>with DJ Hightower<br>Monday at 8 PM<br>No Genre';
    DH[1][22] = 'No Show Name<br>with David Doggett<br>Monday 10 to Midnight<br>No Genre';
    DH[1][23] = 'No Show Name<br>with David Doggett<br>Monday at 11 PM<br>No Genre';
    DH[2][13] = 'Mix&Match<br>with Kayley<br>Tuesday at 8:00 AM<br>Rock';
    DH[2][08] = 'No Show<br>with Automix<br>Tuesday at 8 AM<br>Mix n Match';
    DH[2][16] = 'No Show Name<br>with Sweet Action Jackson<br>Tuesday at 4 PM<br>Rock';
    DH[2][20] = 'The Rock Hour<br>with Dan the Man<br>Tuesday at 8 PM<br>No Genre';
    DH[3][10] = '80,s Show<br>with DJ Rose<br>Wednesday at 8 PM<br>No Genre';
    DH[3][11] = 'Westcoast Wednesdays<br>with DJ Smoove<br>Wednesday at 11 AM<br>No Genre';
    DH[3][15] = 'The Storm Hour<br>with the Weatherman and Reba<br>Wednesday 3 to 5 PM<br>Classic Rock';
    DH[3][16] = 'The Storm Hour<br>with the Weatherman and Reba<br>Wednesday at 4 PM<br>Classic Rock';
    DH[3][22] = 'EZ Does It<br>with DJ EZ<br>Wednesday at 10 PM<br>Rap';
    DH[4][12] = 'automix<br>with autodj<br>Thursday Noon to 2 PM<br>mix';
    DH[4][22] = 'Request Show<br>with Jukebox<br>Thursday 8 PM<br>Mix n Match';
    DH[4][13] = 'automix<br>with autodj<br>Thursday at 1 PM<br>mix';
    DH[4][14] = 'The Hour<br>with DJ V-Jeezy<br>Thursday at 2 PM<br>No Genre';
    DH[4][22] = 'Mix And Match<br>with Strawbs<br>Thursday at 5:20 PM Till 6:20 PM<br>Request Show';
    DH[5][10] = 'The Hour Show<br>with Auto<br>Friday at 5:20 PM Till 6:20 PM<br>All In One';
    DH[5][11] = 'Friday at 11 AM<br>Christian Music<br>with Jammin J';
    DH[5][12] = 'Friday at Noon<br>automix<br>with autodj';
    DH[5][13] = 'Friday at 1 PM<br>Dance<br>with Deano';
    DH[5][09] = 'Friday at 9 AM<br>Mix n Match<br>with Autobox';
    DH[5][14] = 'Friday at 2 PM<br>automix<br>with autodj';
    DH[5][15] = 'Friday at 13:20 Till 15:20 PM<br>Mix n Match<br>Request Show';
    DH[5][16] = 'Friday at 4 PM<br>automix<br>with autodj';
    DH[5][17] = 'Friday at 5 PM<br>automix<br>with autodj';
    DH[5][19] = 'Friday at 7 PM<br>Mix n Match<br>with Autobox';
    DH[5][22] = 'Friday at 10 PM<br>Dance/Trance<br>with Dean';
    DH[5][23] = 'Friday at 11 PM<br>automix<br>with autodj';
    DH[6][18] = 'Saturday at 8 PM<br>80,s Show<br>with DJ Rose';
    DH[6][19] = 'Saturday at 7 PM<br>Dance/Trance<br>with Dean';
    DH[6][13] = 'Saturday at 1 PM<br>Old School/Reggae<br>with El Carlito';
    DH[6][22] = 'Saturday at 10 PM<br>mix<br>with autodj';
    DH[6][23] = 'Saturday at 11 PM<br>mix<br>with autodj';
    DH[7][22] = 'Sunday at 5:20 PM Till 6:20 PM<br>Mix n Match<br>Reuest Show<br>with Strawbs';
    DH[7][18] = 'Sunday at 6 PM<br>Old School/Reggae<br>with El Carlito';
    // Add more when schedule is known. Note: there may be better ways to do this when information is known.
    function OnNow() {
    var thedate = new Date();
    var dayofweek = thedate.getDay();
    var hourofday = thedate.getHours();
    
    var showOn = DH[dayofweek][hourofday];
    }
    
    function NowON() {
    var thedate = new Date();
    var dayofweek = thedate.getDay();
    var hourofday = thedate.getHours();
    var showOn = DH[dayofweek][hourofday];
    if (showOn == '') {
    showOn = thedate + '<p />No Show Scheduled';
    }
    document.getElementById('NowOn').innerHTML = showOn;
    }
    </script>
    </head>
    
    <BODY onLoad="NowON()">
    <!-- Unhide this if table display desired
    <script type="text/javascript">
    document.write(TableStationSchedule())
    </script>
    -->
    <script type="text/javascript">
    document.write(NowON());
    </script>
    <div id='NowOn' onClick="NowON()">Click For Now On COOLVIBES</div>
    </body>
    
    </html>
    how could i have images with this script instead of text?

  • #2
    I don’t see any PHP whatsoever, only JavaScript for the most part, so I moved it to the respective forum section.

    Now, your question is a little unclear because you didn’t say where you want images but I suppose in the array items? It looks like they take HTML code, so it’s just a matter of adding HTML for images to the array items, e. g.:

    Code:
    DH[1][10] = 'Your text here <img src="path/to/image.jpg" alt="" width="???" height="???">';
    Last edited by VIPStephan; Jun 9, 2022, 06:11 PM.
    Stop solving problems you don’t yet have!

    Comment


    • #3
      VIPStephan yea lol ta i managed to sort that out

      but could you check this for me please

      HTML Code:
      DH[4][22] = 'Request Show<br><br><img src="http://www.coolvibes-reloaded.com/images/strawbs.gif" width="194" height="120" />';// this will display an image at 6pm on thursday <br />
      basically i'm on thursdays from 6pm to 7pm is this rite?

      Comment


      • #4
        Your NowON function sets date and time:
        Code:
        function NowON() {
          var thedate = new Date();
          var dayofweek = thedate.getDay();
          var hourofday = thedate.getHours();
          var showOn = DH[dayofweek][hourofday];
          …
        }
        So, if you have DH[4][22] that means “on day four at hour 22”. If you want 6pm I would think it must read DH[4][18].
        Last edited by VIPStephan; Jun 11, 2022, 10:03 AM.
        Stop solving problems you don’t yet have!

        Comment


        • #5
          ahh ok i get it

          DH [4] [18]= 6pm
          DH [4] [19]= 7pm
          DH [4] [20]= 8pm ect ect

          yea its all in digital time and not 24hour!

          rite thanks
          Last edited by aubrey1989; Jun 10, 2022, 10:16 AM.

          Comment

          Working...
          X