Automated photo gallery retriever

May 20, 2011 at 17:10:42
Specs: N/A
Is it possible to set the href and img to display the last file in a given folder? Then the second group of links would display the second last file and so on. I have a photo gallery that is getting harder and harder to update manually.

Current code:
<section class="gallery-item grid_3">
<a class="gallery-image round-3" href="../assets/720/1.jpg" title="#732346" rel="prettyPhoto[gal]">
<span class="gallery-image-inner">



The title="# and alt are also updated manually but that's a smaller problem.

See More: Automated photo gallery retriever

Report •

May 21, 2011 at 12:50:41
If you have server side scripting, you could use a file's mod time to determine which one is newest; for example, php has filemtime that returns an a unix timestamp (integer value). As the page is generated, you could use the function to update your latest image location and whatnot. Other scripting languages probably have similar functions.

On the client side, I'm not sure if there is a viable solution that would work for all clients - perhaps someone else knows.


Report •
Related Solutions

Ask Question