Somewhat Daily Image Script
Posted: Tue Jun 05, 2007 12:25 am
I want to create something very simple but, having not coded anything in a few years (limited then anyway), I'm having trouble wrapping my head around it. What I'd like is to have is a single index.php file and just upload image files (jpg and gif) into the same folder in this format:
1-06052007-000000.jpg
2-06062007-ffffff.jpg
3-06082007-ff0000.gif
Then I'd like index.php to include:
...
background: #ff0000;
...
<a href="?page=2"><img src="3-06082007-ff0000.gif" width="width" height="height" alt="June 8, 2007 - Page 3" /></a>
So... It would be something to the effect of:
opendir > only image files (jpg, gif, png) > array (reverse?)> explode highest number([0] if reverse I suppose) or "?page"> break apart "-" to array > link to the one before current, unless there isn't one then redirect to highest number
I have a lot of the elements and I've been looking over tons of functions, but I'm having trouble bringing it all together with my lack of experience.
Does this make sense?
1-06052007-000000.jpg
2-06062007-ffffff.jpg
3-06082007-ff0000.gif
Then I'd like index.php to include:
...
background: #ff0000;
...
<a href="?page=2"><img src="3-06082007-ff0000.gif" width="width" height="height" alt="June 8, 2007 - Page 3" /></a>
So... It would be something to the effect of:
opendir > only image files (jpg, gif, png) > array (reverse?)> explode highest number([0] if reverse I suppose) or "?page"> break apart "-" to array > link to the one before current, unless there isn't one then redirect to highest number
I have a lot of the elements and I've been looking over tons of functions, but I'm having trouble bringing it all together with my lack of experience.
Does this make sense?