MyBB Community Forums

Full Version: Private Message title in dropdown of header_welcomeblock_member?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is anyone able to help me add the senders avatar to the pm dropdown list?
Sorry, very bad period.


It should works:

[Image: pEqQYlY.png]



in global.php edit in:

$query = $db->query("
        SELECT pm.subject, pm.pmid, pm.status, pm.dateline, fu.username AS fromusername, fu.uid AS fromuid, fu.avatar AS useravatar
        FROM ".TABLE_PREFIX."privatemessages pm
        LEFT JOIN ".TABLE_PREFIX."users fu on (fu.uid=pm.fromid)
        WHERE pm.folder = '1' AND pm.uid = '{$mybb->user['uid']}'
        ORDER BY pm.dateline DESC
        LIMIT 5
    ");
    $private_dropdown_dateline = my_date($mybb->settings['dateformat'], $private_dropdown['dateline']);
        
    while($private_dropdown = $db->fetch_array($query))
    {
	$private_dropdown['avatar'] = $private_dropdown['useravatar'];
        $private_dropdown_link = htmlspecialchars_uni($private_dropdown['pmid']);
        $private_dropdown_status = htmlspecialchars_uni($private_dropdown['status']);
        $private_dropdown_subject = htmlspecialchars_uni($private_dropdown['subject']);
        $private_dropdown_fromuser = htmlspecialchars_uni($private_dropdown['fromusername']);
        $private_dropdown_dateline = my_date($mybb->settings['dateformat'], $private_dropdown['dateline']);
            
    eval("\$private_dropdown_template_template .= \"".$templates->get("private_dropdown_template_template")."\";");
    }
eval("\$private_dropdown_template = \"".$templates->get("private_dropdown_template")."\";"); 


I have added only fu.avatar AS useravatar and $private_dropdown['avatar'] = $private_dropdown['useravatar'];



and in private_dropdown_template_template add:


<img src="{$private_dropdown['avatar']}" alt="" />


where you want add avatar. Obviously you will have to change the style of the avatar (size, position, etc.).
Hi

Thank you very much for your help with that, that has worked for me great.

One more thing though, could it be set up so that if the user doesn't have an avatar it uses the default avatar?

Thanks,
Kyle
I don't want to use a different method now, I just want the default avatar to display if the member doesn't have an avatar.
Anyone able to help with this last thing? Smile
Still need help with this Smile
Still need help to display the default avatar if no user avatar is present, currently it just displays a blank space.
Pages: 1 2