Solution
`
function user_nav_add_anchor() {
global $bp;
$bp->bp_nav .= “#your-anchor”;
$bp->bp_nav .= “#your-anchor”;
//etc
}
add_action( ‘wp_head’, ‘user_nav_add_anchor’,9 );
`
Anyone know of a way to do this with a loop through all the $bp->bp_nav[] fields ?
Hi
I want to make some system to post a specific field of a user profile to another website (as action) and show up their schedule!
so the question is how can i get access to for example a select box value?
for example if user selected 1 in that select box how can i get that?
just like $_POST[“fname”];
what should i specify this “fname” to? i mean what will it be in profile fields?
@onyx808
Oops… my comment about “Required” fields is a bit (a lot?) misleading
Users will not be able to save their profile settings until all required fields are filled out… that’s what I meant by “trapped”
ooooooooooooh!! @pcwriter thank you thank you thank you!!!!
@onyx808
That’s a basic feature of profile fields. Go to “Profile Field Setup” in your backend and you’ll see this:
“NOTE: Any fields in the first group will appear on the signup page.”
Simply click the “Add New Field Group” button and create the fields you want in that new group. They will not appear on the signup page, but will be available on the user’s Profile page.
Be careful with the “Required” setting though. If you set fields in new groups to “Required”, your users will be trapped on their profile page the first time they visit until they fill in all required fields.
Thank you for responding. I will check that. Unfortunately, a much larger error has cropped up that bumped this style issue back.
I will let you know how the test goes. (mostly I appreciate you letting me know I was in the right file. It was driving me nuts!)
Hey guys,
is there a way or plugin to have a set of field in the profile page that are not from the signup form?
I want to have a few fields with a set of questions like “Favorite Restaurant” and the user be able to edit this and add their favorite restaurant etc… similar to facebook.. I dont have to overload the sign up form…
thank you!
Onyx
Hi.
Thanks for the code Brajesh! I just had one question. I’ve defined different profile field groups for different user types. I want to restrict the visibility of these filed groups to only those users (e.g. users of type A get to see only those profile fields for user type A). My problem is that when I use your code
<?php global $bp;
if(bp_get_current_profile_group_id()==1)
bp_core_redirect($bp->displayed_user->domain.”profile/edit/group/2″);
?>
it shows the same profile fields for all user types. I guessed it was because 1 is the base profile group ID and tried changing the if loop to
if(bp_get_current_profile_group_id()==ID number of group)
bp_core_redirect($bp->displayed_user->domain.”profile/edit/group/ID number of group”);
but now it shows me only the ‘Editing base profile’ screen
Is this code correct?
Cheers
You are in the right file, so if you are not seeing your changes, then the file is not being overwritten.
Try something simple to see if your edited file is being loaded.
Change this:
`
`
To:
`
HELLO HELLO HELLO HELLO HELLO HELLO
`
based on the comps from the designer, I have to restructure the fields on the profile from tables to divs in order to properly style them. I found this file and made the appropriate changes:
wp-contentthemesbp-defaultmemberssingleprofileprofile-loop.php
I swear this is where the fields are, but when I upload my updated file, the changes are not taking.
is there someplace else I need to edit?
a “find in file” search did not show any other tables. I can keep beating my head on this one or someone can tell me it can’t be done.
any help appreciated!
Thanky!
Argh – much faster, coding and parsing-wise, to do this in members_single_profile/edit.php
as opposed to doing an add_filter on ‘bp_get_the_profile_field_options_select
Error caused by checking for ‘acceptable value’ before save.
See
/* Check the value is an acceptable value */
around Line 735 in bp-xprofile.php
I removed ‘selectbox’ from the ‘if’ and profile save now works.
I need to do a Between search on a Height profile field.
But the admin profile field setup doesn’t allow for a difference between option value and displayed option.
So you get:
`under 5′ – 152cm`
What I need is:
`under 5′ – 152cm`
I can generate what I need by adding, to bp-custom :
`add_filter( ‘bp_get_the_profile_field_options_select’, ‘profile_field_options_select_swap’, 10, 1 );`
and using str_ireplace to swap the values.
But if the user edits their profile on the Height selector, they get the error – “There was a problem updating some of your profile information, please try again.”
Any hints on cause and fix for this error ?
Is it possible to update the extra profile fields from a plugin? Say, from an LDAP integration pulling the information from the LDAP directory. I know how to pull the information, just not how to update the profile fields.
I’ve added some profile fields to the first group and selected them as required, yet users are being allowed to complete registration without completing those fields. Also, when existing users try to update their profile to include this information they get an error message. How can I make sure that a registration is denied unless they complete ALL fields I’ve marked as required and let existing users update their information for these fields.
you can delete those groups in your profile field setup panel
what are you trying to achieve?Are you trying to display those based on user roles?
bp_get_the_profile_group_id() is returning only one ID you have to create an function that returns an array of id’s and then you need to loop over those and exclude 7 and 6.
you can try this
profile loop
`
<?php
if ( bp_profile_group_has_fields() && 6 != bp_get_the_profile_group_id() && 7 != bp_get_the_profile_group_id() ) :
?>
<div class="bp-widget “>
`
Not sure. I just downloaded and it worked. I did notice when I was in a member profile and looked at my public profile tab the fields showed up. When not logged in or logged in as another user, the fields were not visible. I am also using Role Manager plugin, not sure if that makes any difference.
I’ve added some profile fields to the first group and selected them as required, yet users are being allowed to complete registration without completing those fields. Also, when existing users try to update their profile to include this information they get an error message. How can I make sure that a registration is denied unless they complete ALL fields I’ve marked as required and let existing users update their information for these fields.
@graq Yes into bp_xprofile_fields.
I have some drop down fields. When a user goes to edit them, the data is saved correctly. However, when they revisit the edit profile tab, none of the drop downs show as selected. Is this a bug? Or have I broken something?
@ultimateuser Do you mean write values directly into bp_xprofile_fields ?
I wrote some dirty SQL to do just that.
` $insertsql = $wpdb->prepare(“INSERT INTO {$tablename} (group_id, parent_id, type, name, description, is_required, order_by, field_order, is_default_option, option_order ) VALUES (%d, %d, %s, %s, %s, %d, %s, %d, %d, %d )”, $group_id, $parent_id, $type, $region, ”, 0, ”, 0, 0, $option_order );`
To be honest, I was hoping there would be a better way.
@Mikey3D another thank you from me
It’s not entirely clear how you would integrate this into BuddyPress itself, since every installation will have different “links” between profile fields. What kind of interface would be used to allow site admins to dictate such dependencies? If anyone is interested in providing a patch, or building a plugin, it might be worth looking at something like Drupal to see if they’ve implemented similarly dependent metadata fields, and how they’ve done it.
Hmm I see, what you mean by to be done on the frontend is by editing the source code right?
I think this feature have been requested by others also and I think this is pretty basic functionality.
Hope this feature will be integrate to buddypress in the near future.