Skip to:
Content
Pages
Categories
Search
Top
Bottom

Active users widget -> show only users with own Avatar


  • kino.tv
    Member

    @minniwelt

    9 of 10 users have default (mystery-man.jpg) Avatar-Picture so i will only show aktive Users which have own one.

    Someone can help me please?

    Thank You!

    Chriss

Viewing 2 replies - 1 through 2 (of 2 total)
  • The Widget renders from bp-core-widgets.php (look for BP_Core_Recently_Active_Widget).

    It calls bp_member_avatar that renders out the avatars using the filter bp_get_member_avatar (see bp-core-templatetags.php).

    I assume that it would be possible to alter the filter accordingly so that it only shows files other than the mysterman.

    of course you would probably have to think about how to keep the amount of members the same since cutting 9 out of 10 off the filter and have the widget show 15 users it would end up showing only 1 user .


    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!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Active users widget -> show only users with own Avatar’ is closed to new replies.
Skip to toolbar