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
  #112  
Old 08-22-2011, 06:52 AM
shabbirbhimani's Avatar
shabbirbhimani shabbirbhimani is offline
 
Join Date: Nov 2004
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sherif View Post
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.
Yes I will see how can I get that done from my end without depending on what vB team does

Quote:
Originally Posted by Octavius. View Post
That search thingie ain't working so far. I'll investigate later.
Can you share what is not working?
Reply With Quote
  #113  
Old 08-23-2011, 08:43 AM
Maccrob Maccrob is offline
 
Join Date: May 2011
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Agree with Sherif, using fetch_avatar_url to get avatars is a really bad idea. If you have small board, e.g. with 10 simultaneously users online, 40-50 sql queries will be ok, but for larger board it will cause high impact on bd server
Reply With Quote
  #114  
Old 08-25-2011, 10:15 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
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.
I was working on improving the performance of the plugin and when debugging I could not find the ALREADY fetched avatars and can you tell me which variable has that so I can work on using that one instead of fetching it once again.
Reply With Quote
  #115  
Old 08-28-2011, 09:44 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
I was working on improving the performance of the plugin and when debugging I could not find the ALREADY fetched avatars and can you tell me which variable has that so I can work on using that one instead of fetching it once again.
Looking at Andreas's diff file:
PHP Code:
 $thread['lastpost_avatar'] = fetch_avatar_url($thread['lastposterid']);
 
$thread['post_avatar'] = fetch_avatar_url($thread['postuserid']); 
That's from
packages/vbforum/search/result/thread.php
Reply With Quote
  #116  
Old 08-29-2011, 12:43 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
Looking at Andreas's diff file:
PHP Code:
 $thread['lastpost_avatar'] = fetch_avatar_url($thread['lastposterid']);
 
$thread['post_avatar'] = fetch_avatar_url($thread['postuserid']); 
That's from
packages/vbforum/search/result/thread.php
vBulletin 4.1.2 does not have that variable populated for thread lastpost_avatar and post_avatar when I did the vardump. Am I missing something?
Reply With Quote
  #117  
Old 08-29-2011, 01:57 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
vBulletin 4.1.2 does not have that variable populated for thread lastpost_avatar and post_avatar when I did the vardump. Am I missing something?
I don't know...but if you look at my site, http://www.bowlandcentral.com/forum/...hp?do=getdaily, that's a getdaily search and those avatars down the left hand side are populated from the code in the search files that already exists.

Here's the code I use in search_threadbit:
Code:
<img style="vertical-align:top;padding: 3px;background: #ffffff; border: {vb:stylevar light_border}; margin-bottom: 20px;" class="inlineimg rounded2" width="30" height="30" alt="Started by {vb:raw thread.postusername}" src="{vb:raw vboptions.bburl}/<vb:if condition="$thread['post_avatar']">{vb:raw thread.post_avatar.0}" {vb:raw thread.post_avatar.1}<vb:else />images/misc/unknown.gif"</vb:if> /></a>
Reply With Quote
  #118  
Old 08-29-2011, 05:59 PM
giorgino giorgino is offline
 
Join Date: Dec 2009
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Mark.B how you have done tooltips and only avatars like xenforo?
Reply With Quote
  #119  
Old 08-30-2011, 03:40 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
I don't know...but if you look at my site, http://www.bowlandcentral.com/forum/...hp?do=getdaily, that's a getdaily search and those avatars down the left hand side are populated from the code in the search files that already exists.

Here's the code I use in search_threadbit:
Code:
<img style="vertical-align:top;padding: 3px;background: #ffffff; border: {vb:stylevar light_border}; margin-bottom: 20px;" class="inlineimg rounded2" width="30" height="30" alt="Started by {vb:raw thread.postusername}" src="{vb:raw vboptions.bburl}/<vb:if condition="$thread['post_avatar']">{vb:raw thread.post_avatar.0}" {vb:raw thread.post_avatar.1}<vb:else />images/misc/unknown.gif"</vb:if> /></a>
I see that it is vB4.1.3 and I am developing it on vB4.1.2 and so that could be the factor. Will update my dev server and see if it is starting from vB4.1.3.
Reply With Quote
  #120  
Old 08-30-2011, 07:23 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
I see that it is vB4.1.3 and I am developing it on vB4.1.2 and so that could be the factor. Will update my dev server and see if it is starting from vB4.1.3.
I'm pretty sure we had those avatars running like that on 4.0.8 before we jumped to 4.1.3....
Reply With Quote
  #121  
Old 08-31-2011, 09:37 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
I'm pretty sure we had those avatars running like that on 4.0.8 before we jumped to 4.1.3....
When I print_r the thread variable on getdaily on my localhost I get the following

Code:
Array
(
    [threadid] => 7
    [title] => abcd1234
    [prefixid] => 
    [firstpostid] => 13
    [lastpostid] => 24
    [lastpost] => 1314786829
    [forumid] => 2
    [pollid] => 0
    [open] => 1
    [replycount] => 1
    [hiddencount] => 0
    [deletedcount] => 0
    [postusername] => shabbir
    [postuserid] => 1
    [lastposter] => shabbir
    [lastposterid] => 1
    [dateline] => 1314684549
    [views] => 2
    [iconid] => 0
    [notes] => 
    [visible] => 1
    [sticky] => 0
    [votenum] => 0
    [votetotal] => 0
    [attach] => 0
    [similar] => 
    [taglist] => 
    [keywords] => abcd1234abcd1234, abcd1234
    [preview] => abcd1234abcd1234
    [postid] => 7
    [threadtitle] => abcd1234
    [threadiconid] => 0
    [postdateline] => 1314786829
    [issubscribed] => 1
    [threadread] => 
    [highlight] => Array
        (
        )
 
    [checkbox_value] => 0
    [title_editable] => 1
    [openclose_editable] => 1
    [forumtitle] => Main Forum
    [forumtitleclean] => Main Forum
    [prefix_plain_html] => 
    [prefix_rich] => 
    [lastpostdate] => Today
    [lastposttime] => 10:33 AM
    [postdate] => Today
    [posttime] => 10:33 AM
    [startdate] => Yesterday
    [starttime] => 06:09 AM
    [rating] => 0
    [moderatedprefix] => 
    [typeprefix] => 
    [totalposts] => 2
    [pagenav] => 
    [threadiconpath] => 
    [threadicontitle] => 
    [status] => Array
        (
            [dot] => dot
        )
 
    [dot_count] => 2
    [dot_lastpost] => Today
    [realthreadid] => 7
    [statusstring] => dot
)
I am using vB412 and vbCMS and vBBlog are active.
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 12:53 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.07157 seconds
  • Memory Usage 2,393KB
  • 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
  • (4)bbcode_code
  • (12)bbcode_html
  • (2)bbcode_php
  • (9)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
  • (2)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