plugin:dlcount
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:dlcount [2015-03-19 06:30] – 37.200.79.25 | plugin:dlcount [2023-12-17 21:38] (current) – new download url Aleksandr | ||
---|---|---|---|
Line 7: | Line 7: | ||
type : Action Admin | type : Action Admin | ||
lastupdate : 2009-02-27 | lastupdate : 2009-02-27 | ||
- | compatible : 2009-02-16, | + | compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons |
depends | depends | ||
conflicts | conflicts | ||
Line 13: | Line 13: | ||
tags : counter download | tags : counter download | ||
- | downloadurl: | + | downloadurl: |
+ | bugtracker : | ||
+ | sourcerepo : | ||
+ | donationurl: | ||
+ | |||
+ | screenshot_img: | ||
---- | ---- | ||
- | [[http:// | + | ===== How it works ===== |
+ | |||
+ | The plugin registers hooks for some events. It creates the meta-files below data/ | ||
+ | |||
+ | ==== MEDIA_SENDFILE ==== | ||
+ | |||
+ | This event is triggered when someone downloads a file. First it is checked whether this is a real download or a browser fetching an embedded image. In the latter case, it does nothing. | ||
+ | |||
+ | If this is a real download, it calculates the path to the meta-file. E.g. if someone is downloading %%http:// | ||
+ | |||
+ | data/ | ||
+ | |||
+ | This contains a serialized structure which currently only holds an array containing a dlcount key with the actual download count. Maybe later this holds a complete log of all downloads of the file or at least the last 10 IPs downloading it... | ||
+ | |||
+ | The download counter is incremented by 1 and the new data is serialized and written back to the meta file. | ||
+ | |||
+ | If the file doesn' | ||
+ | |||
+ | ==== TPL_CONTENT_DISPLAY ==== | ||
+ | |||
+ | This event is triggered when a page is displayed. The plugin | ||
+ | |||
+ | ==== MEDIA_UPLOAD_FINISH ==== | ||
+ | |||
+ | This event is triggered after a new file was uploaded to the media library. If you overwrite an already existing file, the download counts for this file get reset to 0 (because there' | ||
+ | |||
+ | ==== MEDIA_DELETE_FILE ==== | ||
+ | |||
+ | This event is triggered upon deletion of a file from the media library. This will also delete the associated meta data. | ||
===== Problems ===== | ===== Problems ===== | ||
+ | |||
+ | ==== 2016-09-19 === | ||
+ | |||
+ | I have noticed that plugin does not correctly treat media filenames when file encoding is UTF-8 (not URL-escaped). See [[https:// | ||
+ | |||
+ | --- [[user> | ||
==== 2014-09-18 === | ==== 2014-09-18 === |
plugin/dlcount.1426743029.txt.gz · Last modified: 2015-03-19 06:30 by 37.200.79.25