Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Who Posted in SHOWTHREAD Details »
Who Posted in SHOWTHREAD
Mod Version: 1.00, by grey_goose (Coder/Designer) grey_goose is offline
Developer Last Online: Oct 2019 I like it Show Printable Version Email this Page

vB Version: 4.2.2 Rating: (0 vote - 0 average) Installs: 5
Released: 22 Sep 2015 Last Update: Never Downloads: 0
Not Supported Uses Plugins Template Edits Re-usable Code  

I wanted to be able to show who had participated in a given thread within the thread. This is available via WHOREAD in the forum listing, but it didn't feel as intuitive. Now, users can see immediately who's posted in a given thread.

What's involved:
1. Create a plugin
2. Create a template to display plugin info
3. Create a replacement variable
3. Edit SHOWTHREAD to call the template

Creating the plugin
This is pretty much a straight copy of the code from misc.php into a plugin, and registering the variable (thanks Lynne).
1. Admincp > Plugins & Products > Add New Plugin
Product: Vbulletin
Title: Who Posted in Showthread
Hook Location: showthread_start
Execution Order: 5
Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Plugin is Active: Yes

Creating the template
Sharp eyes will have caught that the template is going to be named "showthreadwhoposted". I'm super original like that.
1. Styles and Templates > Style Manager > Add New Template
Title: showthreadwhoposted
Template:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Note that this template creates 30px avatars that float. You can choose to make a simple list of username links, or resize the avatars, however you like. This is just how I wanted them displayed.

Create a replacement variable
Vbulletin isn't super helpful when it comes to calling avatars by username instead of userids, so we had to get a little bit hacky in the template above. This bit right here:
"http://nwod.org/forum/image.php?u={vb:link member, {vb:raw post}}"
Needs to be cleaned up.
1. Styles and Templates > Replacement Variable Manager > Add New Replacement Variable
Search for Text: image.php?u=member.php?
Replace with Text: image.php?u=

This strips out the raw link we called, leaving us with just the userid. If someone knows of a better way to call the userid, this might not be necessary and the Template could be edited.

Edit SHOWTHREAD to call the template
We've made the plugin fetch who's posted, rendered it into a template, and cleaned up the avatar image URL in said template. Now we just need to place the display of users who posted in the SHOWTHREAD template.
1. Search in Templates > SHOWTHREAD (search Titles only) > Find
2. Search for the first occurence of "<vb:if condition="$pagenav">". This will position our list above the pagination and tools menu bar.
3. Add the following:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

This will create a floating list of posters.

If everything has been done properly you should see something like this:


My SHOWTHREAD is modified a bit, but you get the general idea. Right above the pagination is a list of avatars that link to the member's page.

Happy forum'ing!

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
New Posting Features Showthread: Posted Hyperlink Colour princeedward vBulletin 3.6 Template Modifications 18 07 Aug 2013 23:55

Comments
  #2  
Old 24 Sep 2015, 15:59
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
It would be great if you make into mod, would be much easier to install.

Anyway, interesting idea.
Reply With Quote
  #3  
Old 24 Sep 2015, 17:49
Justinphx Justinphx is offline
 
Join Date: Jan 2012
Looks nice. What if a thread has 100+ posts within it? That would be a lot a avatars to display. Is there a way to limit it?
Reply With Quote
  #4  
Old 25 Sep 2015, 23:37
grey_goose grey_goose is offline
 
Join Date: Jun 2009
Originally Posted by Justinphx View Post
Looks nice. What if a thread has 100+ posts within it? That would be a lot a avatars to display. Is there a way to limit it?
There are a few ways to go about it (limit query) but the easiest might just to be to throw a MAX-HEIGHT: 35PX and OVERFLOW: HIDDEN on the container DIV.
Reply With Quote
  #5  
Old 08 Oct 2015, 09:36
friendlymela's Avatar
friendlymela friendlymela is offline
 
Join Date: Dec 2012
Real name: Zeeshan Shams
This is nice one..
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 23:05.

Layout Options | Width: Wide Color: