Skip to:
Content
Pages
Categories
Search
Top
Bottom

group default avatar

  • Avatar of jimcale
    MJ
    Participant

    @jimcale

    hello everyone.

    I understand the default avatar for groups is generated from Gravatar. is there anyway i can define my own default avatar for groups.

    thanks a lot in advance.

Viewing 7 replies - 26 through 32 (of 32 total)
  • Avatar of gwu123
    gwu123
    Participant

    @gwu123

    Here is my code. However, the small group avatar in forum topic directory does not change. This avatar is displayed using bp_the_topic_object_avatar() from bp-forums-templates.php

    function my_default_get_group_avatar($avatar) {
    global $bp, $groups_template;

    if( strpos($avatar,’group-avatars’) ) {
    return $avatar;
    }
    else {
    $custom_avatar = get_stylesheet_directory_uri() .’/_inc/images/group_avatar.png';
    if($bp->current_action == “” || $bp->current_action == “my-groups” || $bp->current_action == “invites” )
    return ‘group->name ) . ‘” />';
    else
    return ‘group->name ) . ‘” />';
    }
    }
    add_filter( ‘bp_get_group_avatar’, ‘my_default_get_group_avatar’);

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Avatar of gwu123
    gwu123
    Participant

    @gwu123

    thnks Ray

    Avatar of gwu123
    gwu123
    Participant

    @gwu123

    @r-a-y. I want to have a fixed size for group/user avatars in the sidebar. Is there a way to detect and fix the size of avatars in sidebar?
    Thanks.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Sorry for replying late to this thread. I missed this one.
    I’ll look into this when I have the time.

    Avatar of gwu123
    gwu123
    Participant

    @gwu123

    hi @r-a-y

    I am using your code given at : Click Here

    I am using this plugin:http://buddypress.org/community/groups/jet-group-could/

    When I browse user profile -> my groups, the group avatars in the sidebar become thumbails even though I have set 25X25 size in this plugin. Is there a way to fix the size if avatars displayed in the sidebar? I want any avatar showed in sidebar to be 25X25

    thanks.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Since you’re using the filter I posted, I would manually setup a group loop. Then in this loop, I would use the bp_core_fetch_avatar() function with the “html” parameter set to false (view the full function and parameter list in /bp-core/bp-core-avatars.php).

    Doing this will return the URL of the avatar, then you can manually define the width and height in an IMG tag.

Viewing 7 replies - 26 through 32 (of 32 total)

You must be logged in to reply to this topic.