Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.txt | 2010-07-14 | 1.6 kB | |
php-list-contents-of-a-directory_v0.1.zip | 2010-07-14 | 2.5 kB | |
Totals: 2 Items | 4.1 kB | 0 |
Written by Sam Gleske and George Purkins This is a simple php script which turns any directory into a directory viewable on the web. This script is designed with an intranet in mind. This script originated from: http://www.liamdelahunty.com/tips/php_list_a_directory.php This script is an improved and more accurate version from the original. Features include: 1. Breadcrumb folder path 2. Folders with names longer than 10 chars get shortened to 10 chars in the breadcrumb. 3. Simple Parent Directory 4. Parses files and folders in the current directory. Lists folders first, then lists all files. 5. All listings are sorted A-Z alphabetical. 6. Script copies itself to the listed subdirectories (not all subdirectories) for recursive viewing in folders. 7. File and directory sizes are calculated using du -sh. This is only available on Unix/Linux systems. Recommendations: 1. For Windows, on lines 99 and 113 you see filesize() is commented out and instead you see the function getdirsize(). getdirsize() function uses a command only found in Unix/Linux systems called du. This command is not available in Windows. I recommend you comment out getdirsize() and uncomment filesize() as that is a built in php command. The getdirsize() is more accurate for calculating large files and folders. 2. Name the index.php file to .index.php. This way it is hidden from itself. Also name any graphics such as a logo to .logo.png and place it in the root of the web directory so you can reference it like /.logo.png. I suggest going into httpd.conf in apache (or your favorite web server) and setting the directory index to .index.php.