Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:55 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc