PDA

View Full Version : Prefixes in "Latest Threads" sidebar block


Fields
07-01-2014, 11:47 AM
Hello,

I would like to display thread prefixes in the "Latest Threads" forum sidebar block. I tried it for hours and searched for a solution, but I can't get it working.
The template (block_threads) for this sidebar block contains the following code:


<li>
<div class="block smaller">
<div class="blocksubhead">
<a class="collapse" id="collapse_block_newthreads_{vb:raw blockinfo.blockid}" href="{vb:raw relpath}#top"><img alt="" src="{vb:stylevar imgdir_button}/collapse_40b.png" id="collapseimg_newthreads_{vb:raw blockinfo.blockid}"/></a>
<img src="{vb:stylevar imgdir_cms}/widget-forum.png" alt="" />
<span class="blocktitle">{vb:raw blockinfo.title}</span>
</div>
<div class="widget_content blockbody floatcontainer">
<ul id="block_newthreads_{vb:raw blockinfo.blockid}" class="blockrow">
<vb:each from="threads" key="threadid" value="thread">
<li class="<vb:if condition="!$vboptions['avatarenabled']">no</vb:if>avatarcontent floatcontainer widget_post_bit">
<div class="widget_post_userinfo">
<vb:if condition="$vboptions['avatarenabled']">
<div class="cms_widget_post_useravatar widget_post_useravatar">
<vb:if condition="$thread['userid']">
<a class="smallavatar comments_member_avatar_link" href="{vb:link member, {vb:raw thread}}">
</vb:if>
<vb:if condition="$thread['showavatar']">
<img src="{vb:raw thread.avatarurl}" alt="{vb:raw thread.postusername}" />
<vb:else />
<img src="{vb:stylevar imgdir_misc}/unknown.gif" alt="{vb:raw thread.postusername}" />
</vb:if>
<vb:if condition="$thread['userid']">
</a>
</vb:if>
</div>
</vb:if>
</div>
<div class="smallavatartext widget_post_comment<vb:if condition="!$vboptions['avatarenabled']">_noavatar</vb:if>">
<h5 class="widget_post_header"><a href="{vb:raw thread.url}" class="title">{vb:raw thread.title}</a></h5>
<div class="meta">
<vb:if condition="$threadstype == 0">
{vb:stylevar dirmark} {vb:rawphrase posted_by} <vb:if condition="$thread['userid']"><a href="{vb:link member, {vb:raw thread}}">{vb:raw thread.postusername}</a><vb:else />{vb:raw thread.postusername}</vb:if> {vb:stylevar dirmark}({vb:rawphrase x_replies, {vb:raw thread.replycount}})
<br />{vb:raw thread.date}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw thread.time}</span></vb:if> {vb:rawphrase in_x, {vb:link forum, {vb:raw thread}, null, 'forumid', 'forumtitle'}, {vb:raw thread.forumtitle}}
<vb:else />
{vb:stylevar dirmark}{vb:rawphrase last_post_by} <vb:if condition="$thread['lastposterid']"><a href="{vb:link member, {vb:raw thread}, null, 'lastposterid', 'lastposter'}">{vb:raw thread.lastposter}</a><vb:else />{vb:raw thread.lastposter}</vb:if> {vb:stylevar dirmark}({vb:rawphrase x_replies, {vb:raw thread.replycount}})
<br />
{vb:raw thread.lastpostdate}<vb:if condition="!$show['detailedtime']">, <span class="time">{vb:raw thread.lastposttime}</span></vb:if> {vb:rawphrase in_x, {vb:link forum, {vb:raw thread}, null, 'forumid', 'forumtitle'}, {vb:raw thread.forumtitle}}
</vb:if>
</div>
</div>
</li>
</vb:each>
</ul>
</div>
</div>
<div class="underblock"></div>
</li>


Can anyone tell me, what I have to add to get prefixes showing in the block?

I appreciate your help!

Best regards,
Fields (vB 4.2.2)

Fields
07-04-2014, 09:39 AM
Anyone who can help?

mokujin
07-04-2014, 09:43 AM
Can you send your PHP code too? I'll have a look then.

Fields
07-04-2014, 10:05 AM
I'm not sure where to find the PHP code. I can only find the template related to the "Latest Threads" sidebar block. It's the standard vBulletin sidebar block which displays the latest threads.

Dave
07-04-2014, 10:12 AM
In the threadbit template, it's defined in the {vb:raw thread.prefix_rich} variable, I'm not sure if you can use that in the block though. You can always give it a shot.

Here is the complete piece of code in the threadbit template:
<vb:if condition="$thread['movedprefix'] OR $thread['typeprefix'] OR $thread['moderatedprefix'] OR $thread['prefix_rich']">
<span id="thread_prefix_{vb:raw thread.realthreadid}" class="prefix understate">
{vb:raw thread.movedprefix}
{vb:raw thread.typeprefix}
{vb:raw thread.moderatedprefix}
{vb:raw thread.prefix_rich}
</span>
</vb:if>

Fields
07-04-2014, 02:32 PM
Thanks for your answer, but this doesnt' work for me :/

mokujin
07-04-2014, 02:43 PM
Try this: https://vborg.vbsupport.ru/showthread.php?t=312674 :D

Fields
07-04-2014, 07:09 PM
Thanks for your help! Installed, rated with 5 stars and nominated for MOTM! :) Nice work.

mokujin
07-04-2014, 07:24 PM
Lol, it isnt MOD but template edit, glad to help you :D

Fields
07-04-2014, 07:30 PM
Lol, it isnt MOD but template edit, glad to help you :D

Sure, it's a template MODification ;)