PHP Easy Downloader V 0.995 --------------------------- This is a simple to use script for generating an "on the fly" download library. How to install. --------------- Simply place the index.php and File_Info directory into a folder that contains the stuff you want to make available to download. The script will do the rest of the work. If you later add or remove download files from the directory, the script will automatically adjust. UNIX and LINUX users must: chmod 755 /file_info chmod 755 /file_info/admin chmod 777 /file_info/descriptions chmod 775 /file_info/icons chmod 777 /file_info/thumbs How to call the script. ----------------------- Just point your browser to your site and location where the script (and your downloadable files) resides. If your downloads were located in a directory called "downloads" just under your http root directory, just go to: http://www.your-site.com/downloads/index.php Requirements ------------ A web server running PHP GD Library recommended but not required. Script Features: ---------------- 01) This script doesn't require MySQL. 02) You specify which file extensions are to be cataloged. 03) The script will take advantage of the GD Library by generating thumbnails of any jpg image that exists in your download directory (if GD library is enabled.) The thumbnails are only generated once and cached to help conserve server load. The script should run fine without the GD Library however. 04) You sort the download list alphanumerically, by file size, or # of downloads 05) The script paginates and allows your user to set the number of displayed download files per page. 06) It will keep track of how many times files are accessed or downloaded allowing you to track which files are most popular. 07) You can search for file names using keywords. 08) You can search file descriptions using keywords. 09) Includes a "Top 10 Downloads" link. 10) Includes an Admin function that allows you to edit file descriptions and other info. 11) A few people have asked to be able to make their own icons for certain downloads. Here's how the feature works. Say you have a download called foobar.zip. You can make an icon using your favorite graphic editor. The icon should be 64 pixels by 64 pixels saved as a jpg and it must be named th_foobar.jpg. Then you must place it in the /file_info/icons/ directory. Once done, your new icon will be displayed prominently beside your foobar.zip download! 12) You can change the scripts output by editing the html variables in index.php. A countless number of variations can be created this way. You can virtually make the output look any way you want. Experiment! Hints: ------------ Edit the first few variables in index.php to customize your script. If you don't want mp3's to stream or pdf files to open in the browser, you can force a download by setting the variable $force_download = "true"; The GD library support is turned off by default. To turn it on, edit "index.php" and set the variable $gdlib = 1; If a file in the download directory isn't being listed, you need to edit index.php and add it's file extension to the list of allowed file extensions. This script is too slow for large directories. About 200 - 300 download items in each directory seems about max. The script doesn't do recursive directories. If you have another directory that needs to list downloads, just place another copy of the script in that directory. I've been asked many times about the "more info" link.. The "more Info" link is simply an "I feel lucky" search on google using the file name as the search criteria. The more descriptive your file names are, the better this will work. The filename "setup.exe" will not work nearly as well as "Adobe_acrobat_v5.1.zip" would. For best results, Keep your filenames descriptive. To add/change file descriptions, click the "admin" link near the bottom left of any page (right above the "total files" and "total Bytes") This will display a link on each file listing (it will say "click here to edit this entry") Simply click that link and edit the info. When done, close the edit window and re-fresh the file list to see the changes take effect. To keep others from editing your entries, the file_info/admin directory needs to be password protected. To re-initialize the script, delete the contents of /file_info/descriptions and /file_info/thumbs. (Be sure to delete the contents, not the directory itself.) ------------------------*** PLEASE NOTE ***----------------------- Download file names SHOULD NOT CONTAIN SPACES!!! USE UNDERSCORE _ INSTEAD!! You may get unpredictable results if you use spaces in your file names. This is an issue with HTML in general and not my script. I have included a small script that will remove spaces and several "special characters" that may cause problems with html compatibility. It is called "zrename.php" and it will change your file names without any promts or warnings.. ******************USE IT AT YOU OWN RISK!******************* For example, zrename.php would rename a file called "some file name!.exe" and rename it to "some_file_name.exe". Filenames will only be changed in the directory where zrename.php resides. It will not effect other directories either above or below that path. It will not change any filenames that are already comliant, (i.e. filenames that do not contain spaces will not be changed). To use the script, simply call the script by name with your browser. (like www.yoursite.com/downloads/zrename.php) Once called, the script will list all file names that were modified. Questions or comments: ---------------------- Contact: Paul Alger webmaster@ironclad.net