frquency Posted October 23, 2008 Share Posted October 23, 2008 Hello, I am wondering if anyone can help me here, im looking for some info on where to start with this: I would like to know how I can display a different image based on the time of day perticulary minutes. for example user visits page at 12:02 and gets images "1202.jpg" but if visits at "12:32" they will get the image "1232.jpg" I have seen this done to display radio station DJ's but this was by the hour. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/ Share on other sites More sharing options...
trq Posted October 23, 2008 Share Posted October 23, 2008 <img src="<?php echo date('Hi); ?>.jpg"> Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-672353 Share on other sites More sharing options...
CroNiX Posted October 23, 2008 Share Posted October 23, 2008 I can see this being done with 3 images. 1) Blank clock face 2) Hour hand (everything else transparent) 3) Minute hand. (everything else transparent) Then its just a matter of using the GD image library and rotating the hour and minute images to the correct time. Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-672354 Share on other sites More sharing options...
trq Posted October 23, 2008 Share Posted October 23, 2008 Hehe, knowone said anything about making a clock. Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-672356 Share on other sites More sharing options...
CroNiX Posted October 23, 2008 Share Posted October 23, 2008 I would like to know how I can display a different image based on the time of day perticulary minutes. for example user visits page at 12:02 and gets images "1202.jpg" but if visits at "12:32" they will get the image "1232.jpg" Thats how I took this statement...seems like a clock to me? Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-672362 Share on other sites More sharing options...
frquency Posted October 23, 2008 Author Share Posted October 23, 2008 Yea kinda right there like a clock that displays a different image for each minute Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-673242 Share on other sites More sharing options...
frquency Posted October 23, 2008 Author Share Posted October 23, 2008 sorry for double post cant see the edit button ??? yea like a clock but maybe an image for each minute say pictire of a car then next image pictire of a tree . just a curious project really Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-673256 Share on other sites More sharing options...
jrm Posted October 24, 2008 Share Posted October 24, 2008 What you are looking for is a combination of php/java/html. Add <META HTTP-EQUIV="refresh" CONTENT="15"> inside the <head></head> and then add a script in either php or java, whatever flavor you like, to get a timestamp, and run it thru a switch(). Or you can have just a random image from an array loaded. something like: <?php $Picture_array = array("image1.jpg","image2.jpg","image3.jpg","image4.jpg"); $Randomnumber= rand(1,4); $picture = $Picture_array[$Randomnumber]; ?> <html> <head> <meta http-eqiv="refresh" content = "60" > </head> <body> <image src="<?php echo $picture; ?>" width=180 height=180> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-673684 Share on other sites More sharing options...
The Little Guy Posted October 24, 2008 Share Posted October 24, 2008 You could place all images in one image, and use that image as a background image, then using JavaScript reposition the background... Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-674005 Share on other sites More sharing options...
frquency Posted October 24, 2008 Author Share Posted October 24, 2008 Thnaks , Ill have a play around with what you have said in this thread, you can close this if you like now Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-674033 Share on other sites More sharing options...
haku Posted October 25, 2008 Share Posted October 25, 2008 What you are looking for is a combination of php/java/html. Java is not javascript. They are very different languages. <META HTTP-EQUIV="refresh" CONTENT="15"> This isn't a good way to do refreshes - search engines don't like it. The preferred method is: header ('Refresh: 3; url=index.html'); Quote Link to comment https://forums.phpfreaks.com/topic/129677-php-image-rotation-based-on-time-minutes/#findComment-674245 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.