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.

{jr_chart} Index {jr_counter}

{jr_comment}


{jr_comment} is used within a Jamroom template to embed a "comment" section within the template.

Parameters:

Name Type Required Default Description
type string yes n/a Jamroom supports comments for a wide variety of items in Jamroom.  the "type" parameter tells Jamroom what type of comment(s) you want to show.  Valid options are: "artist", "song", "video", "radio", "photo", "event", "vault", "item" and "message".
template string yes n/a the template parameter defines the name of the template that will be used for displaying the information (block).
quota_id integer no n/a If you would like to display comments that are associated with artist from a specific Jamroom Quota, you can pass in the Jamroom Quota, or array of Jamroom Quotas (using the {jr_array} template function) and only comments for artists from the given Jamroom Quota(s) will be shown.
band_id integer no 0 The band_id is used to tell Jamroom that the comments you want to see should only be for a specific artist_id in Jamroom.  You may also pass in an array of band_id's using the {jr_array} template function.
song_id integer no n/a If you are using the song type, then you can pass a song_id to see comments for a single song.
video_id integer no n/a If you are using the video type, then you can pass a video_id to see the comments for a single video.
radio_id integer no n/a If you are using the radio type, then you can pass a radio_id to see the comments for a single radio station.
photo_id integer no n/a If you are using the photo type, then you can pass a photo_id to see the comments for a single photo.
event_id integer no n/a If you are using the event type, then you can pass an event_id to see the comments for a single event
vault_id integer no n/a If you are using the vault type, then you can pass a vault_id to see the comments for a single vault entry.
item_id integer no n/a If you are using the item type, then you can pass an item_id to see the comments for a single store item.
message_id integer no n/a If you are using the message type, you can pass a message_id to see the comments for a single blog entry (message).
show integer no "Page Results" setting in Jamroom Config You can pass in the optional "show" parameter which tells Jamroom you want to limit the amount of comments that are shown to the amount specified.
tpl_dir string no theme The tpl_dir will tell the function which directory to find the display template in.  Can either be "theme" or "skin".
skin string no Active Skin Name If the template you would like to use to display the comments is not located in the Active Skin directory, you can specify the skin name where Jamroom can find the template.
theme string no n/a If the template you would like to use to display the comments is located in a theme directory, you can specify the theme name where Jamroom can find the template.

 

Example:

Example using {jr_comment} to embed a comment block within another template, to show the last 5 blog comments entered by users:

{jr_comment type="message" template="jr_comments.tpl" show="5" skin="Cobalt"}


jr_comments.tpl contents:

{* do our loop for the songs from this playlist *}
{foreach from=$COMMENTS key=key item=_entry}
<div class="body-1" style="padding: 0px;">
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td width="01%" rowspan="3" valign="top" align="center" class="row-1">
        <a href="{$_entry.COMMENT_USER_URL}/"><img src="{$_entry.COMMENT_USER_IMAGE_URL}&amp;width=64" width="64" border="0" alt="User Image" title="User Image"></a><br>

        {* COMMENT_USER_URL will only be set if the User has a member page on the system *}
        {if strlen($_entry.COMMENT_USER_URL) > 0}
         <a href="{$_entry.COMMENT_USER_URL}/">{$_entry.COMMENT_NICK}</a>
        {/if}

      </td>
      <td width="90%" class="row-1" style="padding: 3px; height: 15px;">&raquo; {$_entry.COMMENT_NICK}</td>
      <td width="10%" nowrap="nowrap" class="row-1" style="padding: 3px; height: 15px;">{$_entry.COMMENT_TIME|jr_date_format:"date1"}</td>
    </tr>
    <tr>
      <td width="100%" colspan="2" class="inset-1" valign="top" style="padding: 3px; height: 60px;">{$_entry.COMMENT_TEXT|nl2br|stripslashes}</td>
    </tr>
    <tr><td width="100%" colspan="2" class="row-1" style="height: 1px"></tr>
  </table>
</div>
{/foreach}

{* Add in our new comment form if the user is logged in *}
<div class="head-1">Your Comment</div>
<div class="body-1" style="padding: 10px; padding-right: 15px">
<form method="post" action="{$JAMROOM_URL}/comment.php?mode=save_comment&amp;band_id={$BAND_ID}&amp;type={$COMMENT_TYPE}">
<input type="hidden" name="template" value="jr_blog_expand.tpl">
<input type="hidden" name="message_id" value="{$TYPE_ID}">

{* if our user is NOT logged in, we want to show email address and nickname fields *}
{if strlen($_USER.user_nickname) === 0}
  Your Email Address:<br>
  <input type="text" name="c_email" value="{$c_email}" class="text" style="width: 300px;"><br>
  Your Name:<br>
  <input type="text" name="c_nick" value="{$c_nick}" class="text" style="width: 300px;"><br>
  Your Comment:<br>
{/if}

<textarea name="c_body" rows="6" style="width: 100%; padding: 2px">{$c_body}</textarea><br>
<input type="submit" value="submit" class="button">
</form>
</div>

{jr_chart} page 135 of 185 {jr_counter}
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