Huzzah! Here is how you can sort your array if you have the date/filename in it... much simpler than i thought:
PHP Code:
<?php
// Example unsorted array
// I'll leave it up to you to figure out how to build this array
// Unless you can't in which case I'll give you a hand ;P
$thumbs = array(
array('231','filename.jpg'),
array('312','filename2.jpg'),
array('123','filename3.jpg'));
// This will sort $thumbs by the first index of the second dimension...
sort($thumbs);
// Output the example
foreach($thumbs as $key => $value){
echo 'Name: '.$thumbs[$key][1].'<br>';
echo 'Num: '.$thumbs[$key][0].'<br><br>';
}
?>
Just give me a yell if you need help building your thumbs array...
Edit: oh, here's the output of that script:
Name: filename3.jpg
Num: 123
Name: filename.jpg
Num: 231
Name: filename2.jpg
Num: 312
To reverse this (i.e. output by LATEST date instead of earliest) just stick in $thumbs = reverse_array($thumbs) before your output code...