Nov 02, 2017 8:38 pm
Online Members Widget shows avatars with a square boarder around them. This isn't how the avatars show in the other widgets. Can this be corrected? I've using a white theme and the black square boarder stands out.
4 Replies
Nov 02, 2017 8:56 pm
I see it looks as designed:
https://wpforo.com/docs/root/getting-started/forum-sidebar-and-widgets/wpforo-widgets/
In any case if you want to remove the grey square boarder just please use this CSS code:
#wpf-widget-online-users .wpforo-widget-content a.onlineavatar {border: none!important;}
Nov 02, 2017 8:59 pm
Yes, that worked!
Jul 17, 2019 7:55 am
Hi, i have a problem
Even if i set with no selections the read only option on usergroups and on forum access the widget show the member online of my private forum. There is a bug ?
Thanks
Jul 21, 2019 6:27 pm
Widget code has bug - there is a misplaced DIV when there are no online members:
public function widget( $args, $instance ) {
echo $args['before_widget']; //This is a HTML content//
echo '<div id="wpf-widget-online-users" class="wpforo-widget-wrap">';
if ( ! empty( $instance['title'] ) ) {
echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ). $args['after_title'];
}
$groupids = ( !empty($instance['groupids']) ? array_filter( wpforo_parse_args( json_decode($instance['groupids'], true) ) ) : WPF()->usergroup->get_visible_usergroup_ids() );
// widget content from front end
$online_members = WPF()->member->get_online_members($instance['count'], $groupids);
echo '<div class="wpforo-widget-content">';
if(!empty($online_members)){
echo '<ul>
<li>
<div class="wpforo-list-item">';
foreach( $online_members as $member ){
if( $instance['display_avatar'] ): ?>
<a href="<?php echo esc_url(WPF()->member->get_profile_url( $member['ID'] )) ?>" class="onlineavatar">
<?php echo WPF()->member->get_avatar( $member['ID'], 'style="width:95%;" class="avatar" title="'.esc_attr($member['display_name']).'"'); ?>
</a>
<?php else: ?>
<a href="<?php echo esc_url(WPF()->member->get_profile_url( $member['ID'] )) ?>" class="onlineuser"><?php echo esc_html($member['display_name']) ?></a>
<?php endif; ?>
<?php
}
echo '<div class="wpf-clear"></div>
</div>
</li>
</ul>';
// nando4>> bug in widget - move div that was here below
}
else{
echo '<p class="wpf-widget-note"> '.wpforo_phrase('No online members at the moment', false).'</p>';
}
echo '</div>';
echo '</div>';
echo $args['after_widget'];//This is a HTML content//
}