Search Results for 'profile fields'
-
AuthorSearch Results
-
May 27, 2014 at 6:35 pm #183381
Iurie Malai
Participant@danbp, I know how to check for errors, but this didn’t helped me too much :). I solved with the blank page, but no more. Your solution works for hiding some xProfile tabs from viewing, but not from editing them. Am I wrong? Sorry!
This is my tested function (as I said, it hiding only from viewing, not from editing):
function flegmatiq_profiles( $retval ) { if ( is_user_logged_in() && !bp_is_profile_edit() ) { $myfield = xprofile_get_field_data( 'User Type' ); if( $myfield == "Faculty" ) { $retval['exclude_groups'] = '2'; //$retval['exclude_fields'] = '6,18,39'; } } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'flegmatiq_profiles' );The next code works as I need, but I think it is not so elegant, and it not allow to use the group ID, only his order number, as ordered by admin:
function hide_profile_group_tabs_from_editing( $group_names ){ if ( is_user_logged_in() && bp_is_profile_edit() && xprofile_get_field_data( "User Type") != "Faculty" ) { for ($x=0; $x<=sizeof($group_names); $x++) { if ( $x != 3 ) echo $group_names[$x]; //3 is the order number (from 0) of the tab that I need to hide in the profile edit page. This is not the group ID. } } else { return $group_names; } } add_filter('xprofile_filter_profile_group_tabs', 'hide_profile_group_tabs_from_editing');May 24, 2014 at 4:16 am #183301In reply to: Need initial advice on custom design capabilities
theatereleven
ParticipantI’m finally back on this – have installed the new BuddyPress.
Have a problem: there are no WYSIWYG editors as option profile fields. I’m trying to find a solution to this – have you seen any?
I also need to be able to use if and then statements so profile fields that are not filled out don’t show in the template.
Just purchased the book on theming BP, but if you have any pointers on the above two items, that would rock. Thanks!
May 23, 2014 at 5:08 am #183264In reply to: Buddypress Profiles feature request
theatereleven
ParticipantHey, did anyone get this working? I too need a WYSIWYG editor for the text areas in the BuddyPress profiles. Can’t live without that.
Henry – I see your notes above, but a little hazy on where to put that in my edit.php file. Would you be able to spell it out more?
Basically, my edit.php file now shows this:
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <div<?php bp_field_css_class( 'editfield' ); ?>> <?php $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $field_type->edit_field_html(); do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?> <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a> </p> <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> <fieldset> <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> <?php bp_profile_visibility_radio_buttons() ?> </fieldset> <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a> </div> <?php else : ?> <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> </div> <?php endif ?> <?php do_action( 'bp_custom_profile_edit_fields' ); ?> <p class="description"><?php bp_the_profile_field_description(); ?></p> </div> <?php endwhile; ?>May 22, 2014 at 8:15 pm #183247Iurie Malai
Participant@danbp, thank you! I tested your solution (the last function), but no success. Is enough to put this in the bp-custom.php file?
I tried the next simple function to hide the extended fields group number 2 from editing for all members, but it not working.
function flegmatiq_profiles( $retval ) { if( bp_is_profile_edit() ) { $retval['exclude_groups'] = '2'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'flegmatiq_profiles' );May 21, 2014 at 5:45 pm #183208In reply to: Set checbox value with xprofile_set_field_data
danbp
ParticipantMaybe read here, the post and all the comments:
Fetching and Showing only Specific fields from BuddyPress XProfile data
May 21, 2014 at 11:57 am #183188danbp
ParticipantSince BP 2.0, you can use bp_parse_args to customise template loops and on a much easier way as never before.
The example function below will hide profile groups with ID 1 and profile fields IDs 6, 18 & 39 on the public profile screen of each member and stay visible on the edit screen. Tested & approved 2.0.1
If you get some php warning while using this function, be aware that there is a bug in 2.0.1 bp-xprofile-classes.php (fixed. See ticket). Simply apply the lattest patch to get rid of this error.
function flegmatiq_profiles( $retval ) { // conditionnals to set accordingly to your purpose if( !is_user_logged_in() && !bp_is_profile_edit() ) { $retval['exclude_groups'] = '2'; $retval['exclude_fields'] = '6,18,39'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'flegmatiq_profiles' );In your particular case, you have to play with the conditionnals
The example below is to give you an idea how to handle this. Not tested !
function flegmatiq_profiles( $retval ) { $myfield = xprofile_get_field_data( 'Faculty', $user_id ); if( empty( $myfield ) ) return; // or echo if( $myfield == "Faculty" ) if( bp_is_profile_edit() ) { $retval['exclude_groups'] = '1,56'; $retval['exclude_fields'] = '6,18,39'; . } if $myfield == "field_name_2"; // do something other... return $myfield; add_filter( 'bp_after_has_profile_parse_args', 'flegmatiq_profiles' );May 19, 2014 at 4:39 pm #183117In reply to: How add filter to bp_the_profile_group_field_ids?
danbp
Participant@simpleone,
you found the reason why it doesn’t work on one site and not on the other !
1.9.1 and 2.0.1 are sligthly different BP version !
And the function you mention whas only introduced in BP 2.0, so this can’t anyway work on previous versions.Actually there is a small bug in BP 2.0+ when using this function to modify profile groups. I opened a ticket about this and @imath provided a patch that works and let the function handle correctly on profile groups. I personnally use this function to conditionnally show/hide fields from the base group without problems. My profile form contains over 20 fields in differents groups, even Base, and are all required and viewable by members only.
I advise you to cancel whatever you have done about this so far, to apply the patch, to add the function to bp-custom.php and to test again.
May 18, 2014 at 10:00 pm #183097In reply to: Filter Members List Based On Profile Field
latinosamorir
ParticipantHi @kizzywizzy.
Thank you for bringing this up.
I’m interested in created an additional Member Directory (keep default, and have a new page with a custom member directory).
In this new Custom Member Directory, I would like to do something similar to what you’re doing (filter members based on loggedin member profile fields). Basically create a list of Member Suggestions.
Any idea on how to use the code you’re provided to make the above happen?
Thank you!
May 18, 2014 at 9:59 pm #183096In reply to: How add filter to bp_the_profile_group_field_ids?
SimpleOne
ParticipantOK, so this is interesting. When I tried inserting the code from @danbp in the functions.php file for another test site that I have, it worked! All 3 fields were successfully hidden during Profile Edit, and I no longer received the error message that all required fields must be filled in. Yippee!!!
Still not sure why I cannot get this to work on my first site, though. FYI, I’m running BP 1.9.1 on that one, and on the other test site (where I got this to work), I’m running BP 2.0.1. I even tried removing all code from my functions.php file on my first site and just leaving the above code, but that didn’t make any difference. So I’m still scratching my head trying to understand why this would work on one of my sites, but not the other.
NOTE: I did discover that this solution ONLY works if you do not have a required field set up in your base profile group. Otherwise, you will still receive the error message about needing to fill in required fields when you click the Save Changes button. I found a way to get around this by moving all required fields (like Display Username) out of the base profile group and putting those required fields in a different profile group.
May 18, 2014 at 4:46 pm #183085In reply to: How add filter to bp_the_profile_group_field_ids?
shanebp
Moderatordanbp’s function works fine here.
Although in BP 2.0+, bp_is_profile_edit() should be bp_is_user_profile_edit() to avoid the deprecation notice.Are you sure you’re inserting the correct ids?
Try this and see if it hides the Name field:
$retval['exclude_fields'] = '1';May 18, 2014 at 3:29 pm #183084In reply to: How add filter to bp_the_profile_group_field_ids?
SimpleOne
ParticipantThanks. I tried inserting your suggested code into my functions.php, but it did not hide the desire fields. Also, I looked at the references in the links you provided for me to read through. Thanks for those too. However, I’m still stuck on how to resolve my problem.
Just to be clear… I think what I specifically need to figure out is how to add a filter to bp_the_profile_group_field_ids(), which apparently creates a list of the expected field names (for the specific group tab that I’m currently on) when I click “Save Changes” button on Profile Edit page. Until I can find a way to filter out my 3 desired “required” fields during the Save Changes button press, I will continue to receive the error message: “Please make sure you fill in all required fields in this profile field group before saving“.
Is there some other type of coding I can try to insert inside functions.php to resolve this?
May 18, 2014 at 8:48 am #183075In reply to: How add filter to bp_the_profile_group_field_ids?
danbp
ParticipantHi @SimpleOne,
read from line 154 in bp-xprofile-classes.php file. It contains many information for what you want to do.
See also on Codex here and hereYou can also revert your changes back and use this kind of function (goes into theme’s functions.php or bp-custom.php):
function simple_one_hide_some_profile_fields( $retval ) { if( bp_is_profile_edit() ) { $retval['exclude_fields'] = '48'; //field ID's separated by comma } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'simple_one_hide_some_profile_fields' );May this help ? 😉
May 17, 2014 at 5:14 pm #183059In reply to: 2.1 top features
stripedsquirrel
Participant1) Change group slug (old plugin does not work).
2) All possible types of X-profile fields (homepage URL, twitter URL, working multi-select boxes etc)
3) x-profile fields that can be set by admin and not edited by user.
4) Shortcodes or other options to display userquery based on x-profile fields. For example: display all users that have checked option ‘B’, all users that have run 2 marathons, all users from Europe etc.
5) easy way to change all base-level slugs (groups -> teams, members-> runners etc).May 17, 2014 at 6:01 am #183038In reply to: [Resolved] How to hide more than one profile field?
SimpleOne
ParticipantCorrection to my last post. I meant to say…
I was able to successfully hide certain profile fields from being displaying (by modifying profile-loop.php). And I was able to hide the same fields from being displayed when a user goes to edit their profile (by modifying edit.php).
NOTE: Both files are located in: /bp-templates/bp-legacy/buddypress/members/single/
I still need help figuring out how to avoid the above-mentioned “required fields” error message upon clicking the Save Changes button.
May 17, 2014 at 1:22 am #183032In reply to: [Resolved] How to hide more than one profile field?
SimpleOne
ParticipantOops… I just found a problem.
The good news is that I was able to successfully hide certain profile fields from being displaying (by modifying profile.php). That part works great. Also, I was able to hide the same fields from being displayed when a user goes to edit their profile.
However, the problem I just discovered is that if any of those fields that I’ve hidden (using the above code changes) are “required” fields, then when a user goes to the Edit Profile page, the following error message appears upon clicking the Save Changes button: “Please make sure you fill in all required fields in this profile field group before saving.”
Even though I’m certain those hidden fields have values in them, that error message appears and there’s no way to save changes.
Any solution to this?
May 16, 2014 at 8:22 pm #183027In reply to: [Resolved] How to hide more than one profile field?
shanebp
ModeratorTry:
while ( bp_profile_fields() ) : bp_the_profile_field(); if ( bp_get_the_profile_field_id() != 'ID # YOU WANT TO SKIP' && bp_get_the_profile_field_id() != 'ID # 2nd field YOU WANT TO SKIP' ) :May 14, 2014 at 10:59 pm #182934In reply to: Select Box – on Select 'Other' open Textbox
julianprice
Participant@antimuffin are you referring to extending profile fields. If so here’s the link for that which supports drop down select. however unsure if it supports conditional/dependent fields. You may have to look into a plugin.
i.e
Drop Down Select:
– option 1 NAME
– option 2 NAME
– option 3 Other
if other [TEXT BOX]Anyways here’s the link to codex https://codex.buddypress.org/buddypress-components-and-features/extended-profiles/
May 14, 2014 at 3:16 pm #182889In reply to: Probleme using BP core functions
mika89
ParticipantIt doesn’t seem to work :(.
Maybe I’m not doing it in the good way…I also tried the function
/** * Search the friends of a user by a search string. * * @param string $filter The search string, matched against xprofile fields (if * available), or usermeta 'nickname' field. * @param int $user_id ID of the user whose friends are being searched. * @param int $limit Optional. Max number of friends to return. * @param int $page Optional. The page of results to return. Default: null (no * pagination - return all results). * @return array|bool On success, an array: { * @type array $friends IDs of friends returned by the query. * @type int $count Total number of friends (disregarding * pagination) who match the search. * }. Returns false on failure. */ function friends_search_friends( $search_terms, $user_id, $pag_num = 10, $pag_page = 1 ) { return BP_Friends_Friendship::search_friends( $search_terms, $user_id, $pag_num, $pag_page ); }I called it this way :
friends_search_friends('', $user_id, 0, 0);
But doesn’t workMay 13, 2014 at 8:30 am #182826In reply to: 18 and older only signups
sharmavishal
Participant1. Use BP Xtra Signup plugin and add an xprofile field of birth date
2. Not sure on this but this plugin might help Buddypress Xprofile Custom Fields
May 7, 2014 at 9:05 pm #182622In reply to: Limit members search to full name only
kevinmorton
ParticipantI’m looking for a solution to this as well. With a members directory that only shows a list of member names, the results are unintuitive unless I have a way to only search the member name, rather than all profile fields.
May 6, 2014 at 2:45 pm #182553In reply to: WP profile fields not editable in BP profile
elaborate
ParticipantI think I need to clarify that it’s the not being able to configure the WordPress profile in BuddyPress that I think is the issue. Displaying the fields is another side of it that I might agree should be left to a plugin developer.
…it will require keeping up with WP if they decide to switch which fields are included on that page.
I agree that this is an issue, but realistically, the WordPress profile hasn’t been updated in several years, apart from very recently when they actually removed fields in an effort to simplify it, so I doubt they intend to add anything to it either.
The fields at wp-admin/profile.php are very odd, and not appropriate for most BuddyPress installations…
As I mentioned above, those fields (AIM, Jabber and Yahoo/gTalk) were recently removed.
As noted in the ticket, First Name and Last Name are the two possible exceptions I see here.
That just leaves display name selection, nickname and website; email and password are configurable in BuddyPress and you already display username and bio on the profile when Extended Profiles are disabled. Why not allow the user to edit them too and add the remaining three fields? This would effectively move the profile to the front-end and nobody would need to configure their profile in two places again, which I think is the underlying issue here.
…it causes problems when other plugins add their own (hardcoded) fields, which BP won’t know about
I’m getting into deep water, but wouldn’t adding a hook before and/or after the fields be sufficient to deal with that?
May 6, 2014 at 1:56 pm #182550shanebp
ModeratorYou may be interested in this premium plugin which allows you to select which profile fields appear in the listing for members in a group:
May 6, 2014 at 12:11 pm #182543In reply to: WP profile fields not editable in BP profile
Boone Gorges
Keymaster> I can’t find any arguments for not including the WordPress profile in BuddyPress.
The arguments are:
– The fields at wp-admin/profile.php are hardcoded in WP. There’s no way we can ask WP which fields it provides in a programmatic way; we’d have to hardcode them as well. This is inelegant; it causes problems when other plugins add their own (hardcoded) fields, which BP won’t know about; and it will require keeping up with WP if they decide to switch which fields are included on that page.
– The fields at wp-admin/profile.php are very odd, and not appropriate for most BuddyPress installations (or most websites that were built after 2004 – who uses AIM, and who among them would want to store that information in their WP profile?)As noted in the ticket, First Name and Last Name are the two possible exceptions I see here.
May 5, 2014 at 12:00 am #182486In reply to: Can't locate registration page file
Joe LeBeau
ParticipantBuddypress really should have a character limit option for the profile fields and comments…
May 4, 2014 at 4:46 pm #182471In reply to: Text in fields linked – by design?
bp-help
Participant@sooskriszta
Sounds cool if there was a box or something beside each field in the dashboard/profile fields for admins to choose to be linkable. -
AuthorSearch Results