<!-- SophiaKnows -->

PHP: PICTURE OF THE DAY
Rev 4: December 2004

<?php
/* --------------------------------- */
/*     SOPHIAKNOWS: PHP LIBRARY      */
/* --------------------------------- */
/*          DAILY IMAGES             */
/* --------------------------------- */
/*  Created:  2003-01-01             */
/*  Issued:   2003-01-01             */
/*  Modified: 2004-12-28             */
/*  Component: PHP DAILY IMAGES      */
/*  Copyright (c) 2003-2004          */
/*  Tony Pisarra, SophiaKnows        */
/* --------------------------------- */
/* --------------------------------- */

/* --------------------------------- *\

   This template displays an 
   automated daily image library
   and date ordered archive based
   on:

        A YYYY-MM-DD.jpg filename
        convention	

\* --------------------------------- */

// SET RELATIVE PATH TO THUMBNAILS
$thumbpath="thumbs/";

// SET RELATIVE PATH TO BIG IMAGE
$bigpath="big/";

$start=(($start)?$start:0);	

for($i=0;$i<7;$i++) {
	$daily_images[$i]=date("Y-m-d.\j\p\g",time()-(($start+$i)*86400));
	}

for($x=0;$x<7;$x++) {
	$thumbs.="<p><a href=\"javascript:SwapImage('baseimage','";
	$thumbs.=$bigpath."".$daily_images[$x];
	$thumbs.="')\">";
	$thumbs.="<img src=\"".$thumbpath."".$daily_images[$x]."\"">";
	$thumbs.="</a></p>\n";
	}

?>	
<title>PHP: Daily Image</title>

<script type='text/javascript'>
function SwapImage(n,s) {
    document.images[n].src=s;
    }
</script>
<body links=#000077 vlink=#666666>
<center>
<font face=verdana,geneva,arial>

<p>&lt; <a href=pod.php?start=0>This Week</a>  |  Prior Weeks: 
	 <a href=pod.php?start=7>1</a> 
	 <a href=pod.php?start=14>2</a> 
	 <a href=pod.php?start=21>3</a> 
	 <a href=pod.php?start=28>4</a> 
	 |  <a href=pod.php.html title="view source code">Archive</a> 
	&gt;

<br /><br />
<table width=100%><tr>
<td width=200><font face=verdana,geneva,arial size=1>
	<?php echo ($thumbs); ?>

</td>
<td width=* align=center><font face=verdana,geneva,arial size=+1>
<img src="big/<? echo $daily_images[0] ?> name=baseimage">
</td>
</tr></table>
</body>

< CODEBASE | TOP^ | MAINPAGE >

Text & Design By Tony Pisarra
© SophiaKnows 1998-2004