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

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

Creating Custom RSS Feeds for almost anything in your Jamroom Index Modifying and Customizing the Jamroom Control Panel

Overview

One of the “hidden” features of the Jamroom Ranking System is the ability to create dynamic custom playlists that your users can stream. This allows you almost unlimited ways to create new playlists (or “stations”) and offer them to your listeners. Creating these custom playlists requires undestanding how the Jamroom Ranking System works - I highly suggest reading the Using the Jamroom Ranking System documentation to ensure you understand the concepts that are need to create these dynamic playlists.

Create the Ranking template

The first step will be to create the JRS template that will be used to “click” on the link that starts the playlist stream. This template will actually be a very small template, since in effect all it needs to provide is the URL to the play.php script that has been generated by the ranking.php script. For our example here, we are going to create a random playlist of Hard Rock songs from our Jamroom. So in this first step we are going to create a file called “top25_rock.tpl” in our Active Skin directory (i.e. jamroom/skins/Cobalt):

<a href="{$PLAYPAGE_HIFI_MP3_URL}">Click to play the top 25 Rock songs!</a>

Create the Jamroom Ranking System call

The next step is to figure out where you want to place the "call" to the dynamic playlist - for this test we're going to create a small custom template that will only contain the link to launch the playlist - however you will want to place it in the template where you would like it to be called from:

<a href="{$JAMROOM_URL}/ranking.php?mode=song&amp;order=5&amp;show=25&amp;genre=Rock&amp;header_template=top25_rock.tpl">Click here to play top 25!</a>

Test the Playlist created by the JRS

Click on the link that we just created above, and you will see the text of the template you created in step one on your screen - “Click here to play the 25 Rock songs!”. Clicking on that link will launch your audio player and the songs should begin streaming to your computer.

Understanding how it works

Now that you have a simple, working example of how to create a playlist, you can “experiment” with different options to ranking.php (note that you will always use the song mode) to get any type of list you want.

How the Jamroom Ranking System does this is because of the {$PLAYALL_HIFI_MP3_URL} template variable. This variables is available in the Header/Footer templates for the ranking system when running in the song mode. Since a “row_template” variable is not given, when Jamroom loops over the songs, but instead of adding the song variables to any output, the only thing that is created is the Header/Footer variables. Since the {$PLAYALL_HIFI_MP3_URL} is a header variable, it is available in the defined header template - in this case “random_hard_rock.tpl”. That variable will be expanded by Jamroom to the correct play.php call that is needed to stream the songs that match your ranking.php call.

NOTE: Jamroom caches all of the Jamroom Ranking System output pages to improve system performance, and to lessen the strain on your server if your server is very busy. This will affect the playlist that is generated by the ranking.php script since it will serve up the “cached” version of the play.php call for a duration that matches the “Cache Expires” setting in the Jamroom Config. This is typically not an issue for systems, but is something to be aware of during testing. If you would like to temporarily “disable” the caching effect, set the “Cache Expires” setting to 0 (zero) in the Jamroom Config. Just don’t forget to set it back to what it was when you are done testing!

1) Note that the word “Hard Rock” in the example URL has been PHP Urlencoded where all spaces or special characters have been replaced with the correct URL entity. In this case, a “space” is replaced with a + (plus sign)

Creating Custom RSS Feeds for almost anything in your Jamroom page 51 of 185 Modifying and Customizing the Jamroom Control Panel
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