MyBB Community Forums

Full Version: Custom userfield in misc_buddypopup_user_online
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi There!,

Im trying to get a users custom field (in this case ['fid5']) into the misc_buddypopup_user_online template,
I've been browsing trough misc.php to find any related {$buddy} code but I'm unable to find any,

Also tried porting some stuff from member.php to get this working but I've only got to manage the result to be {$customfielval}  so my guessing is that some php script is not running to postback the contents of {$customfielval} for the specified user.


So my question in general is:
How can I manage to get a custom profile field in the "misc_buddypopup_user_online" template
and please don't tell me to use a plugin, I REALLY prefer to do core edits instead.

Thank you in advance!
Find
		$query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array('order_by' => 'lastactive'));

Replace:
$query = $db->query("SELECT u.*, uf.* FROM " . TABLE_PREFIX . "users u
LEFT JOIN " . TABLE_PREFIX . "userfields uf ON(u.uid=uf.ufid)
WHERE u.uid IN(" . $mybb->user['buddylist'] . ")
ORDER BY u.lastactive DESC");
Thank you very much!

This did the trick for me!
thank you so much