matafy Posted October 22, 2009 Share Posted October 22, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.