Jump to content

[Need Help] Rotating Image Isue...


matafy

Recommended Posts

I have this code running on my server time 24/7. Originally I wanted it show only one image every hour on the hour for only 12 hours, then on the other 12 hours show a default image. Since then I had just decided to show an image once every hour on the hour for 24 hours strait. What I am looking for is to show multible images at one time. For example;

 

image 1 (Mon 8am show time) = to be shown on Mon 8am

image 2 (Mon 9am show time) = to be shown on Mon 8am

image 3 (Mon 10am show time) = to be shown on Mon 8am

 

and when 9am rolls around. Have the images rotate for that day;

 

image 2 (Mon 9am show time) = to be shown on Mon 9am

image 3 (Mon 10am show time) = to be shown on Mon 9am

image 4 (Mon 11am show time) = to be shown on Mon 9am

 

here is the code:

<?PHP 
function currentImage(){ 
    $imagePath = "img/"; 
    if (date(H) < 09 || date(H) > 21) { 
        return $imagePath."".date(D)."/".date(H).".png"; 
    } else { 

        return $imagePath."".date(D)."/".date(H).".png"; 
    } 
} 
?>

 

My goal is to echo the first image at a certain time, like maybe 8am, then echo the 9am image underneath it and then the 10am image underneath the 9am image and so on.... Can anyone help?

 

Thank you in advance,

Matafy

Link to comment
https://forums.phpfreaks.com/topic/178580-need-help-rotating-image-isue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.