FileDownload ver. 2.5
The FileDownload snippet for MODx displays a list of files from a specified directory for downloading. Used in conjunction with the filedownload plugin it offers secure downloads with download counting. The snippet has built in template support with many parameters that allow for unlimited customization.
Install Instructions
- Create a folder under your snippets directory named filedownload.
- Copy the files filedownload.class.inc.php, data.db.class.inc.php, and filecount.txt into that directory.
- Create a new snippet named FileDownload
- Copy the contents of FileDownloadSnippet2.5.php into the snippet.
- If using the FileDownloadPlugin:
- Create a new plugin named FileDownloadPlugin.
- Copy the contents of the file FileDownloadPlugin1.0.php into the plugin.
- On the plugin configuration tab paste the following into the plugin configuration box:
&countDownloads=Count Downloads;list;yes,no;yes &useDbCount=Store Count Where;list;db,file;db
- Set the configuration options as needed.
- On the system events tab check the box next to OnWebPagePrerender.
- Create a template variable named FileDownloadFolder with input type = text.
- For each document you are calling the FileDownload snippet, set the template variable FileDownloadFolder to the directory to display.
- Use the snippet call to customize the display of the download list.
Basic Usage
[!FileDownload? &getFolder=`assets/snippets/filedownload`!]