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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.