vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Prefixes in "Latest Threads" sidebar block (https://vborg.vbsupport.ru/showthread.php?t=312605)

Fields 07-01-2014 10:47 AM

Prefixes in "Latest Threads" sidebar block
 
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:

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 08:39 AM

Anyone who can help?

mokujin 07-04-2014 08:43 AM

Can you send your PHP code too? I'll have a look then.

Fields 07-04-2014 09: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 09: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:
PHP Code:

<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 01:32 PM

Thanks for your answer, but this doesnt' work for me :/

mokujin 07-04-2014 01:43 PM

Try this: https://vborg.vbsupport.ru/showthread.php?t=312674 :D

Fields 07-04-2014 06:09 PM

Thanks for your help! Installed, rated with 5 stars and nominated for MOTM! :) Nice work.

mokujin 07-04-2014 06:24 PM

Lol, it isnt MOD but template edit, glad to help you :D

Fields 07-04-2014 06:30 PM

Quote:

Originally Posted by mokujin (Post 2505204)
Lol, it isnt MOD but template edit, glad to help you :D

Sure, it's a template MODification ;)


All times are GMT. The time now is 05:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02224 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete