1# dlcounter 2Download counter for DokuWiki 3 4If you've ever wanted a download counter for DokuWiki to count how many zip, tar, gzip or other downloadable content has been fetched from your media library, this is probably what you want. 5 6Configuring through the admin interface allows you to specify which file extensions to monitor. As data is collected (on a per file basis), you can pull information from the datastore, either one counter at a time, or everything at once displayed in a highly configurable table. 7 8A rich syntax allows you to specify the order of data, whether path information is displayed, left/right justified, whether there is a header and if so, what the header text is. Useful defaults are provided for all options. 9 10A description of the datastore is also provided with some example code on how to access it and retrieve the data, so you can perform any other operations on the data or inject the data into your own (more complex) tables. 11 12#### Syntax 13To fetch a counter (just the number) for a specific file: 14```wiki 15 {{dlcounter>file?yourFileName.zip}} 16``` 17 18To generate a table: 19```wiki 20 {{dlcounter>name}} 21 or 22 {{dlcounter>count}} 23```` 24 25The command (*name* or *count*) identifies the column you wish to sort on. Since the default sort order is natural, you'll probably want to add a sort option: 26```wiki 27 {{dlcounter>count?sort}} 28 or 29 {{dlcounter>count?rsort}} 30``` 31A complete list of optional parameters: 32```wiki 33 SORTING 34 sort => orders the data in ascending order 35 rsort => orders the data in descending order 36 37 FILENAME DISPLAY 38 left => left-align the filenames 39 center => center the names 40 right => right-align the filenames 41 42 strip => strip the path information to leave just the filename 43 nobold => do not highlight the filename 44 45 COUNTER DISPLAY 46 minwidth => minimum width of the column 47 cpad => left-pad the column with spaces 48 49 HEADER DISPLAY 50 hleft => left-align the header 51 hcenter => center the header 52 hright => right-align the header 53 54 noheader => do not display a header 55 htext => set alternate text for header 56``` 57Tables display the full path of the files as they appear in the media library (e.g. path:to:snow.zip) unless the *strip* option is used. Sorting on filenames is sorted on the filename with the path as a subsort. 58 59The full documentation can be seen [here](http://philip-p-ide.uk/doku.php/blog:articles:software:doku_dlcounter) 60