Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Sender Avatar In Private Message List Details »»
Sender Avatar In Private Message List
Version: 1.00, by .Tim .Tim is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Category: Private Messages Enhancements - Version: 3.6.4 Rating:
Released: 09-23-2006 Last Update: 09-24-2006 Installs: 87
Uses Plugins Template Edits
 
No support by the author.

I've seen a few requests for it and wanted it myself, I spent a lot of time on it and then realized I wasted a lot of time and it was actually quite simple. Now this works whether you store your avatars in the filesystem or database.

Upload the plugin. Then:

In your pm_messagelistbit template find:

Code:
<if condition="$show['pmicons']"><td class="alt2"><if condition="$show['pmicon']"><img src="$pm[iconpath]" alt="$pm[icontitle]" /><else />&nbsp;</if></td></if>
And replace it with:

Code:
<if condition="THIS_SCRIPT!='usercp'"> <if condition="$sk_avurl"><td class="alt2" width="80"><img src="$sk_avurl[0]" width="60" /></td><else /><td class="alt2" width="60"><img src="images/misc/noavatar.gif" width="60" border="0" /></if></td></if> </if>

You'll be replacing the post icon that shows up between the status icon and the message itself.

If your board allows users to not have an avatar and you're getting red x's on some, do this:
https://vborg.vbsupport.ru/showpost....1&postcount=26

Credit to:
TruthElixirX, Tralala, nevetS and Lionel
For their help. Thanks.

PS This hack is compatible with 3.7

Show Your Support

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

Comments
  #12  
Old 09-24-2006, 09:04 PM
.Tim's Avatar
.Tim .Tim is offline
 
Join Date: Jan 2005
Location: Oklahoma City
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How did you do that?
Reply With Quote
  #13  
Old 09-25-2006, 12:53 AM
Selene Selene is offline
 
Join Date: Feb 2005
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes lionel how did u do that can u please tell us what to modify
Reply With Quote
  #14  
Old 09-25-2006, 01:02 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I created a plugin

hook location: private_messagelist_messagebit

I named it: Avatar in PM

plugin content

PHP Code:
if ($vbulletin->userinfo['avatarid']) 

$avatar $db->query_first("SELECT user.avatarid,avatar.avatarpath as avatarpath
 FROM " 
TABLE_PREFIX "user 
LEFT JOIN " 
TABLE_PREFIX "avatar as avatar on (user.avatarid=avatar.avatarid)
WHERE userid = '
$userid'"); 
  if (
$avatar[avatarpath ]!=''){
    
$pmavatar "<img width=\"30\" height=\"30\" src=\"" $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"avatar\" border=\"0\" />";
}else 

    if (
$avatar $db->query_first("SELECT dateline, userid FROM " TABLE_PREFIX "customavatar WHERE userid = '$userid'")) 
    { 
       
        
$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" $vbulletin->userinfo[avatarrevision] . ".gif" "" $vbulletin->options[bburl] . "/image.php?u=" $userid "&amp;dateline=" $avatar['dateline'] . ""
        
$pmavatar "<img width=\"30\" height=\"30\" src=\"$navbaravatarurl\" alt=\"avatar\" border=\"0\" />"
    } 
    else 
    { 
        
       
$pmavatar "<img width=\"30\" height=\"30\" src=\"$stylevar[imgdir_misc]/noavatar.gif\" alt=\"avatar\" border=\"0\" />";  
    } 
}

and I put $pmavatar in template at the location indicated in this hack
Reply With Quote
  #15  
Old 09-25-2006, 01:03 AM
Shazz's Avatar
Shazz Shazz is offline
 
Join Date: Jun 2006
Location: Utah
Posts: 4,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats just for file system? Mmmm..
Anyway *clicks install
Reply With Quote
  #16  
Old 09-25-2006, 01:15 AM
.Tim's Avatar
.Tim .Tim is offline
 
Join Date: Jan 2005
Location: Oklahoma City
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lionel
I created a plugin

hook location: private_messagelist_messagebit

I named it: Avatar in PM

plugin content

PHP Code:
if ($vbulletin->userinfo['avatarid']) 

$avatar $db->query_first("SELECT user.avatarid,avatar.avatarpath as avatarpath
 FROM " 
TABLE_PREFIX "user 
LEFT JOIN " 
TABLE_PREFIX "avatar as avatar on (user.avatarid=avatar.avatarid)
WHERE userid = '
$userid'"); 
  if (
$avatar[avatarpath ]!=''){
    
$pmavatar "<img width=\"30\" height=\"30\" src=\"" $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"avatar\" border=\"0\" />";
}else 

    if (
$avatar $db->query_first("SELECT dateline, userid FROM " TABLE_PREFIX "customavatar WHERE userid = '$userid'")) 
    { 
       
        
$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" $vbulletin->userinfo[avatarrevision] . ".gif" "" $vbulletin->options[bburl] . "/image.php?u=" $userid "&amp;dateline=" $avatar['dateline'] . ""
        
$pmavatar "<img width=\"30\" height=\"30\" src=\"$navbaravatarurl\" alt=\"avatar\" border=\"0\" />"
    } 
    else 
    { 
        
       
$pmavatar "<img width=\"30\" height=\"30\" src=\"$stylevar[imgdir_misc]/noavatar.gif\" alt=\"avatar\" border=\"0\" />";  
    } 
}

and I put $pmavatar in template at the location indicated in this hack
Weird, that didn't work for me on my test board. Oh well, I'm working on a universal way that works with either method.
Reply With Quote
  #17  
Old 09-25-2006, 07:03 AM
nevetS nevetS is offline
 
Join Date: May 2005
Location: Sunny California
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I created a much simpler plugin... Wow Lionel!

PHP Code:
$sk_avurl fetch_avatar_url($userid); 
and then in the template:

PHP Code:
<img src="$sk_avurl[0]/> 
plugin gets attached to private_messagelist_messagebit.

A quick hack, but it seems to work for me.
Reply With Quote
  #18  
Old 09-25-2006, 08:01 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may need to add a require ;

PHP Code:
require_once(DIR '/includes/functions_user.php');
$avatarurl fetch_avatar_url($userid); 
Reply With Quote
  #19  
Old 09-25-2006, 08:50 AM
Selene Selene is offline
 
Join Date: Feb 2005
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks problem solved
Reply With Quote
  #20  
Old 09-25-2006, 08:56 AM
Selene Selene is offline
 
Join Date: Feb 2005
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nevetS
I created a much simpler plugin... Wow Lionel!

PHP Code:
$sk_avurl fetch_avatar_url($userid); 
and then in the template:

PHP Code:
<img src="$sk_avurl[0]/> 
plugin gets attached to private_messagelist_messagebit.

A quick hack, but it seems to work for me.

cool that works, but just one problem. Those who dont have an avator, they get that no image pic with cross which looks ugly. Any way to get rid of that? so that members without avator are left out with no avator in the pm display.

here is what i mean:

Reply With Quote
  #21  
Old 09-25-2006, 09:14 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
You may need to add a require ;

PHP Code:
require_once(DIR '/includes/functions_user.php');
$avatarurl fetch_avatar_url($userid); 
definitely more elegant than mine :-)
Reply With Quote
Reply


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 09:37 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.06797 seconds
  • Memory Usage 2,343KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_code
  • (8)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete