countTrackula Icon

countTrackula

Get a hashed link and download count for any local/remote file.

By Devin Gaul (demon.devin)

countTrackula first screenshot

countTrackula 2.0

With this snippet you will have the ability to display the number of downloads for a local file or the number of clicks on a remote file. It'll also create a hashed link of the local or remote file for security purposes hiding the file path of a locally hosted file.

System Settings

Name Description
algo The desired algorithm to use when creating a checksum of the download file. Refer to the PHP Documentation for a list of supported algorithms to choose from. Default: SHA1
salt Define a secret passphrase to be used with generating the checksum. Default: countTrackula's best friend is decrypt-keeper
core_path Just the path to the component files for use with the snippet. Best just to leave this untouched.

Properties

Property Type Req/Opt Description
&path String Required Path to the download file from webroot.
&file String Required The filename of the download without slashes.
&name String Required The name of your download file for display purposes.
&term String Optional The word shown next to download count. (i.e. 18 hits)
&hits Boolean Optional If true, only shows the download count of &file.
&tpl String Optional The chunk used for displaying the download link to the client.

Example

—Locally Hosted Files

Define a download with a property path of downloads/ and a property file of MyPackage.zip with the property name of My Package

SOURCE:
OUTPUT:

My Package (18 downloads)

<a href="http://example.com/?download=SALTEDHASHCHECKSUM">My Package</a> (18 downloads)

To only show the download count of My Package but use the term hits instead of downloads use the following:

OUTPUT:

18 hits

—Remotely Hosted Files

To define a remote file for download with the property term of clicks set the file property as the link to the file like below. Note: This feature has barely been tested so please report any erroneous findings you may run into on my [GitHub project page](https://github.com/daemondevin/countTrackula).

SOURCE:
OUTPUT:

countTrackula (18 clicks)

<a href="http://example.com/?download=SALTEDHASHCHECKSUM&link=true">countTrackula</a> (18 clicks)

Devin Gaul

Support


New in countTrackula 2.0.0-rc1

Changelog for countTrackula

countTrackula 2.0

A complete rewrite of the script - Added support for both local and remote files - Better hashing support--added an optional user define salt - Removed file based logging in favor of MySQL logging - Added ability to show just unique downloads based on clients IP - Added support to call this snippet multiple times in a single resource

countTrackula 1.0.1

Fixed damn near everything with the script - list to long to actually write out

countTrackula 1.0.0

Initial Version - countTrackula has risen from it's eternal slumber!

More

Information

Released
October 14, 2016
Supported Versions
2 – 2.7
Downloads
514
License
GPLv2

Previous Versions

More

More from Devin Gaul

Flip MODx Manager Login

Changes the default manager login page with an alternative one.

View
middleFinger

A simple, configurable context menu to replace a browser's default…

View
showSource

This MODx Extra snippet can show highlighted HTML source of the current…

View
image64

Converts a specified image to a base64 encoding for use within a…

View