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
  #302  
Old 09-08-2016, 03:39 PM
blah100 blah100 is offline
 
Join Date: Oct 2014
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone been able to make this work with just the thumbs of the avatars showing (like it does in sideblocks) rather than the fully animated avatars/gifs?
Reply With Quote
  #303  
Old 09-09-2016, 02:11 AM
X-or X-or is offline
 
Join Date: Nov 2005
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blah100 View Post
Has anyone been able to make this work with just the thumbs of the avatars showing (like it does in sideblocks) rather than the fully animated avatars/gifs?
Yes I'd like to suggest this improvement too, a lot of resources saved by using the thumbs instead of full avatar. Hopefully someone can post code change for this because TC will never come back.
Reply With Quote
  #304  
Old 09-09-2016, 04:00 AM
blah100 blah100 is offline
 
Join Date: Oct 2014
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by X-or View Post
Yes I'd like to suggest this improvement too, a lot of resources saved by using the thumbs instead of full avatar. Hopefully someone can post code change for this because TC will never come back.
Resource saving is my goal as well. Almost all of my users use customavatars and of those are mostly gifs. Having just a small thumb rather than the full gif animating would save a lot.
Reply With Quote
  #305  
Old 11-02-2016, 08:55 AM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RaYdeN.ADM View Post
help!

Copy and paste as it explains the guide. I had already cast in another forum and not had this problem.
Hope you did not forgot to chmod 0777 those folders in ftp
Reply With Quote
  #306  
Old 11-02-2016, 09:00 AM
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stratis View Post
Hope you did not forgot to chmod 0777 those folders in ftp
hmm....

Avatars work well in the rest of the forum. Only here the URL fails.
Reply With Quote
  #307  
Old 11-02-2016, 09:31 AM
Stratis's Avatar
Stratis Stratis is offline
 
Join Date: Jan 2010
Posts: 738
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As i see this source code is wrong
Attachment 155452
Code:
http://cimsp.com/posts/http://cimsp.com/attachments/avatars/avatar3_43.gif
It supposed be like this
Code:
http://cimsp.com/attachments/avatars/avatar3_43.gif
From some how maybe inserting code to wrong position. I am not a coder to help more
Reply With Quote
  #308  
Old 11-02-2016, 10:45 AM
RaYdeN.ADM's Avatar
RaYdeN.ADM RaYdeN.ADM is offline
 
Join Date: May 2006
Location: Los Angeles, CA (US)
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stratis View Post
As i see this source code is wrong
Attachment 155452
Code:
http://cimsp.com/posts/http://cimsp.com/attachments/avatars/avatar3_43.gif
It supposed be like this
Code:
http://cimsp.com/attachments/avatars/avatar3_43.gif
From some how maybe inserting code to wrong position. I am not a coder to help more

Of course, that saying I'm right. I do not know how to solve, the code is such that the one in the guide.

thx

ps: i have 4.2.3 Patch Level 2

-----------------------------------------------------------------------------------

Solution for vB 4.2.3 Patch Level 2

Fetch Avatar in Forumbits
PHP Code:
require_once(DIR '/includes/functions_user.php');
if(
is_array($lastpostinfo))
{
    
$forum[real_lastposterid] = $lastpostinfo[lastposterid];
    
$forum[real_lastposter] = $lastpostinfo[lastposter];
}
else
{
    
$forum[real_lastposterid] = $forum[lastposterid];
    
$forum[real_lastposter] = $forum[lastposter];
}
if(
$forum[real_lastposterid])
{
    
$forum[avatarurl] = fetch_avatar_url($forum[real_lastposterid]);
    if (!
$forum[avatarurl]) {
        
$forum[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';
    } else {
        
//$forum[avatarurl] = $vbulletin->options['bburl'] . '/' . $forum[avatarurl][0];
        
$forum[avatarurl] =  $forum[avatarurl][0];
    }
}
else
{
    
$forum[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';

Fetch Avatar in Forumdisplay
PHP Code:
require_once(DIR '/includes/functions_user.php');
if(
$thread[postuserid])
{
    
$thread[avatarurl] = fetch_avatar_url($thread[postuserid]);
    if (!
$thread[avatarurl]) {
        
$thread[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';
    } else {
        
//$thread[avatarurl] = $vbulletin->options['bburl'] . '/' . $thread[avatarurl][0];
        
$thread[avatarurl] = $thread[avatarurl][0];
    }
}
else
{
    
//$thread[avatarurl] = $vbulletin->options['bburl'] . '/' . $thread[avatarurl][0];
    
$thread[avatarurl] = $thread[avatarurl][0];
}
if(
$thread[lastposterid])
{
    
$thread[lastposteravatarurl] = fetch_avatar_url($thread[lastposterid]);
    if (!
$thread[lastposteravatarurl]) {
        
$thread[lastposteravatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';
    } else {
        
//$thread[lastposteravatarurl] = $vbulletin->options['bburl'] . '/' . $thread[lastposteravatarurl][0];
        
$thread[lastposteravatarurl] = $thread[lastposteravatarurl][0];
    }
}
else
{
    
$thread[lastposteravatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';

Fetch Avatar in Search Results Postbits
PHP Code:
require_once(DIR '/includes/functions_user.php');
if(
$post[userid])
{
    
$post[avatarurl] = fetch_avatar_url($post[userid]);
    if (!
$post[avatarurl]) {
        
$post[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';
    } else {
        
//$post[avatarurl] = $vbulletin->options['bburl'] . '/' . $post[avatarurl][0];
        
$post[avatarurl] = $post[avatarurl][0];
    }
}
else {
    
$post[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';

Fetch Avatar in Search Results threadbits

PHP Code:
require_once(DIR '/includes/functions_user.php');
if(
$thread[postuserid])
{
    
$thread[avatarurl] = fetch_avatar_url($thread[postuserid]);
    if (!
$thread[avatarurl]) {
        
$thread[avatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';
    } else {
        
//$thread[avatarurl] = $vbulletin->options['bburl'] . '/' . $thread[avatarurl][0];
        
$thread[avatarurl] = $thread[avatarurl][0];
    }
}
else
{
    
//$thread[avatarurl] = $vbulletin->options['bburl'] . '/' . $thread[avatarurl][0];
    
$thread[avatarurl] = $thread[avatarurl][0];
}
if(
$thread[lastposterid])
{
    
$thread[lastposteravatarurl] = fetch_avatar_url($thread[lastposterid]);
    if (!
$thread[lastposteravatarurl]) {
        
$thread[lastposteravatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';
    } else {
        
//$thread[lastposteravatarurl] = $vbulletin->options['bburl'] . '/' . $thread[lastposteravatarurl][0];
        
$thread[lastposteravatarurl] = $thread[lastposteravatarurl][0];
    }
}
else
{
    
$thread[lastposteravatarurl] = $stylevar['imgdir_misc'] . 'images/misc/unknown.gif';

Reply With Quote
Благодарность от:
BrettC Frontier
  #309  
Old 10-24-2017, 08:57 AM
alessi alessi is offline
 
Join Date: Dec 2013
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice Work! support great 4.2.4
Reply With Quote
  #310  
Old 12-18-2017, 05:31 AM
iamme_meisi iamme_meisi is offline
 
Join Date: Dec 2017
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

absolutely brilliant addition thank you so much for the time/effort
Reply With Quote
  #311  
Old 02-03-2018, 06:45 PM
TheLordACS TheLordACS is offline
 
Join Date: Jan 2018
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HM666 View Post
Works great! Thanks. I did add some css to make the avatars round as mentioned in a previous comment. For those who are unsure of how to do that here is what you will need to do:

On the first HTML code that you need to add to your threadbit template make the following changes to the code:

Code:
<a href="{vb:link member, {vb:raw thread}, null, 'postuserid', 'postusername'}"><img height="32px" width="32px" style="float:left;margin-right:4px;border:1px solid #000000;border-radius:30px" src="{vb:raw thread.avatarurl}" border="0" /></a>
You can certainly change the border color to a color you prefer on any of these.

Code:
border:1px solid #000000;
Change the hex color shown in bold red to a color of your choice. The color I have it set as is black.

forumhome_forumbit_level1_post and forumhome_forumbit_level2_post:

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;border:1px solid #000000;border-radius:30px" src="{vb:raw forum.avatarurl}" border="0" /></a>
search_threadbit:

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;border:1px solid #000000;border-radius:30px" src="{vb:raw thread.avatarurl}" border="0" /></a>
2ND search_threadbit:

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

Code:
<a href="{vb:link member, {vb:raw post}, null, 'userid', 'username'}"><img height="32px" width="32px" style="float:left;margin-left:4px;border:1px solid #000000;border-radius:30px" src="{vb:raw post.avatarurl}" border="0" /></a>
Hope this helps some achieve round avatars
Hello, i added it and work perfectly but in the : forumhome_forumbit_level1_post and forumhome_forumbit_level2_post the round avatars does not work .
Can you help me to fix it? I will realy apreciate it , thank you !

Edit.: I figured it out , it was in additional css a code wich force my forums and forumbits to border-radius 0 . I deleted it and now work perfectly !
Thank you again!
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 05:16 AM.


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.05430 seconds
  • Memory Usage 2,439KB
  • 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
  • (11)bbcode_code
  • (12)bbcode_html
  • (4)bbcode_php
  • (6)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
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (27)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)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