The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Adding Thread Author to "Find latest posts" Search Results
Hello All,
I help administrate a math help site, and one of our staff has requested that when we go to a user's profile, and click "Find latest posts" that we see the author of each thread listed in the search results. This will be helpful in quickly determining if a nominee for math helper is consistently posting in threads started by other users. I have attached an image, with the desired added field enclosed in red, to demonstrate what I am wanting to do. I would be grateful if someone could point me to the PHP file where this information is built...I was thinking it would be search.PHP in the root directory, but looking at that file I don't see where this is done. It seems like this would be a fairly simple thing to add, if I just knew where to begin... |
#2
|
|||
|
|||
Perhaps it's because I'm quite tired, but you do realize that the "author" is the person listed after the "by" right?
I'm not sure what you're actually looking for. |
#3
|
||||
|
||||
What I mean is the "Author" is the person who started the thread (the author of the first post in the thread, the thread starter), and "By" is the person who wrote the (possibly subsequent in the thread) post, the person whose posts are being retrieved in the search.
|
#4
|
|||
|
|||
Ah yes, I see what you want to do now. I don't think I can help with this
|
#5
|
||||
|
||||
Have you tried just adding some code to the template instead? There must be code somewhere for then thread starter to just add in that tidbit into the template. possibly something in this template code can help you add this info to your search template:
Code:
<div class="threadmeta"> <div class="author"> <vb:if condition="$show['rmanage']"> <span class="rmanage"><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}postings.php?{vb:raw session.sessionurl}do=editthread&t={vb:raw thread.redirectthreadid}">{vb:rawphrase manage}</a></span> </vb:if> <vb:if condition="!$show['detailedtime']"> {vb:rawphrase started_by_x_y_z_a, {vb:link member, {vb:raw thread}, null, 'postuserid', 'postusername'}, {vb:raw thread.postusername}, {vb:raw thread.startdate}, {vb:raw thread.starttime}, {vb:stylevar dirmark}} <vb:else /> {vb:rawphrase started_by_x_y_z, {vb:link member, {vb:raw thread}, null, 'postuserid', 'postusername'}, {vb:raw thread.postusername}, {vb:raw thread.startdate}, {vb:stylevar dirmark}} </vb:if> <vb:if condition="$show['unsubscribe']"> <a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}newreply.php?{vb:raw session.sessionurl}do=newreply&t={vb:raw thread.threadid}" rel="nofollow">{vb:rawphrase reply}</a> | <a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}subscription.php?{vb:raw session.sessionurl}do=removesubscription&return=ucp&t={vb:raw thread.threadid}" rel="nofollow">{vb:rawphrase unsubscribe}</a> </vb:if> <vb:if condition="$thread['pagenav']"> <dl class="pagination" id="pagination_threadbit_{vb:raw thread.realthreadid}"> <dt class="label">{vb:raw thread.totalpages} {vb:rawphrase pages} <span class="separator">•</span></dt> <dd> {vb:raw thread.pagenav} <vb:if condition="$show['pagenavmore']"> <span class="separator">...</span> <span><a href="{vb:raw thread.lastpagelink}">{vb:raw thread.totalpages}</a></span></vb:if> </dd> </dl> </vb:if> <!-- iconinfo --> <div class="threaddetails td"> <div class="threaddetailicons"> <vb:if condition="$show['taglist']"> <img src="{vb:stylevar imgdir_misc}/tag.png" alt="{vb:raw thread.taglist}" /> </vb:if> <vb:if condition="$show['rexpires']"> <img src="{vb:stylevar imgdir_misc}/expires.gif" alt="{vb:rawphrase expires_on_x_y, {vb:raw thread.expiredate}, {vb:raw thread.expiretime}}" /> </vb:if> <vb:if condition="$show['moderated']"> <img src="{vb:stylevar imgdir_misc}/moderated_small.gif" alt="{vb:rawphrase x_moderated_posts, {vb:raw thread.hiddencount}}" /> </vb:if> <vb:if condition="$show['deletedthread']"> <img src="{vb:stylevar imgdir_misc}/trashcan_small.gif" alt="{vb:rawphrase x_deleted_posts, {vb:raw thread.deletedcount}}" /> </vb:if> <vb:if condition="$show['paperclip']"> <a href="javascript://" onclick="attachments({vb:raw thread.threadid}); return false"> <img src="{vb:stylevar imgdir_misc}/paperclip.png" border="0" alt="{vb:rawphrase x_attachments, {vb:raw thread.attach}}" /></a> </vb:if> <vb:if condition="$show['subscribed']"> <img src="{vb:stylevar imgdir_misc}/subscribed.png" alt="{vb:rawphrase you_are_subscribed_to_this_thread}" /> </vb:if> </div> </div> |
#6
|
||||
|
||||
Yes, my first thought was to modify the "search_resultlist" template, but what I found is that all of the search results information for that query is returned as HTML in {vb:raw searchbits}.
HTML Code:
<vb:if condition="$show['results']"> <ol id="searchbits" start="1" class="searchbits"> {vb:raw searchbits} </ol> <vb:else /> |
#7
|
||||
|
||||
Try the "search_threadbit" template instead. It may be where you need to edit. Sometimes the vB Raw command is actually calling a template or a portion of a template.
|
Благодарность от: | ||
MarkFL |
#8
|
||||
|
||||
Thanks, I did look at that template too, but I believe it is responsible for displaying the thread listing when doing a simple word search or an advanced search.
|
#9
|
||||
|
||||
Ah! ok i see I missed the part about clicking the "Find Posts" in the users profile. Try this template then instead: "search_results_postbit" It is probably the place you need to look. you can put your code to add your author in this bit of code in the template. Just find this code:
Code:
<div class="userinfo_noavatar"> <div class="contact"> <div class="username_container"> <h2>{vb:rawphrase thread}: <a href="{vb:link thread, {vb:raw post}, null, 'threadid', 'threadtitle'}" title="{vb:raw post.threadtitle}">{vb:raw post.threadtitle}</a></h2> <vb:if condition="$post['userid']"> {vb:rawphrase by_x, {vb:link member, {vb:raw post}, null, 'userid', 'username'}, {vb:raw post.username}} <vb:else /> {vb:rawphrase by_x_guest, {vb:raw post.username}} </vb:if> </div> </div> Code:
<div class="userinfo_noavatar"> <div class="contact"> <div class="username_container"> <h2>{vb:rawphrase thread}: <a href="{vb:link thread, {vb:raw post}, null, 'threadid', 'threadtitle'}" title="{vb:raw post.threadtitle}">{vb:raw post.threadtitle}</a></h2> <vb:if condition="$post['userid']"> {vb:rawphrase by_x, {vb:link member, {vb:raw post}, null, 'userid', 'username'}, {vb:raw post.username}} <vb:else /> {vb:rawphrase by_x_guest, {vb:raw post.username}} </vb:if> <div>Author: YOUR AUTHOR CODE HERE</div> </div> </div> |
#10
|
|||
|
|||
OK, create a new plugin using hook location search_results_postbit and this code:
PHP Code:
then edit template search_results_postbit and add something like this (the red part was added: Code:
<vb:if condition="$post['postuserid']"> author <a href="{vb:link member, {vb:raw post}, null, 'userid', 'username'}">{vb:raw post.postusername}</a><br/> <vb:else /> {vb:rawphrase by_x_guest, {vb:raw post.postusername}} </vb:if> <vb:if condition="$post['userid']"> {vb:rawphrase by_x, {vb:link member, {vb:raw post}, null, 'userid', 'username'}, {vb:raw post.username}} <vb:else /> {vb:rawphrase by_x_guest, {vb:raw post.username}} </vb:if> Also if you want you could create phrases and use them like the "by" section does. Edit: oh, I just re-read your first post. I probably should just have told you that you want to look at packages/vbforum/search/result/post.php and let you handle the rest. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|