vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Private Messages Enhancements - Sender Avatar In Private Message List (https://vborg.vbsupport.ru/showthread.php?t=127414)

.Tim 09-24-2006 09:04 PM

How did you do that?

Selene 09-25-2006 12:53 AM

yes lionel how did u do that can u please tell us what to modify

Lionel 09-25-2006 01:02 AM

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

Shazz 09-25-2006 01:03 AM

Thats just for file system? Mmmm..
Anyway *clicks install

.Tim 09-25-2006 01:15 AM

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.

nevetS 09-25-2006 07:03 AM

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.

Paul M 09-25-2006 08:01 AM

You may need to add a require ;

PHP Code:

require_once(DIR '/includes/functions_user.php');
$avatarurl fetch_avatar_url($userid); 


Selene 09-25-2006 08:50 AM

thanks problem solved

Selene 09-25-2006 08:56 AM

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:

http://img174.imageshack.us/img174/9894/pmvj1.gif

Lionel 09-25-2006 09:14 AM

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 :-)


All times are GMT. The time now is 02:17 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01504 seconds
  • Memory Usage 1,775KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete