Revision of MozdevDownloadCounters from Fri, 06/27/2008 - 11:44

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 [http://www.mozdev.org/projects/top50.html Top 50 page]

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • You can use BBCode tags in the text. URLs will automatically be converted to links.

More information about formatting options