Solved: 5 Years, 6 Months ago Private Message title in dropdown of header_welcomeblock_member?
#11
Solved: 5 Years, 6 Months ago
Is anyone able to help me add the senders avatar to the pm dropdown list?
Reply
#12
Solved: 5 Years, 6 Months ago
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.).
Reply
#13
Solved: 5 Years, 6 Months ago
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
Reply
#14
Solved: 5 Years, 6 Months ago
http://community.mybb.com/thread-164685-...pid1127976
My Plugins

PM only paid support
Reply
#15
Solved: 5 Years, 6 Months ago
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.
Reply
#16
Solved: 5 Years, 6 Months ago
Anyone able to help with this last thing? Smile
Reply
#17
Solved: 5 Years, 6 Months ago
Still need help with this Smile
Reply
#18
Solved: 5 Years, 6 Months ago
Still need help to display the default avatar if no user avatar is present, currently it just displays a blank space.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)