Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
User Avatars In Thread Listing Details »»
User Avatars In Thread Listing
Version: 1.03, by shabbirbhimani shabbirbhimani is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 4.x.x Rating:
Released: 08-15-2011 Last Update: 08-20-2011 Installs: 263
Uses Plugins Template Edits
Re-useable Code  
No support by the author.

Download vB 3.8.x Compatible Version Here

What does this plugin do?

This plugin add user avatars to the thread listing in forum display page. See the sceenshot for sample.



How to Install the plugin?

This plugin requires you edit vBulletin templates.

Import the xml file from the product manager..

Edit the threadbit template.

Find

HTML Code:
<vb:if condition="$show['threadicon']">
And add the following just above it.

HTML Code:
<a href="{vb:link member, {vb:raw thread}, null, 'postuserid', 'postusername'}"><img height="32px" width="32px" style="float:left;margin-right:4px" src="{vb:raw thread.avatarurl}" border="0" /></a>
Find

HTML Code:
<dt>{vb:rawphrase last_post_by}</dt>
Please note: Some custom templates have the above code as
Code:
<dt class="lastpostby hidden">{vb:rawphrase last_post_by}</dt>


And add the following just above it.

HTML Code:
<a href="{vb:link member, {vb:raw thread}, null, 'lastposterid', 'lastposter'}"><img height="32px" width="32px" style="float:left;margin-right:4px" src="{vb:raw thread.lastposteravatarurl}" border="0" /></a>
Edit forumhome_forumbit_level1_post and forumhome_forumbit_level2_post templates as follows.

Find

HTML Code:
{vb:raw forum.lastpostinfo}
And add the following code just above it.

HTML Code:
<a href="{vb:link member, {vb:raw forum}, null, 'real_lastposterid', 'real_lastposter'}"><img height="48px" width="48px" style="float:left;margin-right:4px" src="{vb:raw forum.avatarurl}" border="0" /></a>
Edit search_threadbit

Find the first occurrence of

HTML Code:
<div class="inner">
And add after that

HTML Code:
<a href="{vb:link member, {vb:raw thread}, null, 'postuserid', 'postusername'}"><img height="32px" width="32px" style="float:left;margin:7px 4px 0 0" src="{vb:raw thread.avatarurl}" border="0" /></a>
Then again find

HTML Code:
<dl class="threadlastpost td">
And add after that

HTML Code:
<a href="{vb:link member, {vb:raw thread}, null, 'lastposterid', 'lastposter'}"><img height="32px" width="32px" style="float:left;margin-right:4px" src="{vb:raw thread.lastposteravatarurl}" border="0" /></a>
Edit search_results_postbit

Find

HTML Code:
<div class="contact">
And add after that

HTML Code:
<a href="{vb:link member, {vb:raw post}, null, 'userid', 'username'}"><img height="32px" width="32px" style="float:left;margin-left:4px" src="{vb:raw post.avatarurl}" border="0" /></a>
Upgrading Instructions

If you are upgrading the plugin, just import the new plugin file and overwrite the existing plugins. Once done make the necessary edits to the search templates.

Credits
  1. Last poster's avatar idea by James from VirtueScience

Support

This plugin is supported, so you can post your issues and queries either on my blog or in comments below.

If you would like to Optimize your vBulletin for Less Server Load & Better User Experience, read this post on Optimizing vBulletin

History

Updated 21st August
  1. Added support for avatars in search results.
  2. Fixed bug for thread started by guests.

Updated 18th August
  1. Avatar of sub forums last post bug fixed.

Updated 17th August
  1. Added Support for avatars in forumhome
  2. Avatars linked to member urls

Enjoy!!!

Download Now

File Type: xml product-xfstyleavatars-v1.03-vb4.xml (4.2 KB, 1192 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #102  
Old 08-21-2011, 03:55 PM
shabbirbhimani's Avatar
shabbirbhimani shabbirbhimani is offline
 
Join Date: Nov 2004
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mark.B View Post
Fantastic add-on.

One thing people may want to be aware of is that each avatar adds a query to the page.
Now it's worth noting that if you are on vb4, there's a "bug" in the search files whereby, for a "getnew/getdaily" search (New Posts or Today's Posts), the avatar of the thread starter is ALREADY called, (but not used), meaning if you have 20 results per page you are adding 20 queries. This hack then duplicates that, adding another 20.

Andreas has posted instructions for fixing that problem with the search files in THIS Jira bug. If you're not used to DIFF files it can be a bit tricky, but it's do-able.
Yes I would totally agree on this and I will try and see if I can reduce the query by re-using the avatars.

For vB3.8 Mod I have made sure the queries are kept to minimum because we don't have the userid of the last poster and so instead of fetching the userid from username I have created a function to fetch avatar URL from username. You can refer to my blog post here for the same.
Reply With Quote
  #103  
Old 08-21-2011, 05:11 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shabbirbhimani View Post
Yes I would totally agree on this and I will try and see if I can reduce the query by re-using the avatars.
You could do, (which is how I did it on my site), however if they do fix this bug then it will leave the mod broken for subsequent versions. It's a tricky one.
Reply With Quote
  #104  
Old 08-21-2011, 05:37 PM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Threadbit avatar (file system one also) can be displayed without even adding a single sql query..
You will need to join tables of avatar in $thread array by using forumdisplay_query AND threabit_process plugin.

i remember i did same kind of paid mod for one guy long ago and this mod really gives a cool look to forum.
Reply With Quote
  #105  
Old 08-21-2011, 05:50 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
Threadbit avatar (file system one also) can be displayed without even adding a single sql query..
You will need to join tables of avatar in $thread array by using threabit_process plugin.

i remember i did same kind of paid mod for one guy long ago and this mod really gives a cool look to forum.
That's be a handy one to grasp. Beyond my skills at this stage though....
Reply With Quote
  #106  
Old 08-21-2011, 07:59 PM
eTiKeT?'s Avatar
eTiKeT? eTiKeT? is offline
 
Join Date: Aug 2008
Location: T?rkiye
Posts: 257
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks İnstalled ....
Reply With Quote
  #107  
Old 08-21-2011, 08:24 PM
Erica1977's Avatar
Erica1977 Erica1977 is offline
 
Join Date: Nov 2009
Location: Laramie, Wyoming
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shabbirbhimani View Post
The plugin is updated to support avatars in search results thread bits as well as post bits.

Enjoy
Thanks for the update great job! :up:
Reply With Quote
  #108  
Old 08-22-2011, 02:26 AM
shabbirbhimani's Avatar
shabbirbhimani shabbirbhimani is offline
 
Join Date: Nov 2004
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mark.B View Post
You could do, (which is how I did it on my site), however if they do fix this bug then it will leave the mod broken for subsequent versions. It's a tricky one.
Yes a tricky one and so is not hurrying into doing that as of now.

Quote:
Originally Posted by Sherif View Post
Threadbit avatar (file system one also) can be displayed without even adding a single sql query..
You will need to join tables of avatar in $thread array by using forumdisplay_query AND threabit_process plugin.
Yes I thought about that when I was writing the plugin but then decided against it because creating a join with threads and posts can be lot more resource heavy than executing the single query. Unless bottle neck we cannot say if one more query is faster or the join but I would assume a query. Share your views as well.
Reply With Quote
  #109  
Old 08-22-2011, 04:55 AM
Badshah93 Badshah93 is offline
 
Join Date: Jun 2010
Location: India
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by shabbirbhimani View Post
Yes a tricky one and so is not hurrying into doing that as of now.

Yes I thought about that when I was writing the plugin but then decided against it because creating a join with threads and posts can be lot more resource heavy than executing the single query. Unless bottle neck we cannot say if one more query is faster or the join but I would assume a query. Share your views as well.
Yes,

I have seen page having 80 queries executed in .5 sec and 12 queries in 1sec (in same site).

whether u join or make new query it will take around same time (.1 sec diiference).. but people like having 20 queries executed in page rather than 40 queries.
Reply With Quote
  #110  
Old 08-22-2011, 05:00 AM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That search thingie ain't working so far. I'll investigate later.
Reply With Quote
  #111  
Old 08-22-2011, 06:08 AM
mavigul mavigul is offline
 
Join Date: Sep 2008
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow that's look great
Reply With Quote
Reply

Thread Tools

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

Forum Jump


All times are GMT. The time now is 07:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06607 seconds
  • Memory Usage 2,373KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (12)bbcode_html
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (26)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete