{jr_forum_topics}
The {jr_forum_topics} Template Function is used for creating a "Latest Discussion" type block to show what users are talking about in the profile forums across your Jamroom.
|
Note: The {jr_forum_topics} Template Function requires the Jamroom Power Pack to function.
This function will not work properly in Profile Theme Templates - make sure you use this in a Skin Template, or include it into a Theme Tempalte via the {jr_theme_template} function.
|
Parameters
Name |
Type |
Required |
Default |
Description |
template |
string |
yes |
n/a |
The "template" parameter tells Jamroom the template you will be using for displaying the latest topics from the profile forums. |
band_id |
number |
no |
0 |
The "band_id" parameter tells Jamroom which profile forum to display the recent entries from. The default value of "0" will show the latest topic posts from all profile forums. |
show |
number |
no |
n/a |
The "show" parameter tells Jamroom the number of recent topics to show. Note that only the most recent 25 topics conversations are stored for viewing. |
cache_time |
number |
no |
60 |
The "cache_time" parameter tells Jamroom how long to "cache" the results for. On very active systems it might be good to set this a bit higher, but the default of 5 seconds should be good for most systems. |
assign |
string |
no |
n/a |
If you would like to assign the output of the template to a template variable, you can enter the name of the variable as the "assign" parameter. |
Example
Show the most recent 6 topics being posted to across all Profile Forums:
{jr_forum_topics template="jr_forum_latest_topics.tpl" band_id="0" show="6" cache_time="90"}
|
Contents of the jr_forum_latest_topics.tpl template file:
{foreach from=$TOPICS item="_topic"}
{jr_lang id="237" default="in"}:
{* if we get a $POST_SERVER variable, the profile is on a cluster server *}
{if isset($_topic.POST_SERVER)}
<a href="{$_topic.POST_SERVER}/forum.php?band_id={$_topic.FORUM_BAND_ID}&t={$_topic.TOPIC_ID}&p={$_topic.POST_PAGE_NUM}#{$_topic.TOPIC_POST_COUNT}">
{$_topic.TOPIC_TITLE|jr_strip_html|truncate:20:"..."}
</a>
{else}
<a href="forum.php?band_id={$_topic.FORUM_BAND_ID}&t={$_topic.TOPIC_ID}&p={$_topic.POST_PAGE_NUM}#{$_topic.TOPIC_POST_COUNT}">
{$_topic.TOPIC_TITLE|jr_strip_html|truncate:20:"..."}
</a>
{/if}
<br />
{jr_lang id="238" default="by"}: {$_topic.TOPIC_LAST_USER|jr_strip_html|truncate:20:"..."}
<hr class="body_1" size="1">
{/foreach} |
|