Notifications
Clear all

wpForo 1.x.x Online Members Widget

5 Posts
4 Users
0 Likes
2,331 Views
SamHunter
Posts: 230
Topic starter
(@samhunter)
Estimable Member
Joined: 6 years ago

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
Robert
Posts: 9966
Admin
(@robert)
Support Team
Joined: 7 years ago

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;}
Reply
SamHunter
Posts: 230
Topic starter
(@samhunter)
Estimable Member
Joined: 6 years ago

Yes, that worked!

Reply
stefano
Posts: 1
(@stefano)
New Member
Joined: 4 years ago

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

Reply
nando4
Posts: 111
(@nando4)
Estimable Member
Joined: 6 years ago

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">&nbsp;'.wpforo_phrase('No online members at the moment', false).'</p>';
}
echo '</div>';
echo '</div>';
echo $args['after_widget'];//This is a HTML content//
}
Reply