I was playing with memberlist and couldn't find avatar setting for it. So I added avatar to my memberlist controller and subs.
Memberlist.subs.php
$context['members'][$member]['real_name'] = $context['members'][$member]['link'];
$context['members'][$member]['avatar'] = '<a href="' . $context['members'][$member]['href'] . '" target="_blank" class="new_win">' . $context['members'][$member]['avatar']['image'] . '</a>';
Memberlist.controller.php
'avatar' => array(
'label' => '',
'class' => '',
),
'real_name' => array(
'label' => $txt['username'],
'class' => 'username',
'sort' => array(
'down' => 'mem.real_name DESC',
'up' => 'mem.real_name ASC'
),
),
'online' => array(
'label' => $txt['status'],
'class' => 'status',
'sort' => array(
'down' => allowedTo('moderate_forum') ? 'IFNULL(lo.log_time, 1) ASC, real_name ASC' : 'CASE WHEN mem.show_online THEN IFNULL(lo.log_time, 1) ELSE 1 END ASC, real_name ASC',
'up' => allowedTo('moderate_forum') ? 'IFNULL(lo.log_time, 1) DESC, real_name DESC' : 'CASE WHEN mem.show_online THEN IFNULL(lo.log_time, 1) ELSE 1 END DESC, real_name DESC'
),
),
index.css
#memberlist .status {
width: 20px;
}
#memberlist .avatar.avatarresize {
width: 2.4em;
heigth: 2.4em;
margin: -4px -1.5em -8px 0;
}
The logic of moving the status is that it is too hidden to the left. I am not sure how to add option to display avatar yet but, so far, it is already looking good with the avatar on both normal and mobile browser.
I got error for not putting the label and the class, so I added them in. OP is updated.
Not a bad idea have the avatar there! :D
Great idea ... ;D Maybe we should add to 1.03 ?
That would be great. If you want, I can PR that later. But don't you think it is better to have admin setting to enable / disable avatar for memberlist? Some admin might want it plain and simple right? ::)
Should be one-liner in custom.css, do we really need a setting for that?
#memberlist .avatar {display: none}
Please do make the PR :) and +1 to what TE said, its easy to turn off with just CSS, so lets do that and try and resist the urge to add additional ACP options.
Either way is fine with me. I personally don't mind. ;) I will send the PR soon.
PR is sent.