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 Rating System” allows you to enable “ratings” for most of the items in your Jamroom. This includes:

  • Artist ratings
  • Song ratings
  • Message (blog) ratings
  • Store Item ratings
  • Calendar entry (event) ratings

And with the addition of the Jamroom Power Pack:

  • Photo Gallery ratings
  • Video ratings

Allowing the visitors to your Jamroom site to “rate” the different items in your Jamroom can really bring your Jamroom site alive, as it enables you to rank (using the Jamroom Ranking System) and sort items based on their ratings.

NOTE: Jamroom uses a special algorithm to try and prevent the “skewing” of an individual rating. How it works is that once an item has reached 12 ratings, the top 10% and bottom 10% of ratings are thrown out, which delivers closer to a true average. Since a rating of “1” and a rating of “5” carry a heavier weighting, this prevents too many ratings of either of these values from skewing the result unfairly.

Configuration

By default, you will find links to the Jamroom Rating script embedded within the included Artist Themes in your Jamroom. While this is the typical place to create links to the Rating script, it can be used anywhere there is Jamroom output - this includes the output of the Jamroom Ranking System, Jamroom Search, Jamroom Playlist Viewer, Jamroom Advanced Charts, etc.

There is no direct configuration file for the Jamroom Rating script, however its behavior is influenced by the “Jamroom Ratings” section in the Jamroom Config (Admin Menu → Jamroom Config → Rating Settings). The following options can be set:

  • Enable Artist Ratings - This setting allows you to specify if you are going to allow Artist Ratings in your Jamroom. Setting this to “yes” (default) allows visitors to your Jamroom to “rate” your artists. Note that the Jamroom Themes and other templates might need to be modified with the correct URL links for your visitors to rate your artists.
  • Artist Rating Method - Jamroom supports 2 methods of computing the Artist Rating for an artist:
  1. The first method is to use the value from the Artist rating_average column, which is computed only from the numbers reported via the “Rate Artist” form.
  2. The second method bypasses the Artist Average rating, and instead uses the average value of ALL of the Artist’s Song Ratings.
  • Enable Song Ratings - If this option is set to "yes", then artists within this quota will be allowed to have their Artist Songs rated.
  • Enable Message Ratings - If this option is set to "yes", then artists within this quota will be allowed to have their Blog Entries rated.
  • Enable Radio Ratings - If this option is set to "yes", then artists within this quota will be allowed to have their Radio Stations rated.
  • Enable Item Ratings - If this option is set to "yes", then artists within this quota will be allowed to have their Store Items rated.
  • Enable Event Ratings - If this option is set to "yes", then artists within this quota will be allowed to have their Calendar Events rated.
  • Enable Photo Ratings - If this option is set to "yes", then artists within this quota will be allowed to have their Gallery Images rated.  (requires Jamroom Power Pack)
  • Enable Video Ratings - If this option is set to "yes", then artists within this quota will be allowed to have their Artist Videos rated.  (requires Jamroom Power Pack)
Also, in the Jamroom Config → Counter and Timer Settings section, you will find the following config option:
  • Rating Timer - When a visitor Rates one of your Jamroom Artists or Songs, how long must they be made to wait before being allowed to Rate another Artist or Song? This can help prevent malicious visitors from “slamming” one of your Artists or Songs with very low numbers.

Within the Artist Quota settings (Admin Menu → Modify Quota) you can also, on a per Quota basis, set the avilability for that Quota to have Rating Allowed, as well as that Quotas ability to do “Remote Rating”. “Remote Rating” is the ability for an Artist in your Jamroom to create a banner graphic (for example), or a link from an external web page, that when clicked on would allow visitors to THEIR site (not your Jamroom) to also submit a rating to your Jamroom. This can be popular among Artists since it allows them some power over self promotion and gives them a way to round up votes for their Artist Rating.

Usage

Displaying the Rating Form

Using the rating.php script is fairly straight forward, and works like many of the other Jamroom scripts.  Calling a Rating form for a visitor to fill out from a Jamroom Artist Theme is easy, since Jamroom provides the variables for you to use directly in your Artist Theme templates.  To use these variables, simlpy place them within an HTML anchor tag like this

  • {BAND_RATING_FORM}
  • {SONG_RATING_FORM}
  • {MESSAGE_RATING_FORM}
  • {RADIO_RATING_FORM}
  • {EVENT_RATING_FORM}
  • {ITEM_RATING_FORM}
  • {PHOTO_RATING_FORM}   (Jamroom Power Pack required)
  • {VIDEO_RATING_FORM}   (Jamroom Power Pack required)
To use these variables, simlpy place them within an HTML anchor tag like so:

<a href="{SONG_RATING_FORM}" {POPUP_JAVALINK}>Rate This Song!</a>

This would create a popup that would contain a Song Rating form. The visitor could choose the Rating they would give to the Song, then when they submit the form, their vote would be recorded.

Note: Once a visitor rates an item in Jamroom, they will not be able to rate that same item again from the same IP address.

The page that is used for the Rating Form is a Smarty based template. By default, since no “template” argument is provided, Jamroom will use the default rating templates, which are located in the jamroom/templates/rating directory, and are named according to the "type" of item being rated - i.e. "rate_song_form.tpl".  You always have the option of passing in your own template name like this:
<a href="{SONG_RATING_FORM}&template=custom_rating.tpl" {POPUP_JAVALINK}>Rate This Song!</a>

By merely adding the &template=(template_name) argument to the variable, it causes the rating.php script to look for a template by that name in the jamroom/templates/rating folder.

Note: For security reasons the template MUST be located within that directory or it will not work. If for any reason Jamroom is unable to locate the template, an error will be shown.

Its recommended that to create your own templates, just copy the default template to a new name and then modify it to your design.

Displaying a Rating Average or Number of Ratings

On your Artist Themes, your Ranking output, etc., you are likely going to want to show the current rating that a Jamroom item has.  For the most part, it is recommended that you use the appropriate variables for the method you are using (i.e. use the "ranking" variables provided in the Jamroom Ranking System if you want to include ratings on the output of the Jamroom Ranking System), but if you need to display a rating on a page that is external to Jamroom, you can "pull" this information from Jamroom via a PHP include() statement, or an Apache SSI (Server Side Include).

The format of the URL looks like:

rating.php?mode=(show_rating|show_average)&band_id=(band_id)[&other_id=(other_id)]

The first part of the URL:

mode=(show_rating|show_average)

Means you must define what number you want returned:
  • show_rating - this mode will return the number of times the item has been rated.
  • show_average - this mode will show the average of the ratings the item has received.
The second part of the URL is for defining the band_id for the Artist you want to view the ratings or average for:

band_id=(band_id)

There is a third, optional part of the URL that allows you to define the "id" of the item that you want to return the rating or average for, and this part will vary depending on the "type" of item you want the numbers for.

The options have the following meanings:

Option Description
mode The mode option is REQUIRED and tells Jamroom what "mode" you would like the script to operate in.  The following "modes" are supported:

show_rating - this mode is used to return the number of ratings an item as received.
show_average - this mode is used to show the average rating an item as received
rating_form - this mode is used for displaying a rating form to a visitor
type The "type" option tells Jamroom the type of Jamroom item you are rating.  Valid "type" values are:

bands
song
radio
event
item
message
video (required Jamroom Power Pack)
photo  (requires Jamroom Power Pack)
[template=template.tpl] the template variable is an optional argument that allows you specify an alternate Rating template to be used in place of the default templates. Note that the template file MUST be located in the jamroom/templates/rating directory for security reasons.

To RETRIEVE the current Artist or Song rating value, rating.php should be used like this:

rating.php?mode=(show_rating|show_average)&type=(type)&band_id=(band_id)

The options have the following meanings:

The mode option is REQUIRED and tells Jamroom what rating value to retrieve from the database:

  • song_rating = returns the NUMBER of times the song has been rated
  • song_average = returns the AVERAGE of the song ratings in the database
  • band_rating = returns the NUMBER of times the artist has been rated
  • band_average = returns the AVERAGE of the artist ratings in the database

band_id=(band_id)
The band_id option is REQUIRED and tells Jamroom the Artist ID Number of the Artist rating you want to retrieve. Note that if you are using the “rate_band” mode, then you would use “song_id=0” to indicate you are doing a band rating.

When calling the rating.php like this to RETRIEVE a value from Jamroom’s database, only the VALUE is returned - that means that if you would like to format the output (i.e. the font size, color) you will need to precede or embed the PHP include() or SSI call within your page:

<php @include("http://yoursite.com/jamroom/rating.php?mode=song_average&band_id=25"); ?>

Template Variables

The following template variables can be used with the BAND mode templates:

Variable Description
{$JAMROOM_DIR} The full path to the Jamroom directory
{$JAMROOM_URL} The URL to the Jamroom installation
{$BAND_ID} The Artist’s Band ID
{$BAND_MEMBERS} The text entered into the Artist Members form field.
{$BAND_LOCATION} The text entered into the Artist location form field.
{$BAND_STORY} The Artist’s Background/Story as entered on the Artist form.
{$BAND_QUOTA} The Artist’s Jamroom Quota ID.
{$BAND_WEBSITE} The text entered into the Artist Website form field.
{$BAND_INFLUENCE} The text entered into the Artist Influence form field.
{$BAND_SOUNDLIKE} The text entered into the Artist Sounds Like form field.
{$BAND_IMAGE} link to image.php script to generate Band Image - i.e.:
http://yourdomain.com/jamroom/image.php?band_id=(number)&amp;mode=band_image

- use this inside an IMG tag. Note if you would like the band images that are created to be “cached” (this will improve loading time), then in your template you can add the width and height to the {BAND_IMAGE} variable like this:

<img src="{BAND_IMAGE}&amp;width=96&amp;height=96">

- this will cause the image to be resized to 96×96 pixels using GD, then the resultant image would be cached - the next load of the same page would use the cached image instead of the full size image.

{$RATE_COUNT_1} Number of “1” ratings this artist has received
{$RATE_COUNT_2} Number of “2” ratings this artist has received
{$RATE_COUNT_3} Number of “3” ratings this artist has received
{$RATE_COUNT_4} Number of “4” ratings this artist has received
{$RATE_COUNT_5} Number of “5” ratings this artist has received
{$BAND_RATE_AVG} Average of ratings this artist has received
{$BAND_RATE_NUM} Total Number of ratings this artist has received
{$QUOTA_NAME} The Artist’s Jamroom Quota Name.
{$THEME_ID} The Artist’s current Theme ID
{$THEME_ID} The Artist’s current Theme Name
{$THEME_ID} The Artist’s current Theme Directory


The following template variables can be used with the SONG mode templates:

Variable Description
{$JAMROOM_DIR} The full path to the Jamroom directory
{$JAMROOM_URL} The URL to the Jamroom installation
{$BAND_ID} The Artist’s Band ID
{$BAND_MEMBERS} The text entered into the Artist Members form field.
{$BAND_LOCATION} The text entered into the Artist location form field.
{$BAND_STORY} The Artist’s “story” as entered on the Artist form.
{$BAND_QUOTA} The Artist’s Jamroom Quota ID.
{$BAND_WEBSITE} The text entered into the Artist Website form field.
{$BAND_INFLUENCE} The text entered into the Artist Influence form field.
{$BAND_SOUNDLIKE} The text entered into the Artist Sounds Like form field.
{$BAND_IMAGE} link to image.php script to generate Band Image - i.e.
http://yourdomain.com/jamroom/image.php?band_id=(number)&amp;mode=band_image

- use this inside an IMG tag. NOTE: if you would like the band images that are created to be “cached” (this will improve loading time), then in your template you can add the width and height to the {BAND_IMAGE} variable like this:

<img src="{BAND_IMAGE}&amp;width=96&amp;height=96">

- this will cause the image to be resized to 96×96 pixels using GD, then the resultant image would be cached - the next load of the same page would use the cached image instead of the full size image.

{$QUOTA_NAME} The Artist’s Jamroom Quota Name.
{$RATE_COUNT_1} Number of “1” ratings the song has received
{$RATE_COUNT_2} Number of “2” ratings the song has received
{$RATE_COUNT_3} Number of “3” ratings the song has received
{$RATE_COUNT_4} Number of “4” ratings the song has received
{$RATE_COUNT_5} Number of “5” ratings the song has received
{$SONG_ID} Song ID of song to be rated
{$SONG_NAME} Name of song to be rated
{$SONG_ALBUM} Name of Album song to be rated is from
{$SONG_LABEL} Name of Label song to be rated is on
{$SONG_GENRE} Name of Song Genre song to be rated belongs to
{$SONG_GENRE_URL} Name of Song Genre song to be rated belongs to (urlencoded)
{$SONG_CREDITS} Writing Credits of song to be rated
{$SONG_ADVISE} yes/no whether song to be rated contains explicit lyrics
{$SONG_LYRICS} Lyrics of song to be rated
{$SONG_HISTORY} Song Information of song to be rated
{$SONG_IMAGE} link to image.php script to generate Song Image - i.e.:
http://yourdomain.com/jamroom/image.php?band_id=(number)&amp;song_id=(number)&amp;mode=song_image

- use this inside an IMG tag. *NOTE:** if you would like the song images that are created to be “cached” (this will improve loading time), then in your template you can add the width and height to the {SONG_IMAGE} variable like this:

<img src="{SONG_IMAGE}&amp;width=96&amp;height=96">

- this will cause the image to be resized to 96×96 pixels using GD, then the resultant image would be cached - the next load of the same page would use the cached image instead of the full size image.

{$SONG_RATE_AVG} Average of ratings the song has received
{$SONG_RATE_NUM} Total Number of ratings the song has received
{$THEME_ID} The Artist’s current Theme ID
{$THEME_ID} The Artist’s current Theme Name
{$THEME_ID} The Artist’s current Theme Directory
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