View Single Post
Old 2006-01-12, 04:31 PM   #9
oast
With $10,000, we'd be millionaires! We could buy all kinds of useful things like ... love!
 
oast's Avatar
 
Join Date: May 2004
Location: UK
Posts: 316
PHP has a lot of date related functions, so a list of 365 pictures could be put into an array and a key could be pulled out corresponding to the day of the year.
date(z); gives you a number from 0-365
http://www.php.net/date


Here is a simple POTD consisting of 365 images using seperate thumbnails and links to fullsize images
PHP Code:
<?php
$pics
=array(array('pic1','thumb1','Picture 1'),
array(
'pic2','thumb2','Picture 2'),
array(
'pic3','thumb3','Picture 3'),
array(
'pic4','thumb4','Picture 4'),
... 
etc
);
$today=date('z');
echo 
"<a href=\"{$pics[$today][0]}\"><img src=\"{$pics[$today][1]}\" alt=\"{$pics[$today][2]}\" border=\"0\" /></a><br />\n";
?>
Link to Picture is 1st part of array, then the URL of the thumbnail and finally the text for the alt tag.

HTH

Steve
__________________
Playboy Webmasters - The name says it all! $35 per signup or 60% revshare.

Last edited by oast; 2006-01-12 at 04:46 PM..
oast is offline   Reply With Quote