This should get ya going, it will be easier to understand.
(hopefully GFY wont hack it up, if it does I'll post it to
http://www.xamo.com/carlito.html)
---------------------- START CODE --------------------
<?
define('MAX_FILES', 365);
//$dir="/home/virtual/site16/fst/var/www/html/members/vids/";
$dir="/www/internal/xamo.com/images/";
$dp=opendir($dir);
if($dp){
while(false != = ($item = readdir($dp))){
if ( $item = = '.' || $item = = '..' ){
// Do nothing
}else{
if (file_exists($dir.$item)){
$mtime=filemtime($dir.$item);
$p=pathinfo($dir.$item);
$ext=strtolower($p["extension"]);
if($ext= ="gif" || $ext= ="jpg"){
// its an image
$all_files[$mtime][0] = $item;
}
if($ext= ="avi" || $exthahahaha"mov" || $exthahahaha"mpg"){
// its a video
$all_files[$mtime][1] = $item;
}
if(is_dir($dir.$item)){
// its a directory
$all_files[$mtime][2] = $item;
}
}
}
}
krsort($all_files);
echo "<table border=1 cellspacing=0 cellpadding=2>";
echo "<tr><td><b>Date</b></td><td><b>Image</b></td><td><b>Video</b></td><td><b>Directory</b></td></tr>\n";
foreach($all_files as $time=>$files){
$_img = $files[0];
$_vid = $files[1];
$_dir = $files[2];
$date = date("m.d.y", $time);
if (++$count > MAX_FILES){
break;
}else{
echo "<tr><td>[$date]</td><td>$_img</td><td>$_vid</td><td>$_dir</td></tr>\n"; // Where it says %s is where the name of the output file resides.
}
}
echo "</table>";
closedir($dp);
}else{
echo "Could not open directory.\n";
}
?>
-------------------------- END CODE -------------------