Jamroom Logo Jamroom 5 Core
is now Open Source!
Follow Jamroom on Twitter!

This document applies to Jamroom 2 only!
For current Jamroom 4 Documentation, visit the main Jamroom Documentation section.

Overview

The Jamroom “Get Counts” script (get_counts.php) is a small utility script that makes it easy to retrieve counts of information from your Jamroom database. This is often useful when you are customizing your site and would like to create a small section that shows some of your statistics - i.e. “We have x number of Artist Accounts”, etc. You can use the get_counts.php script to get this type of information, and much more.

Configuration

There are no configuration files necessary to use the get_counts.php script, however if you run into problems using it, you should make sure your domain name is added into the “Deeplink Allowed Keywords” setting located in Jamroom Config → System Settings section.

Other than that, all aspects of the scripts return are controlled via the arguments passed in to the script from the URL.

Usage

Using the get_counts.php script is easy - just call it via a PHP include() function placed where you want the output to be. For example:

<?php @include("http://yoursite.com/jamroom/get_counts.php?mode=bands"); ?>

Would show you the number of Artists in your Jamroom. The output would be a number - something like “25”. Note that it ONLY returns the number part, therefore if you want to FORMAT the output, you would need to do it in the surrounding HTML code that precedes and comes after the PHP include() function call to get_counts.php.

The following modes are available for counts:

Mode Description
bands[&quota=quota_id] this will return the number of artists in your Jamroom. If the optional &quota=quota_id is provided, then only artists that are in that Jamroom quota will be counted.
songs[&genre=genre_name] this will return the number of songs in your Jamroom. If the optional &genre=genre_name is included, only songs within that song genre will be counted. You may also specify more than 1 genre by using a URL array - i.e. “&genre[]=Blues&genre[]=Country (note that the [] brackets on the end of the genre name create the array and are required).
sessions[&session_time=minutes] this will show how many users are currently logged in to your Jamroom and active over the past 15 minutes (default). If a number is given for the optional session_time, then users active over that number of minutes will be used instead.
users this will show how many user accounts are in your Jamroom (NOT artist accounts - user accounts).
viewers[&viewer_time=minutes] this will show how many visitors are currently viewing Artist Pages on your Jamroom site. Note: By default this will return the number of viewers over the previous HOUR, but this number is impacted by the “Page Hit Interval” setting in your Jamroom Config. The value for “Page Hit Interval” must be set for at least 1 hour (3600) or more for the default setting to work correctly.
listeners[&listener_time=minutes] this will show how many visitors are currently listening to Streams on your Jamroom site. Note: By default this will return the number of listeners over the previous HOUR, but this number is impacted by the “Song Play Interval” setting in your Jamroom Config. The value for “Song Play Interval” must be set for at least 1 hour (3600) or more for the default setting to work correctly.
streams[&band_id=band_id] shows how many total song streams have been played from your Jamroom for all time. If a band_id is provided, then only counts for that artist are shown.
streams_today[&band_id=band_id] shows how many song streams have been played from your Jamroom for the current day. If a band_id is provided, then only counts for that artist are shown.
downloads[&band_id=band_id] shows how many total song downloads have come from your Jamroom for all time. If a band_id is provided, then only counts for that artist are shown.
downloads_today[&band_id=band_id] shows how many song downloads have come from your Jamroom for the current day. If a band_id is provided, then only counts for that artist are shown.
plays[&band_id=band_id] shows how many total streams + downloads have come from your Jamroom for all time. If a band_id is provided, then only counts for that artist are shown.
plays_today[&band_id=band_id] Shows how many streams + downloads have come from your Jamroom for the current day. If a band_id is provided, then only counts for that artist are shown.
spotlights[&band_id=band_id] Shows how many total spotlights have been done from your Jamroom for all time. If a band_id is provided, then only counts for that artist are shown.
spotlights_today[&band_id=band_id] Shows how many spotlights have been done from your Jamroom for the current day. If a band_id is provided, then only counts for that artist are shown.
ratings[&band_id=band_id] Shows how many Artist and Song ratings are in your Jamroom. If a band_id is provided, then only the number for that artist is shown.
rating_users[&band_id=band_id] Shows number of unique visitors who have submitted ratings to your Jamroom. If a band_id is provided, then only the number for that artist is shown.
radio[&band_id=band_id] Shows how many Radio Station are in your Jamroom. If a band_id is provided, then only the number for that artist is shown.
radio_plays[&radio_id=radio_id] Shows how many Radio Station plays have come from your Jamroom. If a radio_id is provided, then only the number for that Radio Station is shown.
page_views[&band_id=band_id] Shows how many page views your Artist Sites have had. If a band_id is provided, then only the number for that artist is shown.
genre Shows number of Song Genres in your Jamroom.
items[&band_id=band_id] Shows number of Store Items for sale in your Jamroom. If a band_id is provided, then only the number for that artist is shown.
events[&band_id=band_id] Shows number of Artist calendar entries in your Jamroom. If a band_id is provided, then only the number for that artist is shown.
messages[&band_id=band_id] Shows number of Artist Blog entries (messages) in your Jamroom. If a band_id is provided, then only the number for that artist is shown.
quotas shows number of different Jamroom Quotas in your Jamroom.
servers shows number of different Jamroom Cluster Servers in your Jamroom.

These options makes it easy to include the output in another PHP page using PHP‘s include() function - i.e.

<php @include("http://yoursite.com/jamroom/get_counts.php?mode=songs&genre=Hard+Rock"); ?>

NOTE: When providing the “songs” mode with a Song Genre as an option, the genre name MUST be urlencoded if it contains any spaces or non alphanumeric characters, or it won’t work correctly. The best way to ensure this is to use the “urlencode” Smarty variable modifier, i.e.:

{$SONG_GENRE|urlencode}
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom 5
Jamroom 5 Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2024 The Jamroom Network