The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to add last post content snippet to New Posts list?
I'd like to add a snippet of the content of the last post in each thread to the list that's shown in New Posts. So I'd like to show the thread title, a snippet of the last post, the name of the last poster and then some thread stats.
I'm looking at the search_threadbit template. I've got the title, thread status etc all working. This is the top part of the code that I've got so far (it's not all of it so ignore if <div></div>s don't match up)... Code:
<li class="imodselector threadbit {vb:if !$thread['del_username'], $thread['statusstring']}<vb:if condition="$show['paperclip']"> attachments</vb:if><vb:if condition="$show['inlinemod']"> inlinemod</vb:if><vb:if condition="!$thread['postuserid'] AND !$thread['del_userid']"> guest</vb:if><vb:if condition="$thread['moderatedprefix']"> unapproved</vb:if>" id="thread_{vb:raw thread.realthreadid}"> <div class="icon{vb:raw thread.threadiconid} rating{vb:raw thread.rating}<vb:if condition="$thread['sticky']"> sticky<vb:else /> nonsticky</vb:if>{vb:if $thread['del_username'], ' deleted'}"> <div class="threadinfo thread"> <!-- status icon block --> <a class="threadstatus" rel="vB::AJAX" <vb:if condition="$show['threadcount']">title="{vb:rawphrase have_x_posts_in_thread_last_y, {vb:raw thread.dot_count}, {vb:raw thread.dot_lastpost}}"</vb:if>></a> <!-- title / author block --> <div class="inner"> <h3 class="threadtitle"> <vb:if condition="$thread['movedprefix'] OR $thread['typeprefix'] OR $thread['moderatedprefix'] OR $thread['prefix_rich']"> <span class="prefix understate"> {vb:raw thread.movedprefix} {vb:raw thread.moderatedprefix} {vb:raw thread.prefix_rich} </span> </vb:if> <a class="title<vb:if condition="$show['gotonewpost']"> threadtitle_unread</vb:if>" href="{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_lastpost}, 'threadid', 'threadtitle'}#post{vb:raw thread.lastpostid}"><vb:if condition="$thread['sticky']"><span>STICKY</span></vb:if>{vb:raw thread.threadtitle}</a> </h3> <vb:if condition="$thread['status']"> <div class="threadstatus"> <vb:if condition="$show['subscribed'] OR THIS_SCRIPT == 'subscription'"> <div class="threadstatusbit tstatus_subscribed" title="Subscribed"></div> </vb:if> <vb:each from="thread['status']" value="row"> <vb:if condition="$row != 'hot'"> <div class="threadstatusbit tstatus_{vb:raw row}" title="{vb:raw row}"></div> </vb:if> </vb:each> </div> <vb:else /> <div class="threadstatus"> <div class="threadstatusbit"></div> </div> </vb:if> </div> <!-- iconinfo --> <div class="threaddetails"> <div class="threaddetailicons"> <vb:if condition="$show['moderated']"> Moderated </vb:if> </div> </div> </div> <vb:if condition="$thread['del_username']"> <!-- deleted by --> <div class="threaddeleted td"> <div class="inner"> <div class="deletedby"> {vb:rawphrase thread_deleted_by_x, {vb:link member, {vb:raw thread}, null, 'del_userid', 'del_username'}, {vb:raw thread.del_username}} </div> <vb:if condition="$show['deletereason']"> <dl class="stats deletereason"> <dt class="reason">{vb:rawphrase reason}</dt> <dd class="reason"> {vb:raw thread.del_reason}</dd> </dl> </vb:if> </div> </div> <vb:else /> <!-- lastpost --> <div class="contact"> <div class="userAvatar"> <a class="postuseravatarlink" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}"> <vb:if condition="$post.avatarurl && $show['avatar']"> <img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" /> <vb:else /> <img src="/images/layout/noImageUser.jpg" /> </vb:if> </a> </div> </div> {vb:raw template_hook.postbit_messagearea_start} <div class="postrow"> <div class="content"> <div id="post_message_{vb:raw post.postid}"> <blockquote class="postcontent restore"> {vb:raw post.message} </blockquote> </div> </div> </div> <div class="threadstatslatest"> <span class="tlpuser">{vb:raw thread.lastposter}</span> <div class="threadlastpost"> <span class="tlptime">{vb:raw thread.lastposttime}</span> | <span class="tlpdate">{vb:raw thread.lastpostdate}</span> | {vb:raw thread.replycount} <vb:if condition="$thread['replycount'] == 1">reply<vb:else />replies</vb:if> | {vb:raw thread.forumtitle} </div> </div> </vb:if> And for the avatar bit in red, how do I change that code so it's looking at the avatar for the lastposter? (that bit of code is copied from postbits) Thank you in advance to anyone who is better vb coder than me |
#2
|
|||
|
|||
|
#3
|
||||
|
||||
|
#4
|
|||
|
|||
i forgot about that mod Mark
|
#5
|
||||
|
||||
Yeah, I don't know if that would be sufficient for the OP, but it was the closest thing I could think of. It avoids cluttering the threadbits.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|