Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show full picture instead of thumbnail

  • @peterverkooijen

    Participant

    In the directory this shows the thumbnail of the member:

    `<?php bp_the_site_member_avatar() ?>’

    Is there a way to show the bigger version?

Viewing 7 replies - 1 through 7 (of 7 total)
  • @jeffsayre

    Participant

    <?php echo bp_core_get_avatar( $user, 2) ?>

    Just pass the proper member ID into $user, and you’ll get the large version of the avatar.

    @peterverkooijen

    Participant

    I can’t pass the member ID. It’s for the featured members loop on the directory page, something like this:

    ?php while ( bp_site_members() ) : bp_the_site_member(); ?>

    <a href="<?php bp_the_site_member_link() ?>"><?php bp_the_site_member_avatar() ?></a>
    <h3><a href="<?php bp_the_site_member_link() ?>"><?php bp_the_site_member_name() ?></a></h3>

    <?php do_action( 'bp_core_directory_members_content' ) ?>

    <?php endwhile; ?>

    The function is in bp-core-templatetags.php:

    function bp_the_site_member_avatar() {
    echo apply_filters( 'bp_the_site_member_avatar', bp_get_the_site_member_avatar() );
    }
    function bp_get_the_site_member_avatar() {
    global $site_members_template;

    return apply_filters( 'bp_get_the_site_member_avatar', $site_members_template->member->avatar_thumb );
    }

    Would it be possible to write a variation on this function to get the big version? Replace ‘avatar_thumb’ with ‘avatar’?

    Trying that now…

    YES, replacing ‘avatar_thumb’ with ‘avatar’ does produce the bigger versions. So here’s an alternative function that works, put in bp-custom.php:

    function bp_the_site_member_photo() {
    echo apply_filters( 'bp_the_site_member_photo', bp_get_the_site_member_photo() );
    }
    function bp_get_the_site_member_photo() {
    global $site_members_template;

    return apply_filters( 'bp_get_the_site_member_photo', $site_members_template->member->avatar );
    }

    Or is there already a similar function somewhere in BP?

    @jeffsayre

    Participant

    Okay, I missed the fact that you were working within a template. It thought you were looking to create a widget.

    Instead of creating a function within bp-custom.php, you can place this is your template file. I assume that you have made a copy of the default themes and are modifying your copy, not the original.

    Change this one line:

    <a href="<?php bp_the_site_member_link() ?>"><?php bp_the_site_member_avatar() ?></a>

    To this:

    <a href="<?php bp_the_site_member_link() ?>"><?php echo bp_core_get_avatar( bp_get_the_site_member_user_id(), 2 ) ?></a>

    @jeffsayre

    Participant

    Peter-

    I assume you’ve either used your above solution or my solution just below yours. Either way, if this issue is resolved, please set the light to green on top!

    @peterverkooijen

    Participant

    Thanks Jeff Sayre. Went with your solution of course. Less intrusive – my custom code hack already created this problem.

    I assume for the group and blog pictures it will be something similar…?

    @jeffsayre

    Participant

    I assume for the group and blog pictures it will be something similar…?

    Whereas I have not tried it, I would also assume it would work there as well.

    @peterverkooijen

    Participant

    Group photo was simple guess. Change this:

    <?php bp_the_site_group_avatar_thumb() ?>

    to this:

    <?php bp_the_site_group_avatar() ?>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Show full picture instead of thumbnail’ is closed to new replies.
Skip to toolbar