Search Results for 'profile fields'
-
AuthorSearch Results
-
October 26, 2012 at 3:34 am #143991
Toby Cryns (@themightymo)
ParticipantOctober 26, 2012 at 3:24 am #143987In reply to: Line breaks in profile fields descriptions
Toby Cryns (@themightymo)
ParticipantAre you using the “Multi-line Text Box” or “Text Box” field? The “Multi-line Text Box” supports line breaks.
October 24, 2012 at 11:19 pm #143909modemlooper
ModeratorYou have to pass id # of field a string wont work.
`$data = xprofile_get_field( 2, bp_displayed_user_id() );
print_r($data) ;`
This will not give you a members choice. It will only return the default visibility you set up in admin. to get a users visibility on a field you get from user meta.
`$user_visib = get_user_meta( bp_displayed_user_id(), bp_get_user_meta_key( ‘bp_xprofile_visibility_levels’ ), true );
print_r($user_visib) ;`
October 24, 2012 at 5:42 pm #143906evagorasc
ParticipantAha. Problems.
So, following the advice of @modemlooper I got this working just fine. Anything created under Buddypress custom user fields can display fine in the bbPress loops, using something like this:
`
$user_location = xprofile_get_field_data( ‘Location’, bbp_get_reply_author_id() ) ;
if (strlen($user_location) > 0 ) :
echo ‘Location: ‘ . $user_location . ‘
‘;
endif;
`However, how do I make sure I follow the custom fields’ restrictions regarding visibility? In BuddyPress we can create a custom field and set its visibility to be either:
1) Anyone
2) Logged In Users
3) My FriendsFurthermore, these fields’ visibility can be allowed to be changed by each user.
So, before simply displaying a custom field for just everyone, I need to run the required checks to verify that it should be displayed for the anonymous/logged-in user. I tried getting a reference to the actual field, like this but the var_dump() doesn’t help me much:
`$user_location_field = xprofile_get_field( ‘Location’, bbp_get_reply_author_id() ) ;`
This is the var_dump($user_location_field):
`object(BP_XProfile_Field)[29]
public ‘id’ => null
public ‘group_id’ => null
public ‘parent_id’ => null
public ‘type’ => null
public ‘name’ => null
public ‘description’ => null
public ‘is_required’ => null
public ‘can_delete’ => null
public ‘field_order’ => null
public ‘option_order’ => null
public ‘order_by’ => null
public ‘is_default_option’ => null
public ‘default_visibility’ => null
public ‘allow_custom_visibility’ => string ‘allowed’ (length=7)
public ‘data’ => null
public ‘message’ => null
public ‘message_type’ => string ‘err’ (length=3)`Even though I see a couple of public methods like “default_visibility()” and “allow_custom_visibility()”, they don’t really help. Their value doesn’t even change even when I change the field properties in the CMS.
October 24, 2012 at 9:15 am #143892yidamweb
ParticipantHi,
Thanks for your inputs. Hugo’s suggestion of having all user fields merged into the Base group appears more convenient. Paul, thank you for pointing me to the Profile >> Edit tab.
October 24, 2012 at 9:02 am #143890Paul Wong-Gibbs
KeymasterWhat screen are you looking at? The registration, or the member profile screens?
October 24, 2012 at 8:53 am #143888Hugo Ashmore
ParticipantWhy can they not be part of the ‘Base’ group ad thus part of the initial signup?
If a case of not wanting to have too many signup fields – a bad thing – then best I can think of is you would need to create a function that checks on one of those extended profile fields or all of them against the loggedin_user_id and if any returned an empty value then run a redirect to the users profile edit screen with a message request to complete the mandatory required fields on that page.
October 23, 2012 at 6:39 pm #143868evagorasc
Participant@modemlooper thank you for your help.
October 23, 2012 at 6:14 pm #143867modemlooper
ModeratorWhen you are not in a BuddyPress loop you can get BP content by using WP author id as it returns same id.
October 23, 2012 at 4:58 pm #143862evagorasc
Participant@modemlooper Thank you! That did it.
get_the_author_id() as well as bbp_get_reply_author_id() seem to both work just fine.
get_post_author_id() and $bp->displayed_user->id don’t seem to work for me though.October 23, 2012 at 4:38 pm #143861modemlooper
Moderator`$user_id = $bp->displayed_user->id;
$location = xprofile_get_field_data( ‘Location’, $user_id ) ;
echo ‘Location: ‘ . $location;if that doesnt work try getting the_author_ID(); or get_post_author_id();`
October 23, 2012 at 4:19 pm #143859evagorasc
ParticipantMade some progress with this, but still need help. I figured that I could simply add something like this underneath the avatar:
Code:$location = xprofile_get_field_data( ‘Location’, 10 ) ;
echo ‘Location: ‘ . $location;However, notice the hard-coded “10” there which is an ID. This needs to be the ID of each user in the replies table and it changes with each table row inside the “loop-single-reply.php” file. I don’t mind changing the template file and keeping a record for it when upgrades come, but how do I know the ID of each user in the bbPress posting loop?
October 23, 2012 at 2:55 pm #143852Paul Wong-Gibbs
KeymasterWow. This must a record for oldest resurrected thread.
Please start a new topic
October 23, 2012 at 2:30 pm #143848evagorasc
Participant@johnjamesjacoby i am running the latest version of BuddyPress and bbPress together (running bbPress as site-wide forums integrated with BuddyPress). I would like to add any custom xprofile BuddyPress fields that I created underneath the avatar of a user in the forums.
The actual code that writes out the replies loop is inside the “loop-single-reply.php” file of the bbPress plugin. But how do I connect to BuddyPress and display any xprofile fields that I want though?
October 23, 2012 at 6:45 am #143815In reply to: Edit profile data validation
raphadko
ParticipantActually I think it is impossible without modifying the core files. Any character limit or other custom validation is lost in the edit profile page, and since the $error is a local variable on xprofile_screen_edit_profile, there is no way to set it. Can you confirm that @djpaul?
I don’t know if this is planned for future releases, but I could help build a better validation code for user registration and edit profile. Adding a character limit to fields would be nice.October 23, 2012 at 6:25 am #143813In reply to: Edit profile data validation
raphadko
Participant@djpaul thanks for the reply
I found what is going on: xprofile_check_is_required_field bypasses if user is administrator, that’s why I was able to save required fields empty.
Now I am trying to hook xprofile_check_is_required_field to a bp-custom function called check_and_validate that also checks the fields for a character limit (another very important missing security feature I pointed out on another post.) But somehow it is not working.. any ideas on how to do it?By the way Paul, how can I submit tickets on bug tracking? I’ve been messing around with buddypress a lot lately and found a couple.
October 18, 2012 at 3:44 am #143628Janet Morrow
ParticipantI have the fields working now. There are still some things I’m looking to resolve, but I’m making good progress.
October 17, 2012 at 5:22 pm #143584In reply to: Settings > Social Media Settings
modemlooper
ModeratorDo you mean profile fields?
Users > Profile fields
October 17, 2012 at 4:30 am #143548modemlooper
ModeratorAvatar upload is only after the user has activated their account. There is a trac ticket to add this function back but it might not get added.
If you are wanting people to add an avatar when they log in. You can have the user get redirected to the change avatar page. This would have to be coded by you or a developer.
You can add any profile fields to the members-loop.php go into that file and scroll down to this text:
/***
* If you want to show specific profile fields here you can,
* but it’ll add an extra query for each member in the loop
* (only one regardless of the number of fields you show):
*
* bp_member_profile_data( ‘field=the field name’ );
*/October 16, 2012 at 6:17 am #143525In reply to: URGENT!!! PLS HELP -> Add new users from admin
benzine
ParticipantI’m in despair for such a solution right now. So, I think it’s better to have all custom fields mandatory while members can decide whether to hide or show them in public such that they can edit any fields later if they want to. Also, re-register from front end all manually created profiles from dashboard. This is the most plausible solution to me at this time.
Thanks for your time.
October 15, 2012 at 8:25 pm #143511In reply to: URGENT!!! PLS HELP -> Add new users from admin
modemlooper
ModeratorWhen you add users in the admin the xprofile fields are not present for you to add info. I don’t think there is a way around this unless there is some filter to force all xprofile fields to be shown even if they are empty.
When a user signs up on the front they have the fields shown to fill in. If they do not fill these in then they still wont be shown. It’s worth a possible trac enhancement ticket to include the xprofile fields in the user profile creation step in the WP admin. But even then if you do not fill in each field they will not be shown on a profile
October 15, 2012 at 7:35 pm #143507In reply to: URGENT!!! PLS HELP -> Add new users from admin
benzine
Participantthanks for taking the time looking at my problem mate. No, indeed it’s not broken but I want to have the unfilled fields present in the user profile if they want to edit it later on. Also, what do you think about users created from dashboard but still only have the name field displayed in their public profile? While this is also the only existing field which this particular user can edit?
October 15, 2012 at 7:06 pm #143505In reply to: URGENT!!! PLS HELP -> Add new users from admin
benzine
ParticipantPlease hover on the 1st and 2nd user to see the difference. The 1st one was created from the dashboard “add user” while the second one had registered from the registration form. I can’t understand why those created from dashboard don’t have the custom fields in their profiles???
October 15, 2012 at 6:47 pm #143503In reply to: URGENT!!! PLS HELP -> Add new users from admin
benzine
ParticipantHere is the story Paul. I run a normal buddypress install on my website http://tinyurl.com/cuq6axy. If you go to the 2nd menu item in the main top nav (sorry it’s in French), you’ll see a list of users. The admin of the site did add a bunch of these users from the WP dashboard. But when a user is published in this section from buddypress, it doesn’t display the extra custom fields created nor does it carry the unfilled fields (for later editing) from the registration form which is here http://tinyurl.com/9aqtbez. How can I synchronize all the fields and make them appear on these users profiles or when they edit their profile they still have the fields which were not mandatory but not filled still appear?
Does this explanation makes sense to you or anyone there?
October 15, 2012 at 6:30 pm #143501In reply to: URGENT!!! PLS HELP -> Add new users from admin
Paul Wong-Gibbs
KeymasterWhat profile field group are the new profile fields in? Did you create a new profile group, or are the new fields in the default profile group?
-
AuthorSearch Results