Extension:DownloadCounter

The DownloadCounter extension can display the total number and the last date of downloaded files, which are recorded in the MySQL database.

Usage
On your wiki page, you will setup an download like this: Download this great software here

And display the recorded data like that:  total download. Last download was : 

Installation

 * 1) Add this in the LocalSettings.php:


 * 1) . Create a file download.php in the root directory of your MediaWiki installation
 * 2) . Create a file DownloadCounter.php in the root/extensions directory of your MediaWiki installation
 * 3) . Run the below SQL against your wikidatabase to create the tables


 * 5. Setup correctly MySql conection in the extension ("DownloadCounter.php") and in the php download file ("download.php")


 * 6. Setup correctly the root directory of file to download

Code

 * download.php


 * DownloadCounter.php

Known issues

 * Does not work if the MediaWiki installation uses a table prefix. Can be fixed temporarily by searching for "downloads_files" in both files, and adding a prefix before it (so if $wgDBprefix = "mw_", you should replace "downloads_files" with "mw_downloads_files").