Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 66 total)

  • lookingahead
    Participant

    @lookingahead

    OMG…THE LINK DID NOT POST LOOOOOL…..

    Because I’m like a ‘spammer’ or something right? Hahaa…

    DEAR GOD.

    MAN I HOPE THIS ONE WORKS LOOOOOL:

    https://buddydev.com/using-different-default-avatar-buddypress-users-based-profile-fields-member-type/


    lookingahead
    Participant

    @lookingahead

    Screw it. I tried to post the code in various ways, but I don’t have time to spend trying to post A SIMPLE COMMENT FFS.

    Go to this link and use the code specified in the file.

    I hope it’s still available years later when someone stumbles across this comment thread.

    BuddyPress forums need some sort of fix for this crap. What an incredible waste of time and energy, just to post a helpful comment that contained code. I’m not a freaking spammer. I mean, if your forum software is needing to be THAT sensitive to fight spam, make us do captchas or some crap to verify we’re ‘human.’

    Ya know, I get why spam filters exist, but when they make a site UNUSABLE FOR ACTUAL USERS then your technology is worthless.

    Anyhow…lol, end of rant. Here is the link:

    I hope this solution helps others as much as it’s helped me. <3


    lookingahead
    Participant

    @lookingahead

    OH FFS, BuddyPress keeps telling me I ‘move too fast’…then I go to post the response and it says I’ve ‘already said that’…DEAR GOD, lol…..

    That means I have to wait, idk, HOW LONG to post again?

    And why is it that even when I’m not ‘moving too fast’ that BuddyPress HATES me posting a solution that contains code — even when I format it correctly?

    Dear God.


    lookingahead
    Participant

    @lookingahead

    OH guess what…? 😀 Figured it out.

    I have a solution that so, sooo…..SSOOOOOOO many other people have been looking for, and I’m elated to say I’ve found it.

    Been cruising Stack Exchange, various WordPress plugin support threads, installing plugin after plugin, reading blogposts made by developers, comments made by disillusioned masses….I mean, it’s endless.

    But THANK GOD I found a solution!

    So it turns out that the code that BuddyDev mentioned was not to blame for the 500 error I mentioned in my intro. It was actually due to one of the two plugins that is recommended in BuddyDev’s tutorial (and they are now fixing that bug). 🙂

    I figured this out as I tried to reproduce the error while activating plugins in a different sequence.

    The first time I did this, I’d had BuddyPress disabled when I’d installed both plugins. I’d also already put the code mentioned in their tutorial into my bp-custom file. I then activated BuddyPress, and the site failed.

    This time, I had BuddyPress already activated, then installed and activated one of the two plugins BuddyDev recommended to use in the tutorial…and all was well. THEN…I installed the second plugin. And upon clicking ‘Activate’ the site failed again. NOTE: on the second attempt to reproduce the 500 error, I hadn’t put the code from the tutorial into my bp-custom file….

    And according to BuddyDev, even before I tried to reproduce the error, the bp-custom code I was using was sound.

    So when the site failed upon my attempt to reproduce the error, I knew: that plugin was to blame.

    Then, I found out more about that plugin…it is designed to be used for users to have extra fields to fill out upon signup, fields that would show in their Member Profile. And I have Member Profiles disabled. Wa-la!

    I then asked BuddyDev if I needed the plugin that failed…and THANKFULLY they said, ‘no — not needed for what you want to do.’

    WHEW!! 😀

    So, a summary:
    – Use custom code in bp-custom (pasted below)
    – Use one plugin in particular from BuddyDev
    – Do not use another plugin recommended by BuddyDev

    The plugin to DEFINITELY use, that was listed in their tutorial: ‘BuddyPress Member Type Generator’…that affects the ability for Webmasters to set custom member types AND an avatar specific to every custom type created! 😀

    The other plugin that was recommended in that tutorial, that is NOT needed to change user avatars for custom member types…not ever, as it has nothing to do with avatars — it was merely recommended in their tutorial so people could manage user profiles: ‘BP XProfile Member Type Field’

    SO. If you want to have a different default avatar for different member types, then you will need to use the ‘BuddyPress Member Type Generator’ plugin. Not the other one.

    Steps to take:
    1.] Download the ‘BuddyPress Member Type Generator’ plugin from BudyDev

    2.] Read their tutorial (I’ll paste a link below in follow-up comments to this comment)…do everything EXCEPT install the ‘BP XProfile Member Type Field’ plugin — it’s not needed for assigning an avatar via custom member type; it just is recommended in their tutorial to use so you can manage user fields 🙂

    3.] Use the code I’ll also paste below (in the follow-up comments) — modify it to your site’s name but insert your site name where I typed ‘sitenameprivate’…etc.

    4.] For creating more avatars with custom member types in the future, you’ll always have to update that same code in the bp-custom file…via FTP/SFTP; tbh that process is easy as pie once you realize how to do it

    5.] For making your life easier with switching out avatar images for member types without having to re-do the bp-custom file: just save over the image in your media library that is used for that particular member type…so the path is the same and your code won’t need to be changed

    Simple, yet difficult to find.

    Thank GOD FOR BUDDYDEV!!! <3


    lookingahead
    Participant

    @lookingahead

    @humiges did you ever find a solution to this? i hope you did…sounds like a huge challenge!


    lookingahead
    Participant

    @lookingahead

    oh, by the way: my site has user profile creation disabled. also have disabled the ‘extended profiles’ as well as the option to allow users to upload avatars to their profiles.

    i tried re-enabling those things (‘extended profiles’ and ‘allow users to upload avatars’)…..my site stalled, then crashed not long after.

    sooooooo enabling those two things is not an option, lol!

    one interesting thing to note: whenever i use ‘buddypress first letter avatar’ then the buddypress avatar changes to be whatever the plugin says to put there (the first letter of the user’s name)….that’s awesome!! AND i am using that ‘buddypress first letter avatar’ without extended profiles being turned on and also using it without allowing users to upload avatars to their profiles.

    so i know that you CAN indeed change a user’s profile via programming without having to enable those two (annoying, lol) features in BuddyPress.

    i’ve considered modifying that plugin, but to be honest that’s a little above my paygrade. 🙂

    thoughts, @prashantvatsh? is there a simple solution i’m overlooking — a filter or something? no plugin i’ve found (so far) in the WordPress plugin repository can alter the BuddyPress avatar except the ‘buddypress first letter avatar’ plugin.


    lookingahead
    Participant

    @lookingahead

    hi @prashantvatsh! so i went to that link you posted (above) which then leads to a WPMUDEV thread…which uses an outdated chunk of code that apparently was created to work with a “social login” plugin….and many users from back in 2015 (which is after the code was shared) say it no longer works with their site, and a couple commenters even said it crashed their site. 🙁

    so….is there a filter/code that i can use to get BuddyPress to use the WordPress avatar that I set instead of the BuddyPress avatar…?

    i don’t think that article will help get BuddyPress to use the same avatar that WordPress is using on a site.

    please note: i have gravatars shut off on my site for WordPress and also for BuddyPress. i did it via code for BuddyPress, and am doing it via a plugin for WordPress. i will not be using gravatars…not EVER. 😀

    so now, all i need to know is how to get BuddyPress to use whatever avatar that WordPress is using on a site.

    please also note: i am “forcing” WordPress to use a local avatar….which is exactly what i want. then, if i could only get BuddyPress to use the same avatar that WordPress is using….that would also mean that bbPress will use the same avatar, because bbPress uses whatever avatar BuddyPress uses.

    so…..if i could find a way to get the avatar that WordPress is using to be used by BuddyPress, that would make me SOOO HAPPY!! 😀 it would be the last piece of the puzzle in my website avatar issue.

    main question: can you help me “remove the condition where it is checking if the user has uploaded avatar or not”….?

    follow-up question: in the future, would that mean that BuddyPress’s avatar is always in synch with WordPress’s avatar? in other words, would any changes to the WordPress avatar then automatically show up within BuddyPress (which would then mean bbPress changes too, because bbPress uses the BuddyPress avatar)…?

    thanks in advance for any and all assistance! 🙂


    lookingahead
    Participant

    @lookingahead

    so now, anytime i want to edit a specific user’s avatar, i go to the DIRECT link to their profile page…i don’t go to the user directory first and click on it; i type the address directly into the browser

    and i’m on a Keymaster account when i do it….or else i won’t be able to get to that profile link

    wa-la 🙂


    lookingahead
    Participant

    @lookingahead

    by the way….here’s a summary of what i did:

    – used the code that venutius posted earlier from the BuddyPress codex page (the ‘Customizing BuddyPress Avatars’ codex page) to set a new default BuddyPress avatar

    – turned on the ‘extended profiles’ and also enabled users to be able to upload avatars

    – used prashant singh’s plugin, ‘BP Custom Functionalities’ to restrict listing of all profiles in the user directory — the directory is ‘still there’ but nobody is in it, lol

    – used a 301 redirect (via the ‘Safe Redirect Manager’ plugin) to redirect anyone who goes to the member directory page to the front page of the site…so the page itself is now not even viewable (not even by Keymasters)

    – used prashant singh’s snippet i pasted here to restrict all users from viewing their own profile…except Keymasters, who can view ALL profiles on the site, even their own (so the ‘users cannot see their own profiles’ doesn’t apply to Keymasters but this does apply to everyone else)

    so happy. 😀


    lookingahead
    Participant

    @lookingahead

    Ohhh, GOT IT!!

    looks like this code is exactly what is needed….i pasted it into a custom plugin and wa-la…credit goes to the fabulous @prashantvatsh! he replied in the support forum on his plugin (the ‘BP Custom Functionalities’ plugin)…like super quick, with the correct solution to me needing to restrict access to a user’s OWN profile. brilliant!

    here’s that support thread:

    https://wordpress.org/support/topic/restrict-access-to-users-own-profile/

    and here’s the code from prashant that i wound up putting into a custom plugin file and uploading to my site:

    add_action( 'wp', 'bp_own_profile_member_redirect' );
    function bp_own_profile_member_redirect(){
    	if(bp_is_user()){
    	    global $bp;
    	    $current_user_id = (int) trim($bp->loggedin_user->id);
    	    $member_id  = (int) trim($bp->displayed_user->id);
    	    if (!current_user_can('manage_options') && $current_user_id == $member_id)
    	    {
                    //Only admins can view their own profile
    	        wp_redirect(site_url()); //you can set any URL here
    	        exit;
    	    }
    	}
    }

    thanks again for all your help, @venutius — your help was fundamental to me figuring out the next steps (how the BuddyPress avatars exist and how to get those avatars to show what i wanted without messing with bbPress code)…i am truly grateful for all your assistance!


    lookingahead
    Participant

    @lookingahead

    @venutius ohhh i think i found a workaround….

    using that code from the codex that you posted earlier, plus a plugin to restrict user directory access (‘BP Custom Functionalities’) — so users can’t see OTHER user profiles in the directory.

    aaaaand as an added layer of security, i’ve put a 301 redirect on the user directory page itself for anyone who comes across it — they’ll be taken to the home page of the site. even if they’re a keymaster.

    and…..i enabled extended profiles, and the ability for users to upload avatars — keymasters can upload/edit individual profiles, but unfortunately that means that the users themselves can edit their own profiles; i don’t want them to be able to see their own profiles at all….

    so HERE is where i’m at now:
    – i need to find a way for users to NOT even view their OWN profiles

    thoughts?


    lookingahead
    Participant

    @lookingahead

    @venutius i think you may have missed my last comment before your plugin suggestions…just want to make sure, are you suggesting i use the front end (user profile page generated in buddypress) to change each user’s avatar….or are you suggesting i use the back end (from the dashboard) to change a user’s avatar after i “disable user profile uploads and see if you can change the avatar yourself from the users profile page”…??


    lookingahead
    Participant

    @lookingahead

    @venutius oh thanks for the suggestions, appreciate the plugin links…but they don’t accomplish what i need to do

    i need specific avatars for classes of users, ones that correspond to the styling and hierarchy of my site

    so identicons being ‘fun’…? sadly i don’t need fun, lol….i need a streamlined business look and fun with random identicons won’t work

    and creating local gravatar avatars for users that ‘don’t have one’ is also random — not corresponding with my site; if i wanted to have default gravatar avatars populate i’d just choose the options that come with WordPress by default — that already is an option

    and gravatar is incredibly cumbersome with its pinging to the servers where the gravatars are stored….it may seem minor to many, but it does burden a site

    plus, gravatars have weak coding that allow the email address of the user to be ‘scraped’ by bots

    so to protect my users from future spam and to keep my site as speedy as possible AND to have my site avatars correspond to the styling of my site i need gravatars to never ever ever be used, and nothing random either


    lookingahead
    Participant

    @lookingahead

    @venutius btw…..i’m referring to the part where you said, “see if you can change the avatar yourself from the users profile page”

    do you mean i should try to change the avatar from the backend, the ‘user profile’ in the dashboard or the user profile page generated in BuddyPress?


    lookingahead
    Participant

    @lookingahead

    @venutius thanks!

    you mean the user’s profile page in the dashboard, or the user profile page that is in BuddyPress?


    lookingahead
    Participant

    @lookingahead

    @venutius if i could juuuust get BuddyPress to use the same avatar that bbPress uses, that would solve basically everything

    that way i could use a plugin that changed the bbPress avatar, and then any change in bbPress’s avatar would show as the avatar for BuddyPress too

    know how to do that?


    lookingahead
    Participant

    @lookingahead

    @venutius agree…..

    thing is, in bbPress there are plugins that easily, and in a lightweight fashion, allow for custom avatars for users

    users can go to their profile in the dashboard and change it

    now, because i also restrict access to the dashboard for users that are not admins, this works. it works because i am then the one, then, that can change the avatars for individual users this way, without having to allow users to change their own avatars, and without enabling the creation of user profiles in BuddyPress

    simple dimple

    but for some godawful reason, even though this means that bbPress avatars can be changed this way via various plugins, BuddyPress doesn’t accept the same change

    i would think that bbPress is not that different, coding-wise, from BuddyPress

    buuuuut hell, i don’t know 😀

    if BuddyPress allowed the customization to happen like bbPress does, of individual avatars from the user dashboard, that would be great

    isn’t there a way to allow BuddyPress to use a bbPress avatar? so i could use the plugin that changes the avatar in bbPress, and then any changes to a bbPress avatar…BuddyPress would show the same avatar???


    lookingahead
    Participant

    @lookingahead

    @venutius ok, will test that code….but even if that code works to change the default avatar in BuddyPress, how would i change the avatar for each user on a case-by-case basis?

    please note: i will not be able to go to the user’s profile to change their avatar, because profiles are disabled. they do not exist.

    i want to be able to change a user’s avatar, but not allow my users to be able to change their own avatar.


    lookingahead
    Participant

    @lookingahead

    @venutius so if i disable user avatar uploads and use current_user_can( ‘capability’ ) in the file as you said….then only me, a keymaster/administrator, can change the user’s avatar? is that what you’re saying?

    where would i go to change it, if the existence of user profiles is disabled?


    lookingahead
    Participant

    @lookingahead

    @venutius that’s awesome and all, but how would i set different default avatars for different classes of users? as in…participants vs, administrators, etc.?

    and if there is no way to set a different default avatar for each class of users, how would i change the avatar for each user on a case-by-case basis?


    lookingahead
    Participant

    @lookingahead

    @venutius glad to have helped — and awesome on updating the page, thanks!

    btw, i’ve shut off user profiles; i do not want my users to be able to update their profiles at all….this is not a social site i’m building, even though buddypress is built with the idea that it resembles something along the lines of facebook…

    my site is going to have groups for the sole purpose of discussion, but not for socializing; i’ve deliberately shut off user profiles so users can’t even see them

    so enabling ‘extended profiles’…wouldn’t that require that i go to the user profile to update an avatar for a user? i’ve disabled that…so even if i were to turn on ‘extended profiles’ how would i be able to upload a user avatar for each user?

    as to that plugin, it works GREAT to shut off gravatar access; it shows the blank BP default image person thing….but even when i pair that plugin with other plugins that allow avatar customization, only bbPress avatars are affected with other plugins; BuddyPress doesn’t work with other plugins that try to get local avatars to show — even if i’ve already shut off the Gravatar display with that fab plugin you linked to (‘disable user gravatar’)


    lookingahead
    Participant

    @lookingahead

    the direct link to the Codex page if anyone wants to see it:

    https://codex.buddypress.org/themes/guides/customizing-buddypress-avatars/


    lookingahead
    Participant

    @lookingahead

    @prashantvatsh if you happen to have any idea how to get BuddyPress to use local avatars and stop trying to use Gravatars…while also allowing for certain classes of users (subscriber, participant, administrator, keymaster, etc.) to have their own default avatar, i’d greatly appreciate it


    lookingahead
    Participant

    @lookingahead

    and FYI — i’m actually happy to report that i fixed this issue, but BP FORUMS HERE won’t let me post it LOL….apparently i’m using a keyword that some plugin thinks is ‘spam’…LOL. i’m enclosing all my code in code tags, so….no idea what the deal is. will come back here and post when i get the chance to figure out how.


    lookingahead
    Participant

    @lookingahead

    nope, that’s not it @haleyscorner but thanks!

Viewing 25 replies - 1 through 25 (of 66 total)
Skip to toolbar