Skip to:
Content
Pages
Categories
Search
Top
Bottom

Any way to change generated avatars from Gravatar to a locally hosted pool of avatars?

  • @javiermatosdes

    Member

    Hello, just got Buddypress up and running a few days ago and am having a great time exploring the funcitonality.

    A question I have is, when users sign up if they don’t upload an image for their avatar they are assigned a generated avatar from gravatar. I would like to bypass that and have their avatar generated from ~20 avatar files hosted on my domain, so the default avatars will be different but will have commonality with the rest of the theme and subject for the site. I.E. i have a sports site and I would like the default avatars to come from sports related photos, which I have saved.

    Is this possible? I’ve seen a few threads about changing the default avatar to one specific image but nothing about a random image from a pool of images.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @r-a-y

    Keymaster

    Anything is possible; it just requires coding ;)

    If you’re familiar with PHP and a bit of WordPress code, analyze /bp-core/bp-core-avatars.php for pointers.

    @javiermatosdes

    Member

    Of course :) thanks for the direction though, I think I have an idea of what to do. Will post my results.

    @javiermatosdes

    Member

    I think I need to correct myself in my first post, it seems that I was mistakenly calling wavatars gravatars. Oops! Wavatars are the randomly generated ones, right?

    I had a revelation after realizing this though. I don’t want to stop people from getting their Gravatar if they have one, I just want to replace the Wavatars with my own images. So Im thinking I’m going to set the Default User Avatar to “Mystery Man”, then in the following line in /bp-core/bp-core-avatars.php

    ` if ( !defined( ‘BP_AVATAR_DEFAULT’ ) )
    define( ‘BP_AVATAR_DEFAULT’, BP_PLUGIN_URL . ‘/bp-core/images/mystery-man.jpg’ );

    if ( !defined( ‘BP_AVATAR_DEFAULT_THUMB’ ) )
    define( ‘BP_AVATAR_DEFAULT_THUMB’, BP_PLUGIN_URL . ‘/bp-core/images/mystery-man-50.jpg’ );
    }`

    I was going to change images/mystery-man.jpg into `images/.jpg` and upload my 14 avatars (with filenames 1 through 14) into that images folder.

    My issue is, if i was to do that, I’d somehow need to get the same image in the ‘-50’ version in the line below. And it also appears in bp-core-admin.php and bp-core-templatetags.php so I’m not sure what I’d do with them there. I was hoping this would be an easier solution. Any ideas?

    @javiermatosdes

    Member

    Well I’m at a dead end here, would anyone like to give me another nudge in the right direction?

    @knaveenchand

    Participant

    @javiermatosdes were you able to find a solution to this? Generating random gravatar for buddypress default profiles makes a lot of sense. Unfortunately, I am unable to bring that change in the buddypress default theme. Could you please help me with some advice on this?

    @mercime

    Participant

    Generate random gravatar? or random avatars via Settings > Discussions > AvatarĀ  and choose from Identicon, Wavatar, MonsterID, or Retro ?

    Or check out https://wordpress.org/extend/plugins/bp-avatar-suggestions/

    @knaveenchand

    Participant

    @mercime Thanks for your reply. I actually meant random avatar for the “members” of my buddypress site (not for those who leave comments!)

    The option in Discussion Settings that you mentioned in your post is for posting comments. Ain’t they? Or please correct me if I am wrong.

    My idea is to create different random ‘default’ avatars to new members who sign-up. Some members of our site do not change their avatars and because of that we have several mystery ‘men’ getting populated in Members Directory, Group Directory and widgets or wherever we are showing off members’ avatars. The site looks so odd with so many mystery’men’ avatars.

    I hope you understood the problem. Do you still recommend me to try your ideas or the plugin? Thanks for your help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Any way to change generated avatars from Gravatar to a locally hosted pool of avatars?’ is closed to new replies.
Skip to toolbar