Download Statistics

From TNG_Wiki
Jump to: navigation, search
Download Statistics
Summary Provides download statistics for mods
Download link Downloadstats v1
Download stats Stats
Author(s) Chris Moss
Homepage mossfamilytree.info
Contact Developer contact author
Notes


Download Statistics is a pair of php programs that allow the author of a mod to monitor the downloads of their mod. Installed on the user's TNG website, download.php delivers the mod zip file to the user and records simply the ip address of the user together with their country (and does not use cookies); downloadstats.php prints statistics for all versions of the file. It distinguishes first time users of the mod and those who download a new version and prints statistics by month, version and country. The zip file may be stored either on the TNG Wiki website or the user's tng site (or indeed elsewhere). It is thus an alternative to the Click Counter II program.

Download and installation

A typical output of the program

Download and unzip the program to your working computer. Both of the programs will need some small customisation with a text editor before copying them to your website. Instructions are given in the file.

1. download.php

You can specify a default name ($defaultname) and version number ($defaultversion) for the mod to downloaded if this is omitted from the url given. If you don't want this, set these variables to the null string.
You should specify the file path ($filepath) for the mod to be stored. This will vary if you storing it locally (on your website) or on the TNG Wiki site (recommended).
1. On your website the default name is "modserve/" (leave the final slash). This is also used for logging the downloads and storing data files. Do not leave this as null (even if you are storing the files on the wiki) or a hacker could download any zip file on your system (even if you are storing the files on the
2. If you store it on the wiki, the path will be different for each mod version. You should first put the file on the wiki using a [[media]] link and note the actual url it is stored at. Then add a pair of the file name and the path following the example below (which you should replace), using as many lines as you have mod versions available:
$remote_path =
array('UTF8_1' => 'http://tng.lythgoes.net/wiki/images/c/ca/',
);
3. You can in addition add the ip address of your own computer as $testip. This will allow you to test the link as often as you need to without distorting the statistics.

2. downloadstats.php

Here you need to specify the printable name for your mod files (without the version number), following and replacing the example below:
$printname = array(
'download' => 'Download Utility',
'UTF8' => 'UTF-8 Translator',
);

Links on the website

The TNGmod template requires two links to be set up which correspond to the two programs. For downloads, put the text:

[http://{yourwebsite}/download.php?mod={modname}&version={versionnum}   {version information}]

where you should replace the text in {} appropriately.

The statistics link is similar but without the version number:

[http://{yourwebsite}/downloadstats.php?mod={modname}&version={versionnum}   {statistics}]