Firefox PHP

Module: Attachment Download Counter

Posted by Joe Curia 
All files from this thread

File Name File Size   Posted by Date  
attachment download counter read.jpg 28.1 KB open | download Joe Curia 12/26/2009 Read message
attachment_download_counter_v5_2_1_00.zip 5.5 KB open | download Joe Curia 12/26/2009 Read message
Module: Attachment Download Counter
December 26, 2009 05:54PM
This module keeps a count of the number of times each attachment is downloaded. This information can be displayed alongside of the attachment. The date that the attachment was last downloaded can also be displayed. The admin can also enter a date to display as the starting date for counting downloads (eg. "Downloaded X times since 1/1/2009.") If the admin chooses to display this information, it will also be displayed for any links rendered by the Embed Attachments module.

Installation Instructions:
After installing this module in the mods folder, you will also have to edit the read.tpl, read_hybrid.tpl, and read_threads.tpl files for your template. In each file, you will need to add the following code:
{INCLUDE "attachment_download_counter::counter_read"}
This should be added inside the attachments loop:
{LOOP MESSAGES->attachments} . . . {/LOOP MESSAGES->attachments}
Here is a sample from an edited version of the Emerald template's read.tpl file:
{LOOP MESSAGES->attachments}
    <a href="{MESSAGES->attachments->url}">{LANG->AttachOpen}</a> | <a href="{MESSAGES->attachments->download_url}">{LANG->AttachDownload}</a> -
    {MESSAGES->attachments->name}
    ({MESSAGES->attachments->size}){INCLUDE "attachment_download_counter::counter_read"}<br/>
{/LOOP MESSAGES->attachments}
At this time, all templates will use the default Emerald layout found in the mods/attachment_download_counter/templates/emerald/counter_read.tpl and counter_hook_render_embedded_attachment.tpl files. If you want to edit the way the download counter, counter starting date, or last downloaded date are displayed, you can edit this file, or create a copy of this file in your own template's folder (eg. mods/attachment_download_counter/templates/my_custom_template/counter_read.tpl).

Todo:
- Add the ability to count the downloads of files uploaded to the "My Files" section.

- Add features as they are requested.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald



Attachments:
open | download - attachment_download_counter_v5_2_1_00.zip (5.5 KB)
Re: Module: Attachment Download Counter
December 29, 2009 06:44AM
Lastly u made it. Thx a lot
Sorry, only registered users may post in this forum.

Click here to login