howdy...
just go through the files grabbing info as you go using the functions...
filemtime(filename) - time last modified
fileowner(filename) - file owner
blah blah... here, have some code... (i like to keep the reading of a dir. seperate from the layout of the table... personal preference, and it lets you sort the array easily... 🙂 )
// Grab the files in the user's directory and put them into an array
$dir = dir("$ROOT_DIR/$user");
while($entry = $dir->read()) {
if($entry != "." && $entry != "..") {
$files[] = $entry;
$numfiles++;
}
}
$dir->close();
if($files) {
$html .= "\n<!-- File list for $user -->\n";
$html .= " <table width=95% cellpadding=4 cellspacing=0 border=0>\n";
// Show column headers
$html .= " <tr>\n";
$html .= " <td>Filename</td>\n";
$html .= " <td>Size</td>\n";
$html .= " <td>Last Modified</td>\n";
$html .= " </tr>\n";
// Sort the files by filename
sort($files);
// Display the files and their details
for($i = 0; $i < $numfiles; $i++) {
$entry = $files[$i];
$full_filename = "$ROOT_DIR/$user/".$files[$i];
// Grab info about the file
$file_size = filesize($full_filename);
$total_size += $file_size;
$mod_time = pretty_time(filemtime($full_filename));
$html .= " <tr>\n";
$html .= " <td>$entry</td>\n";
$html .= " <td>$file_size</td>\n";
$html .= " <td>$mod_time</td>\n";
$html .= " </tr>\n\n";
}
$html .= " <tr>\n";
$html .= " <td>$numfiles file(s)</td>\n";
$html .= " <td colspan=2>$total_size bytes</td>\n";
$html .= " </tr>\n";
$html .= "</table></p>\n";
} else {
$html .= "<p>No files</p>\n";
}
dom
🙂