Jamroom Logo
Newsletter
Member Spotlight
427823
The Talent Farm
"TheTalentFarm is South Florida's newest and coolest recording studio/venue! We encourage artists of all genres to showcase their skills at any of our live shows, most of which are broadcast over the Internet. The selection process is sometimes painstaking. But thanks to Jamroom, all candidates can submit their bios, songs, EPK's even videos without effort, making it really easy for the staff to evaluate an artist and place them on the correct type of show. As the site grows and takes on its own personality, I remain confident that Jamroom will be able to keep up. The program is excellent, and the support is even better. Jamroom does everything I need, and does it well!"
Follow Jamroom on Twitter!

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

{jr_media_access} Index {jr_not_logged_in}

{jr_media_play_key}


The {jr_media_play_key} function is used for adding valid Media Play Keys into the Jamroom database.  This function was first introduced in Jamroom Core 3.3.8.

Parameters

Name Type Required Default Description
mode string no n/a The "mode" parameter can be used to tell the {jr_media_play_key} function to either "add" a key to a temporary keychain, or "save" the keychain to the database.  By default, if the {jr_media_play_key} function is called without a mode parameter, the key is generated and saved in the same function call.  If the {jr_media_play_key} function is being called in a "loop" (in a row_template that is being used in the Jamroom Ranking System for example), then it is much more efficient to call the {jr_media_play_key} function with the "add" parameter in each row, the call it once in the footer_template with the "save" parameter.
media_id number yes* n/a

The media_id parameter is the $SONG_ID or $VIDEO_ID to add to the Play Keys.

*This parameter is required if no "mode" parameter is given, or the mode parameter is set to "add".

assign string no n/a By default the {jr_media_play_key} function returns the key that was created - if you would like to store this key in a variable for further processing, you can assign the output to a template variable.

 

Example

Example embedding the {jr_media_play_key} into a Jamroom Ranking System "song" mode row_template (note that the lack of a "mode" parameter means that a database query will be executed for each call of the row template):

<a href="stream.php?mode=song_hifi&band_id={$BAND_ID}&song_id={$SONG_ID}&k={jr_media_play_key media_id=$SONG_ID}">Play song_id {$SONG_ID}</a>

 

A more efficient way is to use the following code in the row_template:

<a href="stream.php?mode=song_hifi&band_id={$BAND_ID}&song_id={$SONG_ID}&k={jr_media_play_key mode="add" media_id=$SONG_ID}">Play song_id {$SONG_ID}</a>

And then in the "footer_template" call it with the "save" mode, which then stores all generated keys in the database in a single query:

{jr_media_play_key mode="save"}

 


{jr_media_access} page 161 of 185 {jr_not_logged_in}
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom Core
Jamroom Addons
Jamroom Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2012 Talldude Networks, LLC.