PDA

View Full Version : [Useful] Now On Air Script



mattskills
11-15-2010, 03:26 PM
Hi there, below is a script that will display (for this tutorial an image) depending on the day and hour. If no day/hour is specified it will display a default image for example, auto dj or off air.

place this in your page header:

<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 = -5 * new Date().getTimezoneOffset()/60;

*/



// Sun=0 1 2 3 4 5 Sat=6

var DayOfWeek = new Array('Weekend','Monday','Tuesday','Wednesday','Th ursday','Friday','Weekend');



var NoShow = '<img src="images/shownow_klubb24.png" width="277" height="130" />';

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[5][19] = '<img src="YOURIMAGEURL" width="XX" height="XX" />'; // this will display an image at 7pm - 8pm on friday
DH[5][20] = '<img src="YOURIMAGEURL" width="XX" height="XX" />'; // this will display an image at 8pm - 9pm on friday

// Add more according to your schedule





function OnNow() {

var thedate = new Date();

var dayofweek = thedate.getDay();

var hourofday = thedate.getHours();

// alert(dayofweek+':'+hourofday+'<br />'+DH[dayofweek][hourofday]);

var showOn = DH[dayofweek][hourofday];

if (showOn == '') { showOn = thedate+'\n\nNo Show Scheduled'; }

alert(showOn);

}



function NowON() {

var thedate = new Date();

var dayofweek = thedate.getDay();

var hourofday = thedate.getHours();

var showOn = DH[dayofweek][hourofday];

if (showOn == '') { showOn ='<img src="YOURURL" width="XX" height="XX" />'; } //this will be displayed if no image is specified

document.getElementById('NowOn').innerHTML = showOn;

}

function MM_swapImgRestore() { //v3.0

var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}

function MM_preloadImages() { //v3.0

var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

</script>

Alternatively you may want to put the above code into a seperate javascript file and link to it by putting

<script type="text/javascript" src="URLTOYOURFILE.js"></script>


Replace your <body> tag with :

<body onLoad="NowON();">

Finaly place the following code where you want the image to load:


<script type="text/javascript">

document.write(NowON());

</script>

<div id='NowOn' onClick="NowON()">

<div align="left">Now On Air Requires Javascript</div>



</div>



Hope that helps, (this isn't my code but i have used it on many sites and it works well, if you know your way around css you can go beyond displaying a simple image or line of text)

Matt.

garybaldy72uk
11-15-2010, 04:57 PM
Fully Functioning Scripts i like Ones that get screwed up by browsers I Hate!

Arfa B!
11-15-2010, 05:00 PM
Fully Functioning Scripts i like Ones that get screwed up by browsers I Hate!

How many hours have we all spent on getting a script right, onlt to find IE doesn't like it!
I regret not having moved over to FFX many yeras earlier!
Thanks for the greawt script by the way Gary!

mattskills
11-15-2010, 05:16 PM
When i've used this script it has worked in Internet Explorer and Google Chrome , not tried any other browsers, to my knowledge it it fully functional.

garybaldy72uk
11-15-2010, 05:35 PM
How many hours have we all spent on getting a script right, onlt to find IE doesn't like it!
I regret not having moved over to FFX many yeras earlier!
Thanks for the greawt script by the way Gary!

Yeah its a pain when IE doesnt want to play Ball been having CSS headaches with IE of late im a Firm believer In Firefox every script i do seems to run well with that.

No Worries its been something i had been looking for for years!:clap:

garybaldy72uk
11-15-2010, 10:35 PM
While i think the PHP one is Better and doesnt throw any messages at me I reckon Both of these Scripts Deserve a Sticky topic. Theyre both as useful as each other and we dont want em gettin lost in Forums .... Surely

Please James I think it be of benefit to all users!

sammy7545
09-14-2012, 06:25 PM
ive been using a "whos on air" script for years and it works flawlessy in several browsers what i did was uploaded it to my joomla site called whosonair.php and made a "wrapper" module and in the url pathed it to where the whosonair.php file was and it works heres the script with names i was too lazy to take out......lol ...hope it helps

sammy7545
09-14-2012, 06:26 PM
<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h-0;


// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 4 && $h < 14) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 16 && $h < 18) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 18 && $h < 20) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 20 && $h < 22) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 22 && $h < 24) $img = '/images/stories/DJs/akky4.jpg';
else if ($d == 2 && $h < 0) $img = '/images/stories/DJs/kittydj.jpg';


// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 2 && $h >= 4 && $h < 14) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 2 && $h >= 14 && $h < 16) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 2 && $h >= 16 && $h < 19) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 2 && $h >= 19 && $h < 20) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 2 && $h >= 20 && $h < 22) $img = '/images/stories/DJs/johnny.jpg';
else if ($d == 2 && $h >= 22 && $h < 24) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 3 && $h < 0) $img = '/images/stories/DJs/kittydj.jpg';


// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 3 && $h >= 4 && $h < 14) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 3 && $h >= 14 && $h < 16) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 3 && $h >= 16 && $h < 18) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 3 && $h >= 18 && $h < 19) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 3 && $h >= 19 && $h < 21) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 3 && $h >= 21 && $h < 24) $img = '/images/stories/DJs/BRIAN1.jpg';
else if ($d == 4 && $h >= 0) $img = '/images/stories/DJs/kittydj.jpg';




// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 4 && $h >= 4 && $h < 14) $img = '/images/stories/DJs/kitty-dj.jpg';
else if ($d == 4 && $h >= 14 && $h < 16) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 4 && $h >= 16 && $h < 18) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 4 && $h >= 18 && $h < 20) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/images/stories/DJs/johnny.jpg';
else if ($d == 4 && $h >= 22 && $h < 24) $img = '/images/stories/DJs/akky4.jpg';
else if ($d == 5 && $h < 0) $img = '/images/stories/DJs/kittydj.jpg';




// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 5 && $h >= 4 && $h < 14) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 5 && $h >= 14 && $h < 16) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 5 && $h >= 16 && $h < 18) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 5 && $h >= 20 && $h < 22) $img = '/images/stories/DJs/Sammy-.jpg';
else if ($d == 5 && $h >= 22 && $h < 24) $img = '/images/stories/DJs/mrsjones.jpg';
else if ($d == 6 && $h >= 0 && $h < 2) $img = '/images/stories/DJs/kittydj.jpg';




// SATURDAY SCHEDULE
if ($d == 6 && $h >= 0 && $h < 4) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 6 && $h >= 4 && $h < 16) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 6 && $h >= 16 && $h < 18) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 6 && $h >= 18 && $h < 20) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 6 && $h >= 20 && $h < 22) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 6 && $h >= 22 && $h < 24) $img = '/images/stories/DJs/thecocos.jpg';
else if ($d == 0 && $h < 0) $img = '/images/stories/DJs/kittydj.jpg';




// SUNDAY SCHEDULE
if ($d == 0 && $h >= 0 && $h < 2) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 0 && $h >= 2 && $h < 10) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 0 && $h >= 10 && $h < 14) $img = '/images/stories/DJs/thecocos.jpg';
else if ($d == 0 && $h >= 14 && $h < 16) $img = '/images/stories/DJs/BRIAN1.jpg';
else if ($d == 0 && $h >= 16 && $h < 18) $img = '/images/stories/DJs/mrsjones.jpg';
else if ($d == 0 && $h >= 18 && $h < 20) $img = '/images/stories/DJs/johnny.jpg';
else if ($d == 0 && $h >= 20 && $h < 22) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 0 && $h >= 22 && $h < 24) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h < 0) $img = '/images/stories/DJs/kittydj.jpg';
?>


<html>
<meta http-equiv="Content-Language" content="en-us">
<body bgcolor="#000000">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="170" height="134" id="AutoNumber1" align="left">
<tr>
<td width="171" height="60" bordercolordark="#FF0000" background="/images/stories/BG.jpg">
<p align="center">
<img src="<?php echo $img; ?>"height="100" width="100"><p align="left">
</td>
</tr>
</table>
</div>
</body>
</html>

sammy7545
09-14-2012, 06:33 PM
sorry for the large post but the script works.....of course you'll have to edit the path to the images.....u can see it on our website at http://coco.lastcall-radio.com/ under "your current dj".....thanks

BRoss
09-26-2012, 03:51 PM
thanks for this matt

djaubs89
10-04-2012, 04:11 PM
hi i'm looking for some sort of code in html were the autodj picture changes at certain times of the day?
so for example dj solaris at 12pm till 4pm then from 4pm till 8pm is autodj then from 8pm till 12am is dj foxy and so forth?
check out our website at http://nrgextreme.co.uk and look at the on air now auto dj pic i want that to automatically change
at a certain time of day when our dj's are on

djaubs89
10-04-2012, 09:06 PM
hi i'm looking for some sort of coding were
our dj's images changes at a certain time of the day?

so for example auto dj image changes to djultra's image at say like 12pm till 3pm
then after 3pm djultra's image changes to dj solaris's image then at 5pm dj solaris's
image changes to dj ash's image then after 5pm changes back to the auto dj image
then at 7pm changes to dj foxy image and so on and so forth

please help,

i have a code but i don't know how to work it see, ill post it here

<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h+1;


// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = 'images/autodj.jpg';
else if ($d == 1 && $h >= 4 && $h < 8) $img = 'images/autodj.jpg';
else if ($d == 1 && $h >= 8 && $h < 12) $img = 'images/autodj.jpg';
else if ($d == 1 && $h >= 12 && $h < 14) $img = 'images/autodj.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = 'images/djtaylor.jpg';
else if ($d == 1 && $h >= 16 && $h < 19) $img = 'images/autodj.jpg';
else if ($d == 1 && $h >= 19) $img = 'images/autodj.jpg';
else if ($d == 2 && $h < 0) $img = 'images/autodj.jpg';


// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = 'images/autodj.jpg';
else if ($d == 2 && $h >= 4 && $h < 8) $img = 'images/autodj.jpg';
else if ($d == 2 && $h >= 8 && $h < 12) $img = 'images/autodj.jpg';
else if ($d == 2 && $h >= 12 && $h < 13) $img = 'images/autodj.jpg';
else if ($d == 2 && $h >= 13 && $h < 15) $img = 'images/autodj.jpg';
else if ($d == 2 && $h >= 15 && $h < 17) $img = 'images/autodj.jpg';
else if ($d == 2 && $h >= 17 && $h < 20) $img = 'images/autodj.jpg';
else if ($d == 2 && $h >= 20) $img = 'images/autodj.jpg';
else if ($d == 3 && $h < 0) $img = 'images/autodj.jpg';


// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = 'images/autodj.jpg';
else if ($d == 3 && $h >= 4 && $h < 8) $img = 'images/autodj.jpg';
else if ($d == 3 && $h >= 8 && $h < 12) $img = 'images/autodj.jpg';
else if ($d == 3 && $h >= 12 && $h < 13) $img = 'images/autodj.jpg';
else if ($d == 3 && $h >= 13 && $h < 15) $img = 'images/autodj.jpg';
else if ($d == 3 && $h >= 15 && $h < 19) $img = 'images/autodj.jpg';
else if ($d == 3 && $h >= 19) $img = 'images/autodj.jpg';
else if ($d == 4 && $h < 0) $img = 'images/autodj.jpg';


// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = 'images/autodj.jpg';
else if ($d == 4 && $h >= 4 && $h < 8) $img = 'images/autodj.jpg';
else if ($d == 4 && $h >= 8 && $h < 12) $img = 'images/autodj.jpg';
else if ($d == 4 && $h >= 12 && $h < 13) $img = 'images/autodj.jpg';
else if ($d == 4 && $h >= 13 && $h < 15) $img = 'images/autodj.jpg';
else if ($d == 4 && $h >= 15 && $h < 19) $img = 'images/autodj.jpg';
else if ($d == 4 && $h >= 19) $img = 'images/autodj.jpg';
else if ($d == 5 && $h < 0) $img = 'images/autodj.jpg';


// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 4 && $h < 8) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 8 && $h < 10) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 10 && $h < 12) $img = 'images/ten.gif';
else if ($d == 5 && $h >= 12 && $h < 13) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 13 && $h < 15) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 15 && $h < 18) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 18 && $h < 20) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 20 && $h < 22) $img = 'images/autodj.jpg';
else if ($d == 5 && $h >= 22) $img = 'images/autodj.jpg';
else if ($d == 6 && $h < 0) $img = 'images/autodj.jpg';


// SATURDAY SCHEDULE
else if ($d == 6 && $h >= 0 && $h < 4) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 4 && $h < 5) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 5 && $h < 8) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 8 && $h < 9) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 9 && $h < 10) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 10 && $h < 11) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 11 && $h < 12) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 12 && $h < 13) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 13 && $h < 14) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 14 && $h < 15) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 15 && $h < 17) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 17 && $h < 19) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 19 && $h < 22) $img = 'images/autodj.jpg';
else if ($d == 6 && $h >= 22) $img = 'images/autodj.jpg';
else if ($d == 0 && $h < 0) $img = 'images/autodj.jpg';


// SUNDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 2) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 2 && $h < 4) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 4 && $h < 5) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 5 && $h < 6) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 6 && $h < 8) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 8 && $h < 9) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 9 && $h < 10) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 10 && $h < 11) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 11 && $h < 12) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 12 && $h < 16) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 16 && $h < 17) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 17 && $h < 18) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 18 && $h < 19) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 19 && $h < 21) $img = 'images/autodj.jpg';
else if ($d == 0 && $h >= 21) $img = 'images/autodj.jpg';
else if ($d == 1 && $h < 0) $img = 'images/autodj.jpg';
?>


<html>
<head></head>
<body>
<p align="center"><img src="<?php echo $img; ?>"> </p>
<p>&nbsp;</p>
<p align="center">


</body>
</html>

i do not know how to work this script, so i put it on our website were the autodj picture is and all the code does is just push everything down? please help

sammy7545
10-05-2012, 03:31 PM
@djaubs89 (http://forums.broadcastingworld.net/member.php?15818-djaubs89) did the code that i pasted originally for this script not work for you ?...you can set the background color or image cell spacing and cell padding also the size of the pics (make sure they are similar in size) etc....heres the html script i posted
<html>
<meta http-equiv="Content-Language" content="en-us">
<body bgcolor="#000000">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="170" height="134" id="AutoNumber1" align="left">
<tr>
<td width="171" height="60" bordercolordark="#FF0000" background="/images/stories/BG.jpg">
<p align="center">
<img src="<?php echo $img; ?>"height="100" width="100"><p align="left">
</td>
</tr>
</table>
</div>
</body>
</html>
i did notice tho with this that not all browswers center the pic....firefox does a perfect job....ie and google dont

sammy7545
10-05-2012, 03:38 PM
i've since changed alot of it....i put in a value for the cellspacing and cellpadding....took out the background image (BG.jpg) and just made it black (#000000) played with the images sizes......but i cant get all browsers to display it in the center...just firefox does the best job of that.....the rest are off center

djaubs89
10-06-2012, 11:56 AM
yeah i have it working now thank you sammy :)

djultra89
10-17-2012, 08:48 PM
Sammy Could you help me set the code up please as i am really confused?
some people are telling me it won't update in real time and some people are telling me its javascript
when its not? please can you help me set the code up. many thanks

sammy7545
10-19-2012, 07:52 PM
hi dijultra i'll try......first of all this script is for php.....if your using html there are other scripts for html here......assuming your using php what u want to do is create a folder say for example "dj's" on your server.....mine is in images/stories/dj's....then u want to copy the script i originally posted to your computer and name it...whatever u want.php.....mine is whosonair.php....then u want to edit the script to the path u made the dj's folder and dj's names and times.....the script is written in 24 hour time with 2 hour slots..once u get it all setup......upload it to the main folder to your server.......then u want to create a new "wrapper" module and in the url path it to where u put the whosonair script...mine is http://coco.lastcall-radio.com/whosonair.php...once u have that.. set the size mine is 174x150 no auto height and no auto add.....u also may want to screw with the html code at the bottom of the script for fine tuning for example take out "bg.jpg" and put in a color value....mine is #000000 which is black...make sure your dj's pics are equal size to.....i think mine are either 100x100 or 125x125....once u made that new module..set your paramaters as far as modules go and give it a shot...if i'm forgetting something or you have any problems let me know......its been awhile since ive done this again u can adjust the html code at the bottom to fine tune things eg cell spacing and cell padding i know im forgetting something ...give it a try after you have made all the adjustments and like i said make a new module and path your whosonair.php to that......good luck

Curtiss
10-20-2012, 10:03 AM
These scripts are really looking worthy , I am also going to add these to check out these for my work.
thanks for sharing these scripts.

djultra89
10-20-2012, 01:26 PM
Thanks for the tip Sammy but I do have a folder named dj's with the images in. its images2/dj/images but I have played around but still don't know the timing I want to work weekends from 6pm till 8pm? My time the folder for images are dj's/djdogJpg. But um could you help me out more please maybe teamview me one day and show me were things go script wise, many thanks

djultra89
10-20-2012, 05:23 PM
were do put the dj's pictures in this code mate?

sammy7545
10-23-2012, 10:10 PM
ok on the previous page is the script i posted with dj's names in them........heres an example for mondays.....without posting the whole script in here again
// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 4 && $h < 14) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 16 && $h < 18) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 18 && $h < 20) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 20 && $h < 22) $img = '/images/stories/DJs/kittydj.jpg';
else if ($d == 1 && $h >= 22 && $h < 24) $img = '/images/stories/DJs/akky4.jpg';
else if ($d == 2 && $h < 0) $img = '/images/stories/DJs/kittydj.jpg';
as u can see dj akky comes on at 22-24 hour ...thats 24 hour time......10:00pm to 12:00 am....2 hour slots...the rest says kittydj which is the name of our auto dj......try to follow the example above......change the path to where your dj's folder is.....make sure the names are correct...for example ...akky4.jpg or kittydj.jpg........try to follow the example above changing the path to your dj's folder and the name of your dj's pic in the appropriate time slots.

djultra89
10-24-2012, 09:36 AM
Ok ta Sammy ill copy this bit of the code and rearrange the code. But the code is in you're time not mine? Would it still work with the same time or not? Also are you using any other script for that to work?

sammy7545
10-25-2012, 06:44 PM
i think 24 hour time works in all time zones but i could be wrong...maybe someone else here can answer that better then me and no thats the only script i use to make that work...the important thing u want to remember is to place that script in the main folder of your server.

djultra89
10-26-2012, 09:46 PM
ok but i have done the time for me to work 10pm till 12am? but my picture is not showing up?
please help

djultra89
10-31-2012, 12:32 PM
ok so i want to work from 10am till 12pm my time? what would that be in 24hour


CTRL + Q to Enable/Disable GoPhoto.it

willdunnett
12-16-2012, 07:42 PM
cheers :)

djultra89
12-17-2012, 12:31 PM
does anyone know of any scripts were i can
have a dj center were all of ours DJ'S can login into
say for example epicfm.co.uk:80 they login using there
username and pass, then once logged in they
can upload there banners ie images when they go on air
as i know someone website that does this its 106themix.com
and what they do is they do what i just said, but if you go onto there
website and look at the players you will see an image ontop of the media player?
now that image thats ontop of the players they upload there images to a dj center

please help

djultra89
09-26-2013, 09:27 PM
hi there i have this script


</style>
<script type="text/javascript">
/* NOT CURRENTLY USEDvar thedate = new Date();var dayofweek = thedate.getDay();var hourofday = thedate.getHours();
var GMT = new Date().getTimezoneOffset();var offsetGMT = -5 * new Date().getTimezoneOffset()/60;*/
// Sun=0 1 2 3 4 5 Sat=6var DayOfWeek = new Array('Weekend','Monday','Tuesday','Wednesday','Th ursday','Friday','Weekend');
var NoShow = 'No Show Scheduled<br />for Hyper Radio';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][09] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[1][10] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[1][11] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[1][12] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[1][13] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[1][14] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[1][15] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[1][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[1][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[1][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[1][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[1][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';DH[1][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[2][09] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[2][10] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[2][11] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[2][12] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[2][13] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[2][14] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[2][15] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[2][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[2][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[2][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[2][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[2][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';DH[2][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[3][09] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[3][10] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[3][11] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[3][12] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[3][13] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[3][14] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[3][15] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[3][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[3][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[3][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[3][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[3][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';DH[3][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[4][09] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[4][10] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[4][11] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[4][12] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[4][13] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[4][14] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[4][15] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[4][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[4][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[4][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[4][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[4][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';DH[4][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';
DH[5][09] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[5][10] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[5][11] = '<b>ON AIR NOW<B> DJ LEO 6pm to 11pm';DH[5][12] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[5][13] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[5][14] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[5][15] = '<b>ON AIR NOW<b> DJ AUBS 12pm to 4pm';DH[5][16] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[5][17] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[5][18] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[5][19] = '<b>ON AIR NOW<b> Jessie brooke evening show 4pm to 8pm';DH[5][20] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';DH[5][21] = '<b>ON AIR NOW<b> Zenith classic rock 8pm to 10pm';

// 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();// alert(dayofweek+':'+hourofday+'<br />'+DH[dayofweek][hourofday]);var showOn = DH[dayofweek][hourofday];if (showOn == '') { showOn = thedate+'\n\nNo Show Scheduled'; }alert(showOn);}
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><strong></strong></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()">Hyper Radio ON AIR NOW</div> </body>


and it's saying no show is scheduled for who i put in the schedual?
please help on this one, i have put me and dj leo only in the script

naveen2931
10-04-2013, 08:47 AM
Hi amit.THis is my knowledge about how to start fm radio.Have and fun.

Whether you are looking for information on how to start up a FM radio station that operates on a low power FM basis, operates on a full power frequency or alternatively streams on the internet, it is essential to first establish what the options available to you are. It is also important to understand the process for obtaining a frequency, what the licensing requirements are, and also what type of FM broadcasting equipment and studio gear you will need to run the radio station.

The following is a brief outline of some of the options that may be available. Please that not all options may be available in all countries, as license conditions do vary.

When it comes to how to start up a FM radio station, one of the options is low power FM. This type of radio station operates at lesser power than commercial stations and so they cover a smaller area. The exact area they will cover is dependent on terrain and the exact amount of power you are permitted. Again depending on the country you live in, the low power FM service may enable you to broadcast anywhere near from 500mW to 100W, and may be license-free or alternatively it may be licensed. This level of power is sufficient to cover anywhere between a radius of a few kilometres to several kilometres.

Another option is operating a full power licensed radio station. This type of frequency will give station maximum coverage and will enable you to reach as many listeners as possible. Depending on the country you live in, there can frequently be provisions to operate on a full power frequency, but either on a commercial, non-commercial or educational basis. However, operating a full power FM radio station can be a somewhat complicated process - especially during the initial stages of determining whether there are frequencies available in your area and also costing the equipment that is needed. If you want to start up a full power FM radio station, then it is essential to get expert guidance at the earliest stage. This will ensure you get the information you need to make an informed decision.

If these options don't appeal or are not available in your area, you have one other method for how to start up a FM radio station. You are able to establish a station that streams on the internet. It will be available to a worldwide audience and can stream in your choice of format. Common formats include Winamp and Windows Media Player, although generally we recommend the latter as most people won't need to download any additional software to listen to your station. This type of radio station can use a great deal of bandwidth, so it is important to have a fast speed internet connection with a high data cap limit.

When it comes to choosing the type of station you will set up, one of the most common constraints is budget. That said, it has been proven that a station can start out on a low power FM basis and successfully make the transition to operating a full power licensed commercial FM radio station. Some of the points to consider when looking how to start up a FM radio station include:

- The process for obtaining an FM frequency and what to look out for

How many Watts you will need to achieve the broadcast coverage you want

What your obligations will be when it comes to music royalties

- What specialist services you need before to assist you in submitting your application for a frequency

What is the most appropriate powered transmitter and what type of antenna would be needed

The type of radio automation software that will be used http://www.museter.com/how-to-start-an-internet-radio-station.html (http://anonym.to/?http://www.museter.com/how-to-start-an-internet-radio-station.html)

djultra89
10-10-2013, 04:10 PM
can someone tell if i have this rite or not

i have a DJ on our station that is working 9pm till 10pm mondays
and i just put in the part of the script 9pm till 10 please help

else if ($d == 9 && $h >= && $h < 19) $img = '/images/stories/DJs/kittydj.jpg';

blatent im gonna put our djs image were kittys is

PapaBearPW
10-10-2013, 05:10 PM
To understand what you need to do, you need to understand what the variables are and what you are testing for:

$d = the day of the week starting with 0 for Sunday through 6 for Saturday.
$h = the hour of the day in 24 hour format.

By testing if $d == 9 you will never get a true result (it can only be from 0-6). Monday is 1, 9pm is 21 in 24hour format and 10pm is 22. The rule for converting hours from am/pm to 24 hour format, is to simply add 12 if it is a pm time and remember that midnight (12am) is 0.

So what your test should be is if $d equals 1 and $h is greater than or equal to 21 and $h is less than 22 then show this image. That will look like this:


else if ($d == 1 && $h >= 21 && $h < 22) $img = '/images/stories/DJs/kittydj.jpg';

Hope that helps.

djultra89
10-10-2013, 05:35 PM
yes it does many thank if i need more help i'll come back :)

Brutish Sailor
10-11-2013, 12:25 AM
Sammy! Awesome script!

Brutish Sailor
10-11-2013, 12:30 AM
keep in mind too that its the directory of the online site that the image must pull from.

Also keep in mind this is a PHP script. So that whole output of variables must be saved under the same name.php as the second half of the script calls for.

PapaBearPW
10-11-2013, 01:53 PM
Since it is based on the same script that sammy7545 posted, I'll go ahead and post up a modified version here for anyone interested in playing with it.

http://www.lunarcaster.com/index.php/downloads/33-php

Check the README file for info on setup.

PapaBearPW
10-16-2013, 07:45 PM
With a little css:

http://dev.lunarcaster.com/onairscript/

Just having some fun with it..lol

dutch-dj-70
11-11-2013, 09:04 AM
Very usefull ! Thanks so much !

Realmmaster
11-15-2013, 03:05 PM
Thank you

djultra89
01-15-2014, 05:58 PM
hi there i wanna work a shift on my station from 6pm to 7pm uk time?
now how do i figure this out


else if ($d == 6 && $h >= 17 && $h < 18) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';

PapaBearPW
01-28-2014, 10:36 AM
hi there i wanna work a shift on my station from 6pm to 7pm uk time?
now how do i figure this out


else if ($d == 6 && $h >= 17 && $h < 18) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';

The way you have it there will only show for Saturday from 5pm to 6pm.



else if ($d == 6 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';

That would work for Saturday from 6pm to 7pm.


else if ($d == 0 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';
else if ($d == 1 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';
else if ($d == 2 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';
else if ($d == 3 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';
else if ($d == 4 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';
else if ($d == 5 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';
else if ($d == 6 && $h >= 18 && $h < 19) $img = 'http://hyper-radio.co.uk/djimages/ultra.jpg';


That would cover every day of the week for the same times.

Hope that helps.

djultra89
01-28-2014, 03:13 PM
has anyone got a on air script that accutally shows on our website, i have this script

<div id="feature"><div class="topshadow">
<div class="feat_box"><div class="textwidget widget-text"><span id="dj" style="font-size:12px; font-weight:bold; font-family: Tahoma; color: #6600FF;"><img src="http://hyper-radio.co.uk/djimages/sonic.jpg"></span>


<script type="text/javascript">
function display() {
var show = "No show scheduled at present";
var GMToffset = -5; // Your current GMT offset, whether Standard or Daylight
var now = new Date();
var dy = now.getDay(); // day of week 0-6
now.setHours(GMToffset + now.getHours() + now.getTimezoneOffset() / 60);
var hh = now.getHours();
var mn = now.getMinutes();
hh = hh + (mn/60); // minutes expressed as fractions of an hour


// The GMT offset ensures that every visitor, regardless of their timezone, will see the schedule
// that is appropriate for the site owner's local time.


// Tip - for testing purposes you can put here
//dy = 5;
//hh = 9.25;
// or whatever to check that the right show appears at that day/time.


if (dy >=1 && dy <=5) { // days in Javascript are 0 Sunday - 6 Saturday
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=5 && hh <6) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg"}
if (hh >=9 && hh <17) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
}
if (dy >= 2 && dy <=5) {
if (hh >=0 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=6 && hh <9) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=9 && hh <17) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=18 && hh <19) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=19 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=21 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}


}


if (dy >= 3 && dy <=5) {
if (hh >=0 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=6 && hh <9) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=9 && hh <16) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=16 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=18 && hh <19) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=19 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=21 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
}
if (dy >= 4 && dy <=5) {
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=6 && hh <9) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=9 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=18 && hh <19) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=19 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=20 && hh <23) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=23 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
}


if (dy == 5) {
if (hh >=0 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=6 && hh <9) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=9 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=13 && hh <15) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=15 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=18 && hh <19) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=19 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=21 && hh <23) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=23 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
}


if (dy == 6) { // Saturday Note the two = signs to mean equals
if (hh >=0 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=5 && hh <6) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg"}
if (hh >=9 && hh <10) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >= 10 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=13 && hh <13.5) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=13.5 && hh <15) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=15 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=20 && hh <23) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=23 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
} //End of Saturday Shows


if (dy == 0) { //Sunday Shows
if (hh >=0 && hh <2) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=2 && hh <10) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=10 && hh <11) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=11 && hh <17) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=18 && hh <19) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=19 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=20 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg"}
} // End of Sunday Shows


var a = '<img src="' + show + '" />'
document.getElementById("dj").innerHTML = a;


setTimeout("display()", 60000); // update every 60 seconds
}

now when i go and put it on our site, things seem to go?

i need a code were everything stays on the website. i don't use php at all.

im using webplus x5 to do all my uploading to the server? and php won't go on the website, trust me i have tried

djultra89
01-29-2014, 04:29 PM
Anyone know were I can a script for a dj schedule were I can add the times that the djs are on. And there images, also I would like it to change automatically everytime a dj goes on the air and when they go off the air and changes back to the autodj image? Any help

PapaBearPW
01-30-2014, 11:42 AM
There are a couple issues I can see...but rather than go over them in depth, here is a version of that javascript that seems to work for me:



<script type="text/javascript">
display();
function display() {
var show = "No show scheduled at present";
var GMToffset = -5; // Your current GMT offset, whether Standard or Daylight
var now = new Date();
var dy = now.getDay(); // day of week 0-6
now.setHours(GMToffset + now.getHours() + now.getTimezoneOffset() / 60);
var hh = now.getHours();
var mn = now.getMinutes();
var ss = now.getSeconds();
hh = hh + (mn/60); // minutes expressed as fractions of an hour


// The GMT offset ensures that every visitor, regardless of their timezone, will see the schedule
// that is appropriate for the site owner's local time.


// Tip - for testing purposes you can put here
//dy = 5;
//hh = 9.25;
// or whatever to check that the right show appears at that day/time.

if (dy == 0) { // Sundays
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=5 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=13 && hh <17) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg";}
else if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
}

else if (dy == 1) { // Mondays
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=5 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=13 && hh <17) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg";}
else if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
}

else if (dy == 2) { // Tuesdays
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=5 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=13 && hh <17) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg";}
else if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
}

else if (dy == 3) { // Wednesdays
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=5 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=13 && hh <17) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg";}
else if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
}

else if (dy == 4) { // Thursdays
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=5 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=13 && hh <17) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg";}
else if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
}

else if (dy == 5) { // Fridays
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=5 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=13 && hh <17) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg";}
else if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
}

else if (dy == 6) { // Saturdays
if (hh >=0 && hh <1) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=1 && hh <3) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=3 && hh <6) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=5 && hh <13) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=13 && hh <17) {show = "http://hyper-radio.co.uk/djimages/ultra.jpg";}
else if (hh >=17 && hh <18) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=18 && hh <20) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=20 && hh <21) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=21 && hh <22) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
else if (hh >=22 && hh <24) {show = "http://hyper-radio.co.uk/djimages/sonic.jpg";}
}

var a = '<img src="' + show + '" />';
document.getElementById("dj").innerHTML = a;

setTimeout(function(){display()}, 60000); // update every 60 seconds
}

</script>


Notice the change to your setTimeout() as well as including a call to the display() function at the beginning of the script (necessary to get the function running at the beginning. Otherwise all you are doing is creating a function but never using it.). In addition I setup an if-else if format so that only the necessary checks are made in order to reduce server load.

Let me know if that helps.

djultra89
01-30-2014, 04:12 PM
ok is that in GMT

PapaBearPW
01-30-2014, 04:35 PM
No. If you need GMT, I believe you would need to change this line:


var GMToffset = -5; // Your current GMT offset, whether Standard or Daylight

to:


var GMToffset = 0; // Your current GMT offset, whether Standard or Daylight

When testing here in Germany, I set it to 1 and it worked fine.

djultra89
01-30-2014, 05:01 PM
ok but thing is I'm using webplus x5 to upload my website
an I put the code up there nd nothing came up? please help

PapaBearPW
01-30-2014, 09:34 PM
Sorry, I'm not familiar with webplus x5. I did find this


Usually, to add custom scripts to your WebPlus site, you need to go to Insert > Web Object > HTML and then click the appropriate button, either 'Paste to Head' or 'Paste to Body'.

with a quick google search. You could try adding just the javascript code (either with or without the <script> tags....I'm not sure which) to the head or body as that quote states, and see if it works in either location that way.

If that doesn't work, you should probably ask the folks at serif for further help. That's about all I can say...

djultra89
01-30-2014, 09:51 PM
oooh ok fella many thanks..

djultra89
07-18-2014, 10:43 AM
Is there anychance of getting a code for our websiteLike rubixradio.co.uk there onair at all?

garybaldy72uk
07-18-2014, 12:15 PM
Is there anychance of getting a code for our websiteLike rubixradio.co.uk there onair at all?

It looks very much like a Wordpress template. Which one I don't know as they've hidden the theme details.

If you want a professional website these days you really have to think about spending some cash. I think they've paid someone to get it looking like that as well.

If you don't want to spend cash then it's something you would have to learn your self how to do.

I knew nothing about wordpress 2 years ago now I'm pretty clued up. It's not difficult to learn.

Google is your friend not your enemy!

djultra89
07-18-2014, 04:53 PM
ok i'll try downloading wordpress then. do i have to download mysql as well or just install it

djaubs89
07-15-2017, 03:56 PM
i forgot the times on this script i pinched from sammy :) now

else if ($d == 3 && $h >= 14 && $h < 16) $img = '/new/images/jukebox.gif';

i go on the air from 6pm till 8pm fridays saturdays and sundays now would 14 be 6pm and 16 be 8pm if im editing it?

djaubs89
07-15-2017, 06:29 PM
this is doing my head in peeps, please help

<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h-0;




// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = '/new/images/jukebox.gif';
else if ($d == 1 && $h >= 8 && $h < 22) $img = '/new/images/clive.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/new/images/jukebox.gif';
else if ($d == 1 && $h >= 16 && $h < 18) $img = '/new/images/jukebox.gif';
else if ($d == 1 && $h >= 18 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 1 && $h >= 20 && $h < 22) $img = '/new/images/jukebox.gif';
else if ($d == 1 && $h >= 22 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 2 && $h < 0) $img = '/new/images/jukebox.gif';




// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = '/new/images/jukebox.gif';
else if ($d == 2 && $h >= 4 && $h < 14) $img = '/new/images/jukebox.gif';
else if ($d == 2 && $h >= 14 && $h < 16) $img = '/new/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 19) $img = '/new/images/jukebox.gif';
else if ($d == 2 && $h >= 19 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 2 && $h >= 20 && $h < 22) $img = '/new/images/jukebox.gif';
else if ($d == 2 && $h >= 22 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 3 && $h < 0) $img = '/new/images/jukebox.gif';




// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = '/new/images/jukebox.gif';
else if ($d == 3 && $h >= 4 && $h < 14) $img = '/new/images/jukebox.gif';
else if ($d == 3 && $h >= 14 && $h < 16) $img = '/new/images/jukebox.gif';
else if ($d == 3 && $h >= 16 && $h < 18) $img = '/new/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 19) $img = '/new/images/jukebox.gif';
else if ($d == 3 && $h >= 19 && $h < 21) $img = '/new/images/jukebox.gif';
else if ($d == 3 && $h >= 21 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 4 && $h >= 0) $img = '/new/images/jukebox.gif';








// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = '/new/images/jukebox.gif';
else if ($d == 4 && $h >= 4 && $h < 14) $img = '/new/images/jukebox.gif';
else if ($d == 4 && $h >= 14 && $h < 16) $img = '/new/images/jukebox.gif';
else if ($d == 4 && $h >= 16 && $h < 18) $img = '/new/images/jukebox.gif';
else if ($d == 4 && $h >= 18 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/new/images/jukebox.gif';
else if ($d == 4 && $h >= 22 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h < 0) $img = '/new/images/jukebox.gif';








// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 19 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 14 && $h < 16) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 16 && $h < 18) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 20 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/new/images/strawbs.jpg';
else if ($d == 6 && $h >= 0 && $h < 2) $img = '/new/images/jukebox.gif';








// SATURDAY SCHEDULE
if ($d == 6 && $h >= 0 && $h < 4) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 19 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 6 && $h >= 18 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 6 && $h >= 18 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 6 && $h >= 18 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 6 && $h >= 18 && $h < 20) $img = '/new/images/strawbs.jpg';
else if ($d == 6 && $h < 0) $img = '/new/images/jukebox.gif';








// SUNDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = '/new/images/jukebox.gif';
else if ($d == 5 && $h >= 23 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 0 && $h >= 10 && $h < 14) $img = '/new/images/jukebox.gif';
else if ($d == 0 && $h >= 14 && $h < 16) $img = '/new/images/jukebox.gif';
else if ($d == 0 && $h >= 16 && $h < 18) $img = '/new/images/jukebox.gif';
else if ($d == 0 && $h >= 18 && $h < 20) $img = '/new/images/jukebox.gif';
else if ($d == 0 && $h >= 23 && $h < 24) $img = '/new/images/jukebox.gif';
else if ($d == 0 && $h >= 18 && $h < 20) $img = '/new/images/strawbs.jpg';
else if ($d == 0 && $h < 0) $img = '/new/images/jukebox.gif';
?>




<html>
<meta http-equiv="Content-Language" content="en-us">
<body bgcolor="#000000">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="170" height="134" id="AutoNumber1" align="right">
<tr>
<td width="171" height="60" bordercolordark="#FF0000" background="/new/images/jukebox.gif">
<p align="center">
<img src="<?php echo $img; ?>"height="100" width="100"><p align="right">
</td>
</tr>
</table>
</div>
</body>
</html>


it is showing up with no picture please help

PapaBearPW
07-15-2017, 10:59 PM
Changes:


$d = date('w'); //set variable $d to the day of the week.

Should be replaced with:


$d = date('N'); //set variable $d to the day of the week.

Also, You have your Sunday schedule checking for $d == 5 instead of $d == 7.

djaubs89
07-21-2017, 11:04 AM
ok i've set sunday to 7 now

but i want it to automatically update is there anyway i can do that

mrdata71
07-21-2017, 04:14 PM
I just need one that shows the current DJ name that is On Air. so if it is DJ Auto that is what it shows, or the current DJ. I have never had to deal with a schedule of any sort. I dont know how my old Server was getting the name of the DJ that was on air. It is like they are pulling it from the database that has all the DJ accounts to see who is logged in, and if nobody is on air, it shows Auto Dj. I wonder why makeavoice can do it but i cannot find someone else that can do that?

djaubs89
07-21-2017, 04:46 PM
i may of got it rite now


<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h-0;

// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 8 && $h < 22) $img = '/images/clive.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 22 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 4 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 19) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 19 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 22 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 4 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 19) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 19 && $h < 21) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 21 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 6 && $h >= 0) $img = '/images/jukebox.gif';

// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 4 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 22 && $h < 24) $img = '/jukebox.gif';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 19 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images/strawbs.jpg';
else if ($d == 6 && $h >= 0 && $h < 2) $img = '/images/jukebox.gif';

// SATURDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 19 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images/strawbs.jpg';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// SUNDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 23 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 10 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 6 && $h >= 23 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 18 && $h < 20) $img = '/images/strawbs.jpg';
else if ($d == 0 && $h < 0) $img = '/images/jukebox.gif';
?>


<html>
<meta http-equiv="Content-Language" content="en-us">
<body bgcolor="#000000">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="170" height="134" id="AutoNumber1" align="right">
<tr>
<td width="171" height="60" bordercolordark="#FF0000" background="#000000">
<p align="center">
<img src="<?php echo $img; ?>"height="100" width="100"><p align="right">
</td>
</tr>
</table>
</div>
</body>
</html>


but if now is there any other codes i can use at all

James
07-24-2017, 01:11 AM
i may of got it rite now


<?php
$h = date('G'); //set variable $h to the hour of the day
$d = date('w'); //set variable $d to the day of the week.
$year = date('Y'); //set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h-0;

// MONDAY SCHEDULE
if ($d == 1 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 8 && $h < 22) $img = '/images/clive.jpg';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 22 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// TUESDAY SCHEDULE
if ($d == 2 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 4 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 19) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 19 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 22 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// WEDNESDAY SCHEDULE
if ($d == 3 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 4 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 19) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 19 && $h < 21) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 21 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 6 && $h >= 0) $img = '/images/jukebox.gif';

// THURSDAY SCHEDULE
if ($d == 4 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 4 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 22) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 22 && $h < 24) $img = '/jukebox.gif';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// FRIDAY SCHEDULE
if ($d == 5 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 19 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 20 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images/strawbs.jpg';
else if ($d == 6 && $h >= 0 && $h < 2) $img = '/images/jukebox.gif';

// SATURDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 19 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images/strawbs.jpg';
else if ($d == 6 && $h < 0) $img = '/images/jukebox.gif';

// SUNDAY SCHEDULE
else if ($d == 0 && $h >= 0 && $h < 4) $img = '/images/jukebox.gif';
else if ($d == 1 && $h >= 23 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 2 && $h >= 10 && $h < 14) $img = '/images/jukebox.gif';
else if ($d == 3 && $h >= 14 && $h < 16) $img = '/images/jukebox.gif';
else if ($d == 4 && $h >= 16 && $h < 18) $img = '/images/jukebox.gif';
else if ($d == 5 && $h >= 18 && $h < 20) $img = '/images/jukebox.gif';
else if ($d == 6 && $h >= 23 && $h < 24) $img = '/images/jukebox.gif';
else if ($d == 0 && $h >= 18 && $h < 20) $img = '/images/strawbs.jpg';
else if ($d == 0 && $h < 0) $img = '/images/jukebox.gif';
?>


<html>
<meta http-equiv="Content-Language" content="en-us">
<body bgcolor="#000000">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="170" height="134" id="AutoNumber1" align="right">
<tr>
<td width="171" height="60" bordercolordark="#FF0000" background="#000000">
<p align="center">
<img src="<?php echo $img; ?>"height="100" width="100"><p align="right">
</td>
</tr>
</table>
</div>
</body>
</html>


but if now is there any other codes i can use at all

Updated your post to add the [ CODE ] tags. Please use them in future.

What do you mean by "any other codes i can use at all" ?

djaubs89
08-29-2017, 09:03 PM
ok the code that is in here is not showing up the images on the server please help



<center>
<table cellspacing="3" cellpadding="3" bordercolor="#000000" border="3" bordercolorlight="#DBEDFF" bordercolordark="#5B7997">
<tbody>
<tr>
<td>
<table cellspacing="3" cellpadding="3" bordercolor="#000000" border="3" bordercolordark="#5B7997" bordercolorlight="#DBEDFF">
<tbody> <div align="center"><a href="http://www.youlivenow.tv/external/urbanradio/web/playlist.php" target="_blank"> <img style="border: 0pt none;" src="http://urban-radio.co.uk/images/button_request.png" onmouseover="this.src='http://urban-radio.co.uk/images/button_request.png'" onmouseout="this.src='http://urban-radio.co.uk/images/button_request.png'" alt=""></a>




<a href="http://www.urban-radio.co.uk/test.js" target="_blank"> <img style="border: 0pt none;" src="http://urban-radio.co.uk/images/button_request.png" onmouseover="this.src='http://urban-radio.co.uk/images/button_request.png'" onmouseout="this.src='http://urban-radio.co.uk/images/button_request.png'" alt=""></a> </div>
<tr>
<td> <IMG src="http://www.106themix.com/onairinfo/images/logo.gif" width="350" height="155" border="1" name="refresh">
<script language="JavaScript" type="text/javascript">
<!--
var t = 120 // interval in seconds
image = "http://www.urban-radio.co.uk/test.js" //name of the image
function Start() {
tmp = new Date();
tmp = "?"+tmp.getTime()
document.images["refresh"].src = image+tmp
}
Start();
// -->
</SCRIPT> <br />
<center><div class="cc_player" data-username="urban">Loading ...</div>
<center><script language="javascript" type="text/javascript" src="http://centova.radioservers.biz:2199/system/player.js"></script>
</tr>
</tbody>
</table>
</center> </td>
</tr>
</tbody>
</table>

djaubs89
08-29-2017, 09:12 PM
and i would like my jukebox to start from 2am rite up to midnight then start over again
uk time could anyone shed some light on that please and help me out

djaubs89
08-29-2017, 09:13 PM
<script type="text/javascript">
display();
function display() {
var show = "No show scheduled at present";
var GMToffset = -5; // Your current GMT offset, whether Standard or Daylight
var now = new Date();
var dy = now.getDay(); // day of week 0-6
now.setHours(GMToffset + now.getHours() + now.getTimezoneOffset() / 60);
var hh = now.getHours();
var mn = now.getMinutes();
var ss = now.getSeconds();
hh = hh + (mn/60); // minutes expressed as fractions of an hour




// The GMT offset ensures that every visitor, regardless of their timezone, will see the schedule
// that is appropriate for the site owner's local time.




// Tip - for testing purposes you can put here
//dy = 5;
//hh = 9.25;
// or whatever to check that the right show appears at that day/time.


if (dy == 0) { // Sundays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/strawbs.jpg";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 1) { // Mondays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 2) { // Tuesdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 3) { // Wednesdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 4) { // Thursdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 5) { // Fridays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/strawbs.jpg";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 6) { // Saturdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/strawbs.jpg";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


var a = '<img src="' + show + '" />';
document.getElementById("dj").innerHTML = a;


setTimeout(function(){display()}, 60000); // update every 60 seconds
}


</script>


this is the code

PapaBearPW
08-30-2017, 09:20 PM
You are calling the function at the top. That means that your javascript is running and trying to find an element on the page that isn't there yet. Somewhere on your page is a div with an id="dj" ... make sure you are calling your display function from inside the div. That way you can be sure that the div has shown up on the page before the javascript tries to find it. Should look something like this then:



<div id="dj">
<script type="text/javascript">
display();
</script>
</div>


Then you can remove the display(); call at the top of the javascript since it isn't needed and will just slow down the page load a tick. That should fix your problem with images not showing.

As to the times for any given day, I still think the best way to do this would be to set an image for each hour of the day. Something like:


if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <2) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=2 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <4) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=4 && hh <5) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=6 && hh <7) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=7 && hh <8) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=8 && hh <9) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=9 && hh <10) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=10 && hh <11) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=11 && hh <12) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=12 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <14) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=14 && hh <15) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=15 && hh <16) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=16 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <19) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=19 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=23) {show = "http://urban-radio.co.uk/images/jukebox.gif";}


This way, you can just put any dj in at any time of any day since it is all pre-scripted.

As to setting it to UK time, you should just need to set the variable near the top of the javascript called GMToffset to +1 instead of -5.

djaubs89
09-02-2017, 07:30 PM
i would like to know why this script is not working for me

<?php
$h = date('G');
//set variable $h to the hour of the day
$d = date('w');
//set variable $d to the day of the week.
$year = date('Y');
//set variable $year to the current year
//G is the date key for hours in 24 format (not 12), with no leading 0s, like 02.
// Adjust 2 hour offset for MST below.
$h = $h-0;


// MONDAY SCHEDULE
if ($d == 1){
if($h >= 0 && $h < 8) $img = 'images/jukebox.gif';
else if ($h >= 8 && $h < 9) $img = 'images/clive.jpg';
else if ($h >= 9 && $h < 10) $img = 'images/jukebox.gif';
else if ($h >= 10 && $h < 11) $img = 'images/jukebox.gif';
else if ($h >= 11 && $h < 12) $img = 'images/jukebox.gif';
else if ($h >= 12 && $h < 13) $img = 'images/jukebox.gif';
else if ($h >= 13 && $h < 14) $img = 'images/jukebox.gif';
else if ($h >= 14 && $h < 15) $img = 'images/jukebox.gif';
else if ($h >= 15 && $h < 16) $img = 'images/jukebox.gif';
else if ($h >= 16 && $h < 17) $img = 'images/jukebox.gif';
else if ($h >= 17 && $h < 18) $img = 'images/jukebox.gif';
else if ($h >= 18 && $h < 19) $img = 'images/jukebox.gif';
else if ($h >= 19 && $h < 20) $img = 'images/jukebox.gif';
else if ($h >= 20 && $h < 21) $img = 'images/jukebox.gif';
else if ($h >= 21 && $h < 22) $img = 'images/jukebox.gif';
else if ($h >= 22 && $h < 23) $img = 'images/jukebox.gif';
else if ($h >= 23 && $h < 24) $img = 'images/jukebox.gif';
}


// TUESDAY SCHEDULE
if ($d == 2){
if($h >= 0 && $h < 8) $img = 'images/jukebox.gif';
else if ($h >= 8 && $h < 9) $img = 'images/jukebox.gif';
else if ($h >= 9 && $h < 10) $img = 'images/jukebox.gif';
else if ($h >= 10 && $h < 11) $img = 'images/jukebox.gif';
else if ($h >= 11 && $h < 12) $img = 'images/jukebox.gif';
else if ($h >= 12 && $h < 13) $img = 'images/jukebox.gif';
else if ($h >= 13 && $h < 14) $img = 'images/jukebox.gif';
else if ($h >= 14 && $h < 15) $img = 'images/jukebox.gif';
else if ($h >= 15 && $h < 16) $img = 'images/jukebox.gif';
else if ($h >= 16 && $h < 17) $img = 'images/jukebox.gif';
else if ($h >= 17 && $h < 18) $img = 'images/jukebox.gif';
else if ($h >= 18 && $h < 19) $img = 'images/jukebox.gif';
else if ($h >= 19 && $h < 20) $img = 'images/jukebox.gif';
else if ($h >= 20 && $h < 21) $img = 'images/jukebox.gif';
else if ($h >= 21 && $h < 22) $img = 'images/jukebox.gif';
else if ($h >= 22 && $h < 23) $img = 'images/jukebox.gif';
else if ($h >= 23 && $h < 24) $img = 'images/jukebox.gif';
}


// WEDNESDAY SCHEDULE
if ($d == 3){
if($h >= 0 && $h < 8) $img = 'images/jukebox.gif';
else if ($h >= 8 && $h < 9) $img = 'images/jukebox.gif';
else if ($h >= 9 && $h < 10) $img = 'images/jukebox.gif';
else if ($h >= 10 && $h < 11) $img = 'images/jukebox.gif';
else if ($h >= 11 && $h < 12) $img = 'images/jukebox.gif';
else if ($h >= 12 && $h < 13) $img = 'images/jukebox.gif';
else if ($h >= 13 && $h < 14) $img = 'images/jukebox.gif';
else if ($h >= 14 && $h < 15) $img = 'images/jukebox.gif';
else if ($h >= 15 && $h < 16) $img = 'images/jukebox.gif';
else if ($h >= 16 && $h < 17) $img = 'images/jukebox.gif';
else if ($h >= 17 && $h < 18) $img = 'images/jukebox.gif';
else if ($h >= 18 && $h < 19) $img = 'images/jukebox.gif';
else if ($h >= 19 && $h < 20) $img = 'images/jukebox.gif';
else if ($h >= 20 && $h < 21) $img = 'images/jukebox.gif';
else if ($h >= 21 && $h < 22) $img = 'images/jukebox.gif';
else if ($h >= 22 && $h < 23) $img = 'images/jukebox.gif';
else if ($h >= 23 && $h < 24) $img = 'images/jukebox.gif';
}




// THURSDAY SCHEDULE
if ($d == 4){
if($h >= 0 && $h < 8) $img = 'images/jukebox.gif';
else if ($h >= 8 && $h < 9) $img = 'images/jukebox.gif';
else if ($h >= 9 && $h < 10) $img = 'images/jukebox.gif';
else if ($h >= 10 && $h < 11) $img = 'images/jukebox.gif';
else if ($h >= 11 && $h < 12) $img = 'images/jukebox.gif';
else if ($h >= 12 && $h < 13) $img = 'images/jukebox.gif';
else if ($h >= 13 && $h < 14) $img = 'images/jukebox.gif';
else if ($h >= 14 && $h < 15) $img = 'images/jukebox.gif';
else if ($h >= 15 && $h < 16) $img = 'images/jukebox.gif';
else if ($h >= 16 && $h < 17) $img = 'images/jukebox.gif';
else if ($h >= 17 && $h < 18) $img = 'images/jukebox.gif';
else if ($h >= 18 && $h < 19) $img = 'images/jukebox.gif';
else if ($h >= 19 && $h < 20) $img = 'images/jukebox.gif';
else if ($h >= 20 && $h < 21) $img = 'images/jukebox.gif';
else if ($h >= 21 && $h < 22) $img = 'images/jukebox.gif';
else if ($h >= 22 && $h < 23) $img = 'images/jukebox.gif';
else if ($h >= 23 && $h < 24) $img = 'images/jukebox.gif';
}




// FRIDAY SCHEDULE
if ($d == 5){
if($h >= 0 && $h < 8) $img = 'images/jukebox.gif';
else if ($h >= 8 && $h < 9) $img = 'images/jukebox.gif';
else if ($h >= 9 && $h < 10) $img = 'images/jukebox.gif';
else if ($h >= 10 && $h < 11) $img = 'images/jukebox.gif';
else if ($h >= 11 && $h < 12) $img = 'images/jukebox.gif';
else if ($h >= 12 && $h < 13) $img = 'images/jukebox.gif';
else if ($h >= 13 && $h < 14) $img = 'images/jukebox.gif';
else if ($h >= 14 && $h < 15) $img = 'images/jukebox.gif';
else if ($h >= 15 && $h < 16) $img = 'images/jukebox.gif';
else if ($h >= 16 && $h < 17) $img = 'images/jukebox.gif';
else if ($h >= 17 && $h < 18) $img = 'images/jukebox.gif';
else if ($h >= 18 && $h < 19) $img = 'images/strawbs.jpg';
else if ($h >= 19 && $h < 20) $img = 'images/strawbs.jpg';
else if ($h >= 20 && $h < 21) $img = 'images/jukebox.gif';
else if ($h >= 21 && $h < 22) $img = 'images/jukebox.gif';
else if ($h >= 22 && $h < 23) $img = 'images/jukebox.gif';
else if ($h >= 23 && $h < 24) $img = 'images/jukebox.gif';
}


// SATURDAY SCHEDULE
if ($d == 6){
if($h >= 20 && $h < 18) $img = 'http://urban-radio.co.uk/images/strawbs.jpg';
else if ($h >= 8 && $h < 9) $img = 'images/jukebox.gif';
else if ($h >= 9 && $h < 10) $img = 'images/jukebox.gif';
else if ($h >= 10 && $h < 11) $img = 'images/jukebox.gif';
else if ($h >= 11 && $h < 12) $img = 'images/jukebox.gif';
else if ($h >= 12 && $h < 13) $img = 'images/jukebox.gif';
else if ($h >= 13 && $h < 14) $img = 'images/jukebox.gif';
else if ($h >= 14 && $h < 15) $img = 'images/jukebox.gif';
else if ($h >= 15 && $h < 16) $img = 'images/jukebox.gif';
else if ($h >= 16 && $h < 17) $img = 'images/jukebox.gif';
else if ($h >= 17 && $h < 18) $img = 'images/jukebox.gif';
else if ($h >= 18 && $h < 19) $img = 'images/strawbs.jpg';
else if ($h >= 18 && $h < 20) $img = 'http://urban-radio.co.uk/images/strawbs.jpg';
else if ($h >= 20 && $h < 21) $img = 'images/jukebox.gif';
else if ($h >= 21 && $h < 22) $img = 'images/jukebox.gif';
else if ($h >= 22 && $h < 23) $img = 'images/jukebox.gif';
else if ($h >= 23 && $h < 24) $img = 'images/jukebox.gif';
}


// SUNDAY SCHEDULE
if ($d == 0){
if($h >= 0 && $h < 8) $img = 'images/jukebox.gif';
else if ($h >= 8 && $h < 9) $img = 'images/jukebox.gif';
else if ($h >= 9 && $h < 10) $img = 'images/jukebox.gif';
else if ($h >= 10 && $h < 11) $img = 'images/jukebox.gif';
else if ($h >= 11 && $h < 12) $img = 'images/jukebox.gif';
else if ($h >= 12 && $h < 13) $img = 'images/jukebox.gif';
else if ($h >= 13 && $h < 14) $img = 'images/jukebox.gif';
else if ($h >= 14 && $h < 15) $img = 'images/jukebox.gif';
else if ($h >= 15 && $h < 16) $img = 'images/jukebox.gif';
else if ($h >= 16 && $h < 17) $img = 'images/jukebox.gif';
else if ($h >= 17 && $h < 18) $img = 'images/jukebox.gif';
else if ($h >= 18 && $h < 19) $img = 'images/strawbs.jpg';
else if ($h >= 19 && $h < 20) $img = 'images/strawbs.jpg';
else if ($h >= 20 && $h < 21) $img = 'images/jukebox.gif';
else if ($h >= 21 && $h < 22) $img = 'images/jukebox.gif';
else if ($h >= 22 && $h < 23) $img = 'images/jukebox.gif';
else if ($h >= 23 && $h < 24) $img = 'images/jukebox.gif';
}
?>


<html>
<meta http-equiv="Content-Language" content="en-us">
<body bgcolor="#000000">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="170" height="134" id="AutoNumber1" align="right">
<tr>
<td width="171" height="60" bordercolordark="#FF0000" background="#000000">
<p align="center">
<img src="<?php echo $img; ?>"height="100" width="100">
<p align="right">
</td>
</tr>
</table>
</div>
</body>
</html>

am i doing something wrong or what. as its not changing image from autodj to our djs image at 18 to 20

djaubs89
09-02-2017, 11:47 PM
or this code

<script type="text/javascript">
display();
function display() {
var show = "No show scheduled at present";
var GMToffset = -5; // Your current GMT offset, whether Standard or Daylight
var now = new Date();
var dy = now.getDay(); // day of week 0-6
now.setHours(GMToffset + now.getHours() + now.getTimezoneOffset() / 60);
var hh = now.getHours();
var mn = now.getMinutes();
var ss = now.getSeconds();
hh = hh + (mn/60); // minutes expressed as fractions of an hour




// The GMT offset ensures that every visitor, regardless of their timezone, will see the schedule
// that is appropriate for the site owner's local time.




// Tip - for testing purposes you can put here
//dy = 5;
//hh = 9.25;
// or whatever to check that the right show appears at that day/time.


if (dy == 0) { // Sundays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/strawbs.jpg";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 1) { // Mondays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 2) { // Tuesdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 3) { // Wednesdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 4) { // Thursdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=13 && hh <17) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 5) { // Fridays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/strawbs.jpg";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


else if (dy == 6) { // Saturdays
if (hh >=0 && hh <1) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=1 && hh <3) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=3 && hh <6) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=5 && hh <13) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/strawbs.jpg";}
else if (hh >=17 && hh <18) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=18 && hh <20) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=20 && hh <21) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=21 && hh <22) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
else if (hh >=22 && hh <24) {show = "http://urban-radio.co.uk/images/jukebox.gif";}
}


var a = '<img src="' + show + '" />';
document.getElementById("dj").innerHTML = a;


setTimeout(function(){display()}, 60000); // update every 60 seconds
}


</script>

i have put in what you said

but i dont work

<div id="dj">
<script type="text/javascript">
display();
</script>
</div>

djaubs89
09-02-2017, 11:51 PM
could someone please put the fully functional script in here please then i can add it to my site, because the code that i have
has just changed to my dj image and its now 12:50am in the morning on the 3rd of september and im not on air im on air from 18 till 20

please help

PapaBearPW
09-04-2017, 07:00 AM
You didn't finish what I was saying to do in my last post.

"As to setting it to UK time, you should just need to set the variable near the top of the javascript called GMToffset to +1 instead of -5."

You still have:


var GMToffset = -5; // Your current GMT offset, whether Standard or Daylight

For London, it should be:


var GMToffset = +1; // Your current GMT offset, whether Standard or Daylight

I have no intention of re-posting the entire script for that one line.

If you want to have a functioning website with all the bells and whistles you like, you have 2 options:

1. Pay someone to build it and maintain it for you, with all the little changes you want.
2. Start learning how scripts like this work so you can do it yourself.

There are at least 3 different "on air" scripts that you are asking for help on. Pick one and learn how it works. Nobody here wants to re-write a script for you, every time your DJ schedule might change!

RDJUser
09-04-2017, 07:55 AM
could someone please put the fully functional script in here please then i can add it to my site, because the code that i have
has just changed to my dj image and its now 12:50am in the morning on the 3rd of september and im not on air im on air from 18 till 20

please help

Careful djaubs89 (http://forums.broadcastingworld.com/member.php/15818-djaubs89) your starting to sound really needy now... You seem to be attempting to run before you can walk.

You seriously need to learn how html/php/css work before you can seriously think about programming the features you want in your website.

Either that or as Papabear suggested you pay some one hundreds/thousands or $$$ to build your site for you. I've seen your current site and its very amateurish to say the least.

If the scripts from this forum aren't doing the job then there's not a lot anyone can do about it most of the scripts were intended for entertainment purposes only anyway so they weren't perfect in the first place.

djaubs89
10-24-2017, 07:11 PM
apparently according to codingforums when 106themix was around they used a dj center to upload there dj images along with some coding
to put on there website? does anyone know were i can get a dj center

ultra89
10-28-2017, 06:07 PM
this script is not working for me


<div align=center><?php function onAirNow() { // James' Show On Air Script // http://broadcastingworld.com/
// Set the timezone // See full list of timezones here: http://php.net/manual/en/timezones.php date_default_timezone_set('Europe/London');
// Set default text and default image | When a show is not on air, this text and image will display $default_on_air = ''; // Default text $default_image_on_air = 'http://urban-radio.co.uk/images/offline.png'; // Default image
// Shows array, edit this information for each show $shows = [ [ 'show_name' => "Monday", // Show name 'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Tuesday", // Show name 'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Wednesday", // Show name 'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Thursday Jukebox", // Show name 'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Friday Strawbs", // jay's show 'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/images/strawbs.jpg' ], [ 'show_name' => "Saturday Strawbs", // Jay's Show 'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/images/strawbs.jpg' ], [ 'show_name' => "Sunday Sunday", // 80's 'day' => "Sunday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/images/strawbs.jpg' ] ];
///////////////////////////////////////////////////// ////////// DO NOT EDIT BELOW THIS LINE ////////////// /////////////////////////////////////////////////////
$now_day = date('l'); $now_time = date('G');
$output = array($default_on_air, $default_image_on_air);
for($i = 0; $i < count($shows); $i++) { if($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time'] < $now_time) { $output = array($shows[$i]['show_name'], $shows[$i]['image']); } }
return $output;
} ?>ON AIR NOW:<br /><img src="<?php echo onAirNow()[1]; ?>"><br /><h3><?php echo onAirNow()[0]; ?></h3>

</body></html>

James
10-29-2017, 04:42 AM
this script is not working for me


<div align=center><?php function onAirNow() { // James' Show On Air Script // http://broadcastingworld.com/
// Set the timezone // See full list of timezones here: http://php.net/manual/en/timezones.php date_default_timezone_set('Europe/London');
// Set default text and default image | When a show is not on air, this text and image will display $default_on_air = ''; // Default text $default_image_on_air = 'http://urban-radio.co.uk/images/offline.png'; // Default image
// Shows array, edit this information for each show $shows = [ [ 'show_name' => "Monday", // Show name 'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Tuesday", // Show name 'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Wednesday", // Show name 'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Thursday Jukebox", // Show name 'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Friday Strawbs", // jay's show 'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/images/strawbs.jpg' ], [ 'show_name' => "Saturday Strawbs", // Jay's Show 'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/images/strawbs.jpg' ], [ 'show_name' => "Sunday Sunday", // 80's 'day' => "Sunday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/images/strawbs.jpg' ] ];
///////////////////////////////////////////////////// ////////// DO NOT EDIT BELOW THIS LINE ////////////// /////////////////////////////////////////////////////
$now_day = date('l'); $now_time = date('G');
$output = array($default_on_air, $default_image_on_air);
for($i = 0; $i < count($shows); $i++) { if($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time'] < $now_time) { $output = array($shows[$i]['show_name'], $shows[$i]['image']); } }
return $output;
} ?>ON AIR NOW:<br /><img src="<?php echo onAirNow()[1]; ?>"><br /><h3><?php echo onAirNow()[0]; ?></h3>

</body></html>

Ok? Why isn't it working? What are you expecting it to do? Be more specific, PLEASE!

ultra89
10-29-2017, 10:14 AM
basically when i or any other dj goes on air it wont bring up our images
i tried looking at it at 6pm yesterday (Saturday) and it didnt show up my image? why is that

James
10-29-2017, 01:36 PM
basically when i or any other dj goes on air it wont bring up our images
i tried looking at it at 6pm yesterday (Saturday) and it didnt show up my image? why is that

Okay, a bit more specific. So the correct DJ name shows, but the image doesnt? Is that correct?

ultra89
10-29-2017, 01:38 PM
yes thats correct i want the image to show at 6pm every friday saturday and sunday from 6pm till 8pm

ultra89
10-30-2017, 01:24 AM
mattskills you're on-air script whats DH mean and i work from friday saturday and sunday 6pm till 8pm
uk time so what would that be

James
10-30-2017, 02:26 AM
yes thats correct i want the image to show at 6pm every friday saturday and sunday from 6pm till 8pm
What displays? Does the image display broken? Or what?
Post a screenshot.

ultra89
10-30-2017, 10:10 AM
1725this is the screenshot james it don't change image from autodj to the current dj thats on air. i have set you're script rite

James
10-30-2017, 11:37 AM
You said that the DJ name shows correctly. As in when a live show is on air (NOT auto dj), the name shows, but the image doesnt. You confirmed that to me.
Now you say that that's not the case?

ultra89, I can't help you if you cannot help me by providing detailed information. We are going around in circles here.

ultra89
10-30-2017, 12:04 PM
no lol basically when the image is not on autodj i don't show up with the current dj, so say i have a dj thats on from 3pm till 5pm for example it will not show there image? it just stays on autodj image when it should be changing to that current dj's image

ultra89
10-30-2017, 12:06 PM
<?php function onAirNow() { // James' Show On Air Script // http://broadcastingworld.com/
// Set the timezone // See full list of timezones here: http://php.net/manual/en/timezones.php date_default_timezone_set('Europe/London');
// Set default text and default image | When a show is not on air, this text and image will display $default_on_air = ''; // Default text $default_image_on_air = 'http://urban-radio.co.uk/images/offline.png'; // Default image
// Shows array, edit this information for each show $shows = [ [ 'show_name' => "Monday", // Show name 'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Tuesday", // Show name 'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Wednesday", // Show name 'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Thursday Jukebox", // Show name 'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 01, // Start Time (24 hour format) 'end_time' => 23, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/images/offline.png' ], [ 'show_name' => "Friday Strawbs", // jay's show 'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png' ], [ 'show_name' => "Saturday Strawbs", // Jay's Show 'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png' ], [ 'show_name' => "Sunday Sunday", // 80's 'day' => "Sunday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday) 'start_time' => 18, // Start Time (24 hour format) 'end_time' => 20, // End Time (24 hour format) 'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png' ] ];
///////////////////////////////////////////////////// ////////// DO NOT EDIT BELOW THIS LINE ////////////// /////////////////////////////////////////////////////
$now_day = date('l'); $now_time = date('G');
$output = array($default_on_air, $default_image_on_air);
for($i = 0; $i < count($shows); $i++) { if($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time'] < $now_time) { $output = array($shows[$i]['show_name'], $shows[$i]['image']); } }
return $output;
} ?>ON AIR NOW:<br /><img src="<?php echo onAirNow()[1]; ?>"><br /><h3><?php echo onAirNow()[0]; ?></h3>

</body></html>

this is the script i am on about

James
10-30-2017, 12:29 PM
Well first of all, half of your script is commented out and incorrectly formatted. So it won't run.
You are not using the script exactly how I posted it in my other thread. Ensure you use a proper code editor as the code structure is very important.

I've just spent the last half hour fixing up your formatting issues, let me know how you go:


<?php
// James' Show On Air Script
// http://broadcastingworld.com/
function onAirNow() {
// Set the timezone
// See full list of timezones here: http://php.net/manual/en/timezones.php
date_default_timezone_set('Europe/London');


// Set default text and default image | When a show is not on air, this text and image will display
$default_on_air = ''; // Default text
$default_image_on_air = 'http://urban-radio.co.uk/images/offline.png'; // Default image


// Shows array, edit this information for each show
$shows = [
[
'show_name' => "Monday", // Show name
'day' => "Monday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
'start_time' => 01, // Start Time (24 hour format)
'end_time' => 23, // End Time (24 hour format)
'image' => 'http://urban-radio.co.uk/images/offline.png'
],
[
'show_name' => "Tuesday", // Show name
'day' => "Tuesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
'start_time' => 01, // Start Time (24 hour format)
'end_time' => 23, // End Time (24 hour format)
'image' => 'http://urban-radio.co.uk/images/offline.png'
],
[
'show_name' => "Wednesday", // Show name
'day' => "Wednesday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
'start_time' => 01, // Start Time (24 hour format)
'end_time' => 23, // End Time (24 hour format)
'image' => 'http://urban-radio.co.uk/images/offline.png'
],
[
'show_name' => "Thursday Jukebox", // Show name
'day' => "Thursday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
'start_time' => 01, // Start Time (24 hour format)
'end_time' => 23, // End Time (24 hour format)
'image' => 'http://urban-radio.co.uk/images/offline.png'
],
[
'show_name' => "Friday Strawbs", // jay's show
'day' => "Friday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
'start_time' => 18, // Start Time (24 hour format)
'end_time' => 20, // End Time (24 hour format)
'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'
],
[
'show_name' => "Saturday Strawbs", // Jay's Show
'day' => "Saturday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
'start_time' => 18, // Start Time (24 hour format)
'end_time' => 20, // End Time (24 hour format)
'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'
],
[
'show_name' => "Sunday Sunday", // 80's
'day' => "Sunday", // Day (Monday/Tuesday/Wednesday/Thursday/Friday/Saturday/Sunday)
'start_time' => 18, // Start Time (24 hour format)
'end_time' => 20, // End Time (24 hour format)
'image' => 'http://urban-radio.co.uk/new/djimages/strawbs.png'
]
];
/////////////////////////////////////////////////////
////////// DO NOT EDIT BELOW THIS LINE //////////////
/////////////////////////////////////////////////////
$now_day = date('l');
$now_time = date('G');
$output = array(
$default_on_air,
$default_image_on_air
);
for ($i = 0; $i < count($shows); $i++) {
if ($shows[$i]['day'] == $now_day && $shows[$i]['start_time'] >= $now_time && $shows[$i]['end_time'] < $now_time) {
$output = array(
$shows[$i]['show_name'],
$shows[$i]['image']
);
}
}
return $output;
}
?>
ON AIR NOW:<br />
<img src="<?php echo onAirNow()[1]; ?>"><br />
<h3><?php echo onAirNow()[0]; ?></h3>

ultra89
10-30-2017, 12:37 PM
ok many thanks and will the script show up with the current dj's image as well as there name

James
10-30-2017, 10:58 PM
ok many thanks and will the script show up with the current dj's image as well as there name

Well it works for me.. I dont know, you tell me if it's not working for you!