PDA

View Full Version : Help nowplaying



djaubs89
07-15-2017, 10:57 PM
can someone please help me out, this is giving me a headace lol

it dont show my image at all just the background


<?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 SCHEDULEif ($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 SCHEDULEif ($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 SCHEDULEif ($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 SCHEDULEif ($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 SCHEDULEif ($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 SCHEDULEelse 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 SCHEDULEelse 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="#000000"><p align="center"><img src="<?php echo $img; ?>"height="100" width="100"><p align="right"></td></tr></table></div></body></html>

Matt Skills
09-14-2017, 01:32 PM
you need a space between <?php and $h = , also , your code is all commented out with //

this is how it should look


<?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


else 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


else 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="#000000"><p align="center"><img src="<?php echo $img; ?>"height="100" width="100"><p align="right"></td>
</tr>
</table>
</div>


</body>
</html>