Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to Override the BuddyPress Avatar Override


  • Craig S. Kiessling
    Participant

    @iamnorthwind

    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?

Viewing 13 replies - 1 through 13 (of 13 total)

  • Craig S. Kiessling
    Participant

    @iamnorthwind

    Anyone?


    Craig S. Kiessling
    Participant

    @iamnorthwind

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


    Seobrien
    Participant

    @seobrien

    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?


    Craig S. Kiessling
    Participant

    @iamnorthwind

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

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

    Uploaded to *where*? What plugin?


    r-a-y
    Keymaster

    @r-a-y

    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:
    https://codex.wordpress.org/Plugin_API#Filters


    Craig S. Kiessling
    Participant

    @iamnorthwind

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


    Craig S. Kiessling
    Participant

    @iamnorthwind

    @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


    enderandrew
    Member

    @enderandrew

    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.


    enderandrew
    Member

    @enderandrew

    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.


    enderandrew
    Member

    @enderandrew

    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?

    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.

    @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:

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

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘How to Override the BuddyPress Avatar Override’ is closed to new replies.
Skip to toolbar