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 . "&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