Search Results for 'profile fields'
-
AuthorSearch Results
-
July 8, 2011 at 8:50 pm #116012
In reply to: Is it possible to make some profile fields private?
danbpfr
ParticipantMaybe this can help ?
https://buddypress.org/community/groups/creating-extending/forum/topic/hide-profile-field/
https://buddypress.org/community/groups/bp-profile-privacy/
http://bp-tricks.com/snippets/displaying-certain-profile-fields-on-your-members-profile-page/also remember that privacy controls don’t apply to Admin. Admin can see everything. Log in as a regular user and then test.
July 8, 2011 at 8:13 pm #116010In reply to: Is it possible to make some profile fields private?
tnd
MemberI hate to bump, but…any ideas?
July 8, 2011 at 8:08 pm #116009Nahum
Participant@gregfielding are you not wanting to use dropdown select for any reason? instead of using checkboxes/radio? Can you have more than one role? If you only need one role per user, why not use dropdown xprofile field and make it required at sign up?
July 8, 2011 at 6:14 pm #116000gregfielding
ParticipantAs a work-around, I wonder if I could use this plugin https://wordpress.org/extend/plugins/buddypress-xprofiles-acl/ to assign roles based on the profile field answer.
Then I could more easily show different sidebars depending on roles.
Not the cleanest way to do it. Has anyone else had trouble with checkboxes?
July 8, 2011 at 4:34 pm #115991gregfielding
Participant@pcwriter @johnjamesjacoby
Yup. Bug is definitely still there. Nice find!July 7, 2011 at 11:28 pm #115954pcwriter
ParticipantOops… forgot the link

https://buddypress.trac.wordpress.org/ticket/2685July 7, 2011 at 11:27 pm #115953pcwriter
ParticipantJust tested the snippet by @nuhammadrid above with a dropdown select and it works perfectly.
I found this old trac ticket (pre 1.2.6) but maybe checkboxes/radio buttons are stilla bit buggy with xprofile_get_field_data
July 7, 2011 at 10:54 pm #115951gregfielding
ParticipantLooks much cleaner, but still isn’t working. I tried using a radio button and that didn’t work either.
What I’m trying to do should be simple

If you are a professional, you get one sidebar. If you are a civilian, you get another. And I’ve got a checkbox on the registration form.
Thanks for all of your help so far you guys…
July 7, 2011 at 10:01 pm #115947Nahum
Participantyet another way to do it, i think…
`<?php
global $bp;
$user_id = $bp->loggedin_user->id;
$type_member = xprofile_get_field_data( ‘Real Estate Industry Professional’, $user_id );?><?php if($type_member == 'Yes')
>
Yes Sidebar
<?php elseif($type_member == 'No')
>
Another Sidebar for this optionSidebar for everyone else
`July 7, 2011 at 9:42 pm #115945Nahum
Participantyea there’s prolly an easier way to go about it. I’ve just copied/pasted/refreshed different combinations til something worked.
I look forward to seeing something simple to use for stuff like this. heheJuly 7, 2011 at 9:36 pm #115944gregfielding
Participant‘if($type_member == ‘Yes’)…`
Either way, even if I create a second function, It isn’t recognizing the profile field.
This seems fishy to me. Is $type_member really the way to call a profile field entry? Or could it be a checkbox issue?
July 7, 2011 at 9:35 pm #115943Nahum
Participantdon’t know what I just did but this seems to work…
`loggedin_user->id) == ‘Yes’) : ?>
Red Sidebar
<?php elseif(is_user_logged_in())
>
Another sidebar
`and you want this to look like this
`//CHECK IF THE ACCT IS CERTAIN ACCT TYPE
function My_Function ($user_id) {
global $bp;
$type_member = xprofile_get_field_data( ‘Real Estate Industry Professional’, $user_id );
if($type_member == ‘Yes’) {
return true;}
}`July 7, 2011 at 9:27 pm #115942Nahum
ParticipantI couldn’t figure out how to display something else…
I guess you could create different functions for each type of field
`loggedin_user->id)) : ?>
Red Sidebarloggedin_user->id)) : ?>
Blue Sidebar
`I wish I knew enough about what all is happening in that piece of code. So that I could make it work the way i proposed. otherwise, there will be a blank sidebar for non logged in users and users who don’t have a xprofile field selected corresponding with those requirements.
July 7, 2011 at 9:18 pm #115941gregfielding
Participant@pcwriter – replacing “Yes” with “1” didn’t work – was that what you meant?
@nahummadrid – yes, that works.July 7, 2011 at 9:14 pm #115940Nahum
Participant`loggedin_user->id)) : ?>
Red Sidebar
`This works though right.
July 7, 2011 at 9:08 pm #115938pcwriter
ParticipantTry using boolean values instead. If you want “Some other sidebar” to display if the box is checked, then the value should be “1”. Worth a try…
July 7, 2011 at 8:59 pm #115936gregfielding
ParticipantThanks @nahummadrid
I think it’s closer but still not working right. It only shows “Some other Sidebar”.
Here’s my code:
`//CHECK IF THE ACCT IS CERTAIN ACCT TYPE
function My_Function ($user_id) {
global $bp;
$type_member = xprofile_get_field_data( ‘Real Estate Industry Professional’, $user_id );
if($type_member == ‘Yes’) {
return true;
} else {
return false;
}
}`I wonder if the issue is that I’m using a checkbox, with the option of “Yes”…
July 7, 2011 at 8:48 pm #115935Nahum
Participantin the function, where color = your main field heading, I’ve used a dropdown. and Red is one of the drop down items to select from.
I don’t know if it works the same if the field was just a text field. I imagine so.
July 7, 2011 at 8:42 pm #115932Nahum
Participant@gregfielding I forgot where I found this (maybe bp-tricks)
put this in your bp-custom
`//CHECK IF THE ACCT IS CERTAIN ACCT TYPE
function My_Function ($user_id) {
global $bp;
$type_member = xprofile_get_field_data( ‘Color’, $user_id );
if($type_member == ‘Red’) {
return true;
} else {
return false;
}
}`Then to display in sidebar
`
loggedin_user->id)) : ?>
Red SidebarSome other Sidebar
`July 7, 2011 at 8:33 pm #115930gregfielding
ParticipantTrying to call the loggedin_user_id, but doing to wrong…
`loggedin_user->id) && bp_get_profile_field_data(‘field=783’) === “Yes”) : ?>
sample code
`July 7, 2011 at 6:23 pm #115916gregfielding
ParticipantHere’s the code I’m trying to use in my sidebar:
`
sample code
`
July 6, 2011 at 7:59 pm #115874In reply to: Profile fields for specific user roles
embergermedia
MemberI use S2member to monitor my sites membership, it provides hooks and such (not too sure about the terminology) that allow you to display content to certain user roles. I have a user role for companies (experts). I also have a profile field group just for them. It is the last group.
I have added inline css using last-child selector to hide the menu option to edit this profile group from everyone except members that have a level 2 membership. And since Buddypress will only show profile data if the field has been filled in, it only shows on Experts (level 2 ) users public profiles.
If this is confusing, let me know and I’ll try to give exact steps for how I accomplished this.
July 1, 2011 at 9:04 pm #115547pcwriter
ParticipantCheck out this thread. You can adapt the code provided for xprofile fields by simply replacing the ul class with `table.profile-fields`.
https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/make-drop-down-menu-links-open-in-new-page/There are also several plugins that might get the job done too, but you may have to fiddle with them. Search the wp repo for “Open external links in a new window” for a few examples.
June 28, 2011 at 12:33 am #115322Magi182
ParticipantI was able to hack this plugin to accomplish most of what I needed:
https://wordpress.org/extend/plugins/bp-export-users/
You have to edit the array in the plugin file to use your buddypress profile fields (you can add or delete), but other than that, pretty slick.
June 26, 2011 at 1:42 am #115224In reply to: How to manage users & their extended profiles?
Meini
MemberSorry guys for some reason I don’t get emails sent to me when there is activity in my groups and I haven’t been too active here for a while. I have made a start and produced something usable, but haven’t worked on it for a while, so I would like to make this code available to anyone who is interested to expand on it. I managed to implement a feature to force users to complete mandatory fields in their profile if they haven’t done so.
Help yourselves… http://www.utechworld.com/files/public/buddypress-utech-user-manager.zip
Have fun …

-
AuthorSearch Results