Clear all

wpForo 1.x.x [Closed] Online Members Widget

5 Posts
4 Users
Posts: 237
Topic starter
Reputable Member
Joined: 8 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
Posts: 10503
Support Team
Joined: 8 years ago

I see it looks as designed:

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;}
Posts: 237
Topic starter
Reputable Member
Joined: 8 years ago

Yes, that worked!

Posts: 1
New Member
Joined: 5 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 ?


Posts: 111
Estimable Member
Joined: 7 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">';
echo '<ul>
<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']).'"'); ?>
<?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; ?>
echo '<div class="wpf-clear"></div>
// nando4>> bug in widget - move div that was here below
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//