Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show full picture instead of thumbnail

  • Avatar of Peterverkooijen
    peterverkooijen
    Participant

    @peterverkooijen

    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)
  • Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    <?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.

    Avatar of Peterverkooijen
    peterverkooijen
    Participant

    @peterverkooijen

    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?

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    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>

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    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!

    Avatar of Peterverkooijen
    peterverkooijen
    Participant

    @peterverkooijen

    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…?

    Avatar of Jeff Sayre
    Jeff Sayre
    Participant

    @jeffsayre

    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.

    Avatar of Peterverkooijen
    peterverkooijen
    Participant

    @peterverkooijen

    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.