MozdevDownloadCounters

All files served through our mirror system are counted and these statistics can be displayed on your projects page.

In order to display a summary about your project downloads, add the following code to a page in your site:

<?php downloads('/project_file.xpi', 'File Description'); ?>

This will display as ("Project" = your project name; X = # of downloads):

Project File Description X

If you would like to display your statistics without any surrounding project name/header formatting, you can use the following syntax:

<?php downloadsNoFmt('/project_file.xpi'); ?>

Using either format, a number of css classes are available for you to use for styling the output:

  • .download_counter : the actual counter value

If you are using formatting, the following classes are also available:

  • .download_count_header : the entire div containing all the information
  • .download_count_project_name : your project name
  • .download_count_name : the file description you provided

If you would like to display your statistics without any HTML, you can use the following syntax:

<?php downloadsCounterOnly('/project_file.xpi'); ?>

If you would like to display your total project downloads for the last 30 days (rolling total), you can do this (note this returns the value rather than echos it directly):

<?php echo downloadsProjectTotals('/project_file.xpi'); ?>

Example #1 - file in your root download folder:

File: http://downloads.mozdev.org/multizilla/multiviews-v1500.xpi
<?php downloads('/multiviews-v1500.xpi', 'Multiviews 1500'); ?>

Example #2 - file in a subfolder of your download folder:

File: http://downloads.mozdev.org/multizilla/multizilla/multiviews-v1500.xpi
<?php downloads('/multizilla/multiviews-v1500.xpi', 'Multiviews 1500'); ?>

Downloads for the last 30 days for the top 50 projects are shown on the Top 50 page