Joined: 14 Jul 2006
Location: Arizona, w00t
|Posted: Tue Jul 25, 2006 8:10 am Post subject: Simply Advanced Directory Listing Script
|I made this script because I couldn't seem to find any good automated directory listing scripts that worked seamlessly with AWS, or they didn't fit my likings. This script is slightly based off the sample script that's provided with AWS, located in the server's documentation. There are a few little things that this script will automatically do that most directory listing scripts will automatically:
O This script automatically replaces the "../" Link with "Go Back", for visual friendliness.
O If the file does not have a $size, or $size is 0, then $size is set to nothing.
O If the file does not have a $mimetype, then $mimetype is set to "Directory", because 99% of the time, thats what it would be.
O This script automatically determines what unit of measurement to use with $size, Byte(s), KB, MB, or GB. Anything greater than 1024GB is left with the GB measurement.
O This script automatically URL Encodes the link to the file/folder (" " -> "%20"), and URL Decodes the link name (What is shown on the page).
On the earlier versions of this script, I had wanted to have it automatically replace the mimetype with the name of the mimetype. For instance, replace "video/quicktime" with "Quicktime Video", replace "application/octet-stream" with "Application", and so on. This proved difficult to do at the time, so I dropped it. It's fine without it at the time anyways. If anyone wants to try making up this part, go for it, I'd like to see how you write the code, maybe I'll add it to mine!
Download here: http://dyslexia.zapto.org/projects/dirlisting.php.gz (GZIP Archive, 662 Bytes)