1# dlcounter
2Download counter for DokuWiki
3
4**NOTE:** _I wrote dlcounter but lost control of the phil-ide account where the original repository was stored, so I've cloned it here. This is now the official repo for dlcounter and all future updates (if any) will be found here_.
5
6If 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.
7
8Configuring 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.
9
10A 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.
11
12A 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.
13
14#### Syntax
15To fetch a counter (just the number) for a specific file:
16```wiki
17    {{dlcounter>file?yourFileName.zip}}
18```
19
20To generate a table:
21```wiki
22    {{dlcounter>name}}
23    or
24    {{dlcounter>count}}
25````
26
27The 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:
28```wiki
29    {{dlcounter>count?sort}}
30    or
31    {{dlcounter>count?rsort}}
32```
33A complete list of optional parameters:
34```wiki
35  SORTING
36  sort  => orders the data in ascending order
37  rsort => orders the data in descending order
38
39  FILENAME DISPLAY
40  left   => left-align the filenames
41  center => center the names
42  right  => right-align the filenames
43
44  strip => strip the path information to leave just the filename
45  nobold => do not highlight the filename
46
47  COUNTER DISPLAY
48  minwidth => minimum width of the column
49  cpad     => left-pad the column with spaces
50
51  HEADER DISPLAY
52  hleft   => left-align the header
53  hcenter => center the header
54  hright  => right-align the header
55
56  noheader => do not display a header
57  htext    => set alternate text for header
58```
59Tables 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.
60
61The full documentation can be seen [here](http://philip-p-ide.uk/doku.php/blog:articles:software:doku_dlcounter)
62