Brookfresh: client area
files
print "
";
function getFiles($path) {
//Function takes a path, and returns a numerically indexed array of associative arrays containing file information,
//sorted by the file name (case insensitive). If two files are identical when compared without case, they will sort
//relative to each other in the order presented by readdir()
$files = array();
$fileNames = array();
$i = 0;
if (is_dir($path)) {
if ($dh = opendir($path)) {
while (($file = readdir($dh)) !== false) {
if ($file == "." || $file == "..") continue;
$fullpath = $path . "/" . $file;
$fkey = strtolower($file);
while (array_key_exists($fkey,$fileNames)) $fkey .= " ";
$a = stat($fullpath);
$files[$fkey]['size'] = $a['size'];
if ($a['size'] == 0) $files[$fkey]['sizetext'] = "-";
else if ($a['size'] > 1024) $files[$fkey]['sizetext'] = (ceil($a['size']/1024*100)/100) . " K";
else if ($a['size'] > 1024*1024) $files[$fkey]['sizetext'] = (ceil($a['size']/(1024*1024)*100)/100) . " Mb";
else $files[$fkey]['sizetext'] = $a['size'] . " bytes";
$files[$fkey]['name'] = $file;
$files[$fkey]['type'] = filetype($fullpath);
$files[$fkey]['date'] = filemtime($fullpath);
$files[$fkey]['extension'] = strtolower(strrchr($file,"."));
$fileNames[$i++] = $fkey;
}
closedir($dh);
} else die ("Cannot open directory: $path");
} else die ("Path is not a directory: $path");
sort($fileNames,SORT_STRING);
$sortedFiles = array();
$i = 0;
foreach($fileNames as $f) $sortedFiles[$i++] = $files[$f];
return $sortedFiles;
}
$files = getFiles("files");
$x = 0;
foreach ($files as $file)
if($file[type] == "file"){
$x++;
if($file[extension] == ".odt"){
print "
$file[name] ... size:$file[sizetext]< delete ";
}else if($file[extension] == ".doc"){
print "
$file[name] ... size:$file[sizetext]< delete ";
}else if($file[extension] == ".zip"){
print "
$file[name] ... size:$file[sizetext]< delete ";
}else if($file[extension] == ".pdf"){
print "
$file[name] ... size:$file[sizetext]< delete ";
}else if($file[extension] == ".psd"){
print "
$file[name] ... size:$file[sizetext]< delete ";
}else if($file[extension] == ".eps" || $file[extension] == ".ai"){
print "
$file[name] ... size:$file[sizetext]< delete ";
}else{
print "
$file[name] ... size:$file[sizetext]< delete ";
}
} else if($file[name] != "_notes"){
print "
$file[name] ";
}
if($x==0){
print "
";
print "
sorry there are no files to display.
";
print "
";
print "
Filetypes: .jpeg, .JPG, .jpg, .gif, .bmp, .ai, .pdf, .psd, .eps, .png, .zip, .rarw
";
print "

";
}else{
print "";
print "
You may need to right-click your mouse and select 'save target'
";
print "
Upload file
";
}
?>
linkS
- There are no links to display at the moment.
SOFTWARE LINKS
Open office is a FREE replacement for the microsoft office suite, it is also 100% compatible with Microsoft Office.
Skype is the software we use at Brookfresh to allow free phone calls over the internet, you will need a microphone and speakers or a VOIP telephone
click here to buy
