Post by tunescool on May 14, 2013 5:44:57 GMT -8
This will add the number of Likes the First Post has in the Thread List. The Threads Topic, what the Thread is about, not the total number of Likes in all of the Posts in the Thread.
There's 3 different positions you can add the Number Of Likes
Themes - Layout Templates - Board - Thread List Tab
The Template is only 30 lines, everything is towards the top
It will display as 1 Like if there's only 1 Like and 2 Likes if there's more than 1 Like
The first position is Before The Thread Link
Add the blue line, adjust the green to your forums style
{foreach $[thread]}
<tr id="$[thread.content_id]" class="$[thread.content_class]">
<td class="icon last">$[thread.icon]</td>
<td class="checkbox clickable">$[thread.checkbox]</td>
<td class="main clickable last" title="$[thread.short_content]">
<table>
<tr>
<td>$[thread.icons]</td>
<td>$[thread.labels]
<span class="thread-likes" style="font-size:12px; font-weight:bold; font-style:italic; color: #00138E;">{if $[thread.first_post.likes.total]}$[thread.first_post.likes.total] Like{if $[thread.first_post.likes.total] != 1}s{/if} - {/if}</span>
<span class="link target">$[thread]</span>
{if $[thread.pagination]}<div class="ui-micro-pagination">Pages $[thread.pagination]</div>{/if}
</td>
</tr>
</table>
The second position is After The Thread Link
Add the blue line, adjust the green to your forums style
{foreach $[thread]}
<tr id="$[thread.content_id]" class="$[thread.content_class]">
<td class="icon last">$[thread.icon]</td>
<td class="checkbox clickable">$[thread.checkbox]</td>
<td class="main clickable last" title="$[thread.short_content]">
<table>
<tr>
<td>$[thread.icons]</td>
<td>$[thread.labels]
<span class="link target">$[thread]</span>
<span class="thread-likes" style="padding-left: 2px; font-size:12px; font-weight:bold; font-style:italic; color: #00138E;">{if $[thread.first_post.likes.total]}- $[thread.first_post.likes.total] Like{if $[thread.first_post.likes.total] != 1}s{/if}{/if}</span>
{if $[thread.pagination]}<div class="ui-micro-pagination">Pages $[thread.pagination]</div>{/if}
</td>
</tr>
</table>
If You Use Inline Micro Pagination or would like to add it to your thread list
Add the blue line, adjust the green to your forums style
add the purple to add Inline Micro Pagination
{foreach $[thread]}
<tr id="$[thread.content_id]" class="$[thread.content_class]">
<td class="icon last">$[thread.icon]</td>
<td class="checkbox clickable">$[thread.checkbox]</td>
<td class="main clickable last" title="$[thread.short_content]">
<table>
<tr>
<td>$[thread.icons]</td>
<td>$[thread.labels]
<span class="link target">$[thread]</span>
{if $[thread.pagination]}<div class="ui-micro-pagination" style="padding-left: 2px; display: inline;">Pages $[thread.pagination]</div>{/if}
<span class="thread-likes" style="padding-left: 2px; font-size:12px; font-weight:bold; font-style:italic; color: #00138E;">{if $[thread.first_post.likes.total]}- $[thread.first_post.likes.total] Like{if $[thread.first_post.likes.total] != 1}s{/if}{/if}</span>
</td>
</tr>
</table>
The third position is in its own Cell In The Thread List between Created By and Replies
Add the blue line. You can put it anywhere you want, before Created By, Before Replies, before the Last Post Cell
Adjust the green to your forums style
<td class="created-by clickable">$[thread.created_by_user]</td>
<td class="threadlikes" style="padding-right: 0px; font-size:12px; font-weight:bold; font-style:italic; color:
#00138E;">$[thread.first_post.likes.total]{if $[thread.first_post.likes.total] > 1} Likes{elseif $[thread.first_post.likes.total] > 0} Like{else} {/if}</td>
<td class="views">$[thread.views]</td>
<td class="latest last">By $[thread.last_post.created_by_user]<br />$[thread.last_post.date]</td>
You have to add the blue line to your CSS in the Thread List Area of your Stylesheet
adjust the width to your forums style and remember to Take Off That Much Percentage From One Or More Cells
If Your Like Cell Is 5% You Have To Take Off 5% Of Another Cell
.threads .main { width: 53%; text-align: @thread_align_subject; }
.threads .threadlikes { width: 5%; text-align: center; }
.threads .created-by { width: 14%; text-align: @thread_align_created_by; }
.threads .replies { width: 4%; text-align: @thread_align_replies; }
.threads .views { width: 5%; text-align: @thread_align_views; }
.threads .latest { width: 13%; text-align: @thread_align_last_post; }
There's 3 different positions you can add the Number Of Likes
Themes - Layout Templates - Board - Thread List Tab
The Template is only 30 lines, everything is towards the top
It will display as 1 Like if there's only 1 Like and 2 Likes if there's more than 1 Like
The first position is Before The Thread Link
Add the blue line, adjust the green to your forums style
{foreach $[thread]}
<tr id="$[thread.content_id]" class="$[thread.content_class]">
<td class="icon last">$[thread.icon]</td>
<td class="checkbox clickable">$[thread.checkbox]</td>
<td class="main clickable last" title="$[thread.short_content]">
<table>
<tr>
<td>$[thread.icons]</td>
<td>$[thread.labels]
<span class="thread-likes" style="font-size:12px; font-weight:bold; font-style:italic; color: #00138E;">{if $[thread.first_post.likes.total]}$[thread.first_post.likes.total] Like{if $[thread.first_post.likes.total] != 1}s{/if} - {/if}</span>
<span class="link target">$[thread]</span>
{if $[thread.pagination]}<div class="ui-micro-pagination">Pages $[thread.pagination]</div>{/if}
</td>
</tr>
</table>
The second position is After The Thread Link
Add the blue line, adjust the green to your forums style
{foreach $[thread]}
<tr id="$[thread.content_id]" class="$[thread.content_class]">
<td class="icon last">$[thread.icon]</td>
<td class="checkbox clickable">$[thread.checkbox]</td>
<td class="main clickable last" title="$[thread.short_content]">
<table>
<tr>
<td>$[thread.icons]</td>
<td>$[thread.labels]
<span class="link target">$[thread]</span>
<span class="thread-likes" style="padding-left: 2px; font-size:12px; font-weight:bold; font-style:italic; color: #00138E;">{if $[thread.first_post.likes.total]}- $[thread.first_post.likes.total] Like{if $[thread.first_post.likes.total] != 1}s{/if}{/if}</span>
{if $[thread.pagination]}<div class="ui-micro-pagination">Pages $[thread.pagination]</div>{/if}
</td>
</tr>
</table>
If You Use Inline Micro Pagination or would like to add it to your thread list
Add the blue line, adjust the green to your forums style
add the purple to add Inline Micro Pagination
{foreach $[thread]}
<tr id="$[thread.content_id]" class="$[thread.content_class]">
<td class="icon last">$[thread.icon]</td>
<td class="checkbox clickable">$[thread.checkbox]</td>
<td class="main clickable last" title="$[thread.short_content]">
<table>
<tr>
<td>$[thread.icons]</td>
<td>$[thread.labels]
<span class="link target">$[thread]</span>
{if $[thread.pagination]}<div class="ui-micro-pagination" style="padding-left: 2px; display: inline;">Pages $[thread.pagination]</div>{/if}
<span class="thread-likes" style="padding-left: 2px; font-size:12px; font-weight:bold; font-style:italic; color: #00138E;">{if $[thread.first_post.likes.total]}- $[thread.first_post.likes.total] Like{if $[thread.first_post.likes.total] != 1}s{/if}{/if}</span>
</td>
</tr>
</table>
The third position is in its own Cell In The Thread List between Created By and Replies
Add the blue line. You can put it anywhere you want, before Created By, Before Replies, before the Last Post Cell
Adjust the green to your forums style
<td class="created-by clickable">$[thread.created_by_user]</td>
<td class="threadlikes" style="padding-right: 0px; font-size:12px; font-weight:bold; font-style:italic; color:
#00138E;">$[thread.first_post.likes.total]{if $[thread.first_post.likes.total] > 1} Likes{elseif $[thread.first_post.likes.total] > 0} Like{else} {/if}</td>
<td class="views">$[thread.views]</td>
<td class="latest last">By $[thread.last_post.created_by_user]<br />$[thread.last_post.date]</td>
You have to add the blue line to your CSS in the Thread List Area of your Stylesheet
adjust the width to your forums style and remember to Take Off That Much Percentage From One Or More Cells
If Your Like Cell Is 5% You Have To Take Off 5% Of Another Cell
.threads .main { width: 53%; text-align: @thread_align_subject; }
.threads .threadlikes { width: 5%; text-align: center; }
.threads .created-by { width: 14%; text-align: @thread_align_created_by; }
.threads .replies { width: 4%; text-align: @thread_align_replies; }
.threads .views { width: 5%; text-align: @thread_align_views; }
.threads .latest { width: 13%; text-align: @thread_align_last_post; }