Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

How to Override the BuddyPress Avatar Override (14 posts)

Started 1 year, 9 months ago by: Craig S. Kiessling

  • Profile picture of Craig S. Kiessling Craig S. Kiessling said 1 year, 9 months ago:

    BuddyPress attempts to (and does a good job of doing so) override the avatars set up by users in extended users plug-ins, or avatars uploaded to their profiles – to provide the users Gravatars instead.

    Is there anyway to override this, so that we can just keep the ones that users uploaded already?

  • Profile picture of Craig S. Kiessling Craig S. Kiessling said 1 year, 9 months ago:

    Anyone?

  • Profile picture of Craig S. Kiessling Craig S. Kiessling said 1 year, 9 months ago:

    If this is a stupid question, and the answer is hidden in a FAQ or previous topic, etc., please let me know – as I have searched and can not find anything relating to this topic….

  • Profile picture of Seobrien Seobrien said 1 year, 9 months ago:

    Side conversation – it is possible to replace the default avatars with something custom? Not Gravatar but our own folder of images from which to randomly apply avatars?

  • Profile picture of Craig S. Kiessling Craig S. Kiessling said 1 year, 9 months ago:

    That’s what I am try to ask actually Brian. It looks like we’re not going to get an answer. :(

  • Profile picture of Paul Gibbs Paul Gibbs said 1 year, 9 months ago:

    “Is there anyway to override this, so that we can just keep the ones that users uploaded already?”

    Uploaded to *where*? What plugin?

  • Profile picture of r-a-y r-a-y said 1 year, 9 months ago:

    seobrien –
    Read this: http://wpmu.org/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/

    iamnorthwind –
    If you’re using another plugin to upload avatars, you’ll need to override the way BuddyPress fetches avatars.

    Specifically, you’ll need to override the “bp_core_fetch_avatar” filter located in /buddypress/bp-core-avatars.php file.

    Need a primer on filters? Read this:

    http://codex.wordpress.org/Plugin_API#Filters

  • Profile picture of Craig S. Kiessling Craig S. Kiessling said 1 year, 8 months ago:

    @R-a-y:
    Many thanks! I will give it a go (noticed you’re credited in the first article you mentioned ;) nicely done :) and let ya know.

  • Profile picture of Craig S. Kiessling Craig S. Kiessling said 1 year, 8 months ago:

    @R-a-y:
    Works like a charm. Thanks again!
    I take it that gwu123 individual did indeed move his post cuz I don’t see what you’re referring to :P

  • Profile picture of enderandrew enderandrew said 1 year, 1 month ago:

    What if I want to do more than just replace the one default avatar?

    What if I want to provide a gallery of avatars users can choose from (by uploading a bunch of avatars to a folder)?

    Ideally I’d like to allow users to select from the avatars I’ve uploaded, as well as allow them to upload one of their own.

  • Profile picture of enderandrew enderandrew said 1 year, 1 month ago:

    I want to keep my site’s theme consistent. I’m making a site for a Star Wars: The Old Republic guild. I’ve got 156 avatars. Ideally, I’d like users to be able to choose from these avatars in addition to uploading one of their own. But let’s start with something even easier. If they don’t have a custom avatar, instead of default to Mystery Man, I’d like to default to one randomly chosen from the 156. Could I just do something like this:

    $tmp = glob('avatars/*.gif');
    if (is_array($tmp))
    {
        $flist = array_merge($flist,$tmp);
    }
    $default_avatar = $flist[array_rand($flist)];
    add_filter( 'bp_core_mysteryman_src', $default_avatar );

    My fear in trying this out, is that every time it displayed any default avatar if would pick one at random. What I’d like is to do the randomization once in assigning an avatar to a user if they don’t have one.

  • Profile picture of enderandrew enderandrew said 1 year ago:

    Bump for great justice!

    Is there any way to provide a gallery of avatars to choose from, or to randomly pick from the pre-provided avatars for people who don’t upload their own?

  • Profile picture of sidjags sidjags said 11 months, 1 week ago:

    i too have been searchin for this since some time now… why is this so hard… cannot believe this has not been addressed by anyone thus far.

  • Profile picture of sidjags sidjags said 11 months, 1 week ago:

    @enderandrew…. hey guys.. i think i found something that should work. If you want a custom set of pics to replace the default buddypress avatars and be assigned by random to members… here goes:

    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/custom-set-of-avatar-pics/#post-101775