Anyway I can show DJs name at a given time, rolling 7days.

Here it is members a script that you can use on your webpage copy paste and adjust, schedule presenters name at a certain time of day. Good Luck.
See it in action here. www.sugaradio.uk

<html>

// Author Mike Salmon
// Display in css or easier iframe
// Remember this takes time off server ie US will display US time so use. (d.toLocaleString('en-US', { timeZone: 'America/New_York' });


<head>
<script>
var current = new Date();
var future = new Date();
future.setTime(future.getTime() + 3600000); //3600000 = 1 hour
future.setMinutes(0);
future.setSeconds(0);

var timeout = (future.getTime() - current.getTime());
setTimeout(function() { window.location.reload(true); }, timeout);
</script>
<script type="text/javascript">
var promoimage = [ // add path to directory if necessary
"DJimage1.jpg", // Always the name DJimage .jpg with corrisponding number ie 1-10
"DJimage2.jpg",
"DJimage3.jpg",
"DJimage4.jpg",
"DJimage5.jpg",
"DJimage6.jpg",
"DJimage7.jpg"
];
function ChangePromoImage() {
var now = new Date();
var hr = now.getHours();
var daypart = 0;
if ((hr >= 6) && (hr < 8)) { daypart = 0; } // 6am to 8:00am // Delete or add lines here to corrispond to the .jpg images
if ((hr >= 10) && (hr < 12)) { daypart = 1; } // 10am to noon // Adjust hr for images to switch
if ((hr >= 13) && (hr < 14)) { daypart = 2; } // 1pm to 2pm
if ((hr >= 15) && (hr < 18)) { daypart = 3; } // 3pm to 6pm
if ((hr >= 19) && (hr < 21)) { daypart = 4; } // 7pm to 9pm
if ((hr >= 20) && (hr < 24)) { daypart = 5; } // 10pm to midnight

document.getElementById('promoimage').src = promoimage[daypart];
document.getElementById('promoimage').alt = promoimage[daypart];
document.getElementById("hour").innerHTML = hr;
}

</script>
</head>
<body onload="ChangePromoImage()">
<img id="promoimage" src="" alt="">
<p>The time is: <span id="hour"></span></p>


</body>
 
Back
Top