Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Active users widget -> show only users with own Avatar


kino.tv
Member

@minniwelt

YESSSSSSSS! Thanks!

Step 1):

bp-core-widgets.php:

====================================

function widget($args, $instance) {

global $bp;

extract( $args );

echo $before_widget;

echo $before_title

. $widget_name

. $after_title; ?>

<?php if ( bp_has_members( ‘type=active&per_page=’ . $instance[‘max_members’] . ‘&max=’ . $instance[‘max_members’] . ‘&populate_extras=0’ ) ) : ?>

<div class=”avatar-block”>

<?php while ( bp_members() ) : bp_the_member(); ?>

<!– agunda kill leerbilder start //–>

<?php

ob_start();

bp_member_avatar();

$avatar = ob_get_contents();

ob_end_clean();

if (strpos($avatar,’/uploads/avatars/’))

{

?>

<div class=”item-avatar”>

“><?php bp_member_avatar() ?>

</div>

<?php

}

?>

<!– agunda kill leerbilder ende //–>

<?php endwhile; ?>

</div>

<?php else: ?>

<div class=”widget-error”>

<?php _e( ‘There are no recently active members’, ‘buddypress’ ) ?>

</div>

<?php endif; ?>

<?php echo $after_widget; ?>

<?php

}

=============================================

Step 2:

Set Widget “active members” to 10, 50, 1000

Thanks!!

Skip to toolbar