I just achieved this modification on localhost. It's up to you to limit the size of the avatars.
1. Modify the query. Open up index.php, around line 66, find:
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
Replace with:
SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup, u.avatar
2. Prep the variables. Find:
// Properly format the username and assign the template.
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
$comma = $lang->comma;
Replace with:
// Properly format the username and assign the template.
// $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
// $user['profilelink'] = build_profile_link($user['username'], $user['uid']);
$user['profilepath'] = $mybb->settings['bburl'] . '/' . get_profile_link($user['uid']);
if(!$user['avatar'])
{
$user['avatar'] = $mybb->settings['bburl'] . '/images/default_avatar.gif';
}
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
$comma = $lang->comma;
3. Open up the index_whosonline_memberbit template. Replace it all with this:
{$comma}<a href="{$user['profilepath']}"><img src="{$user['avatar']}" title="{$user['username']}" /></a>{$invisiblemark}
Done.
Users who do not have an avatar get the default_avatar.gif - change this if you want.