Skip to:
Content
Pages
Categories
Search
Top
Bottom

Per-group Identity?


  • Tony G
    Participant

    @starbuck

    I’m building a site where a user’s identity in one group isn’t related to his/her site identity, and where the identity is different across groups.

    So for example, the WordPress.org site provides single-signon between that site and this BuddyPress.org site. But while I’m Starbuck there, I might prefer to be “MrBuddy” here, or “TechDude” in some other developer site.

    My application is for a single site but the concept is the same. A user has a single site account and wants to be in different groups where he is recognized by a different name, has different different profile fields, etc.

    Given that scenario I’m also trying to figure out the best way to manage group invitations. Some people invited to a group will already be site members. Rather that requiring group admins to have the email address for all group members I’d prefer that they invite site members by their member name/ID, with an email going out to the user from the site using a stock template : “You’ve been invited to the ZSite group Blah, click here to accept…”.

    Can anyone refer me to extensions/plugins for this? I’ve found some that do some of this, but not all, and nothing that’s been maintained for a while.

    Thanks!

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

  • Tony G
    Participant

    @starbuck

    Please advise if this posting was mis-placed, incomplete, or simply clueless. I’m just getting familiar with these mods and this specific community so I might not have provided the right information in the right location.

    To rephrase: I know BP groups existing WP users. But individuals have a different identity in different social groups. At school the teacher might call a guy Robert, at home he’s Bobby, to friends he’s Bob, and to his gaming friends he’s Zarkon. If this individual is logged into WP with a single email address, can we have groups where he can be identified with his preferred group name?

    Thanks!!


    shanebp
    Moderator

    @shanebp

    No, afaik, his name will be the same across the site.

    There are probably ways to filter group member names, but it would require extensive knowledge of BP and access to your site – iow. you should hire a BP developer.


    shanebp
    Moderator

    @shanebp

    Please do not post duplicate topics!


    Tony G
    Participant

    @starbuck

    Agreed on no duplication, but after a week with no response I figured it was time to bump or try elsewhere. πŸ™‚

    I’m a developer for more decades than I should admit here, though not a PHP stud. If anyone can point me to a plugin that does something along these lines, I might be able to look at integrating between BP plugin and BP core. I’m thinking a plugin for custom fields would at least provide the storage location for a group-oriented name, plus other fields for group-specific data. So thanks for your response, Shane, and I’m hoping others will still feel welcome to respond as well.

    Shane, I don’t know if you can move topics as a mod, (I know you can delete πŸ™‚ ) but might this be better over at HowTo rather than Installation? More eyes, more a appropriate? Thanks.


    shanebp
    Moderator

    @shanebp

    Creating some custom fields won’t be enough.
    afaik – you want separate and multiple ‘sub’ identities for each user.
    That won’t be easy, but even so, creation of sub-identities is only part of the issue.
    Parsing out which sub to use in which situation for content creation and display will be a tangle.

    But take a look at group meta


    Tony G
    Participant

    @starbuck

    Well, group meta allows meta data to be applied to groups. I’m thinking along the lines of data in the usermeta table which is only consumed by specific groups. This might be expressed as a name/value pair in the profile. So with reference to my original example, a GroupName profile value would include:
    school:Robert
    home:Bobby
    coolGame:Zarcon

    The BuddyPress Profile Shortcodes plugin allows for custom fields and related shortcodes to be used. This is much closer to my needs but still not quite there. I can’t create a profile field for every possible group. Ideally there would be a pulldown of groups to which the user belongs, where they can enter the name they wish the use for that group, and the group/name pairs would be displayed in a grid.

    Now I’m thinking one of the better user meta plugins could handle that. But I would also need to customize it so that there can only be one WP user with a specific value for a specific group. This is a unique key per group, as some reference to @Bobby can’t apply to more than one person, but the @Bobby in one group can be different from @Bobby in another group.

    On the client side, I would then need to modify bbPress to get the user name that’s specifically for the current group, rather than using wp_get_current_user()->display_name or whatever it has there. For example:
    get_user_meta($user_id,’groupName_’.$group_id,true)
    or better
    get_user_meta($user_id,’groupNames’,false)[$group_id]

    Actually I’d rather abstract all requests for a user name to a function which can then be replaced with custom code just once. I don’t suppose anyone has already done that, or it’s been proposed as a BP/BBP enhancement?

    I’m a noob with coding into WP, haven’t touched BP/bbP, and know little about the APIs, so please bear with me on the syntax and other specifics and focus on the concepts. Thanks.

    The more I try to flesh it out above the more it seems possible for me to do this myself. But it would be really helpful if someone has already done it. Or if someone with knowledge in this area can see a more direct line from an exiting plugin to the solution I’m describing.

    Thanks for your time!!


    shanebp
    Moderator

    @shanebp

    I can’t create a profile field for every possible group.

    You can create a custom profile field by extending BP_XProfile_Field_Type.
    That custom field could pull in the group names for that member and allow them to enter a name per group name.

    You can filter the member name by using the filter hook in bp_member_name(), found in:
    buddypress\bp-members\bp-members-template.php

    How, when and why you apply that filter is up to you.

    The same filter may not work for bbPress, but they probably have something equivalent.


    Tony G
    Participant

    @starbuck

    We’re on the same page. I think this is the right direction. I believe relevant filter hooks for bbPress include bbp_get_displayed_user_field( ‘name’ ), bbp_get_current_user_name, etc. Within a hook I can get a name from an XProfile field.

    I’ll continue to look in this direction – and I have a lot to learn.

    Thank you very much for your time and patience.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Per-group Identity?’ is closed to new replies.
Skip to toolbar