Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,051 through 1,075 (of 3,593 total)
  • Author
    Search Results
  • #230718
    danbp
    Participant

    Hi @amic58, @tecca

    When BP is installed and xProfile is activated, the original WP profile settings are not accessible to user.

    The WP register process use only username, password and email and BuddyPress add by default a Name field as base for other extended profile fields.

    In short this means that username and name fields can contain a same information(a name, a pseudonym, a first or/and a last name). The plugin you mention is best for a WP install where user had choosen first/last name as output on post, comments, etc Once BP is activated, this became a little different.

    Now to the initial question.
    The CSS trick is a very inelegant solution as it lets everybody knowing how BP works to surround this invisibility. You’re also loosing any flexibility if you want to show some fields privately for example.

    You can do this properly with a little snippet, as explained here:

    Using bp_parse_args() to filter BuddyPress template loops

    Here’s an example which let you hide fields or fiels group to members, but not to site admin

    function bpfr_hide_profile_field_group( $retval ) {
    	if ( bp_is_active( 'xprofile' ) ) :	
    	
    	// hide profile group/field to all except admin	
    	if ( !is_super_admin() ) {		
    		//exlude fields, separated by comma
    		$retval['exclude_fields'] = '1';  
    		//exlude groups, separated by comma
    		$retval['exclude_groups'] = '1'; 			
    	} 
    	return $retval;		
    	
    	endif;
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );

    Add it to bp-custom.php or your child-theme functions.php

    Of course you can also choose to show a field or group, but remove the possibility for the user to edit it later. Simply add more conditionnal to the function.

    Here another example:

    function bpfr_hide_profile_edit( $retval ) {	
    	// remove field from edit tab
    	if(  bp_is_user_profile_edit() ) {		
    		$retval['exclude_fields'] = '54'; // ID's separated by comma
    	}	
    	// allow field on register page
    	if ( bp_is_register_page() ) {
    		$retval['include_fields'] = '54'; // ID's separated by comma
    		}		
    	
    	// hide the field on profile view tab
    	if ( $data = bp_get_profile_field_data( 'field=54' ) ) : 
    		$retval['exclude_fields'] = '54'; // ID's separated by comma	
    	endif;	
    	
    	return $retval;	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );

    Hope to be clear.

    #230708
    Amic58
    Participant

    Thank you very much! I was looking for the fix for so long, but I never found one, didn’t know it was that easy.
    Also, if it is possible to hide another ‘Base’ name fields.
    In extended profile, there is a similar function like in Profile page.
    On WordPress Dashboard, when you click Profile, there is a possibility to view Extended profile like on the page before. There is also possibility to change the name.
    I also would like to hide the field Name (required), as I don’t want to push people to use their real names.
    I use the plugin called Usernames only that eliminates possibility to use real names, but the problem is that people won’t like to add their real name during registration.

    #230638
    danbp
    Participant

    Add this snippet to your child-theme functions.php or bp-custom.php

    function bpfr_hide_profile_edit( $retval ) {	
    	// remove field from edit tab
    	if(  bp_is_profile_edit() ) {		
    		$retval['exclude_fields'] = '2'; // field ID's separated by comma
    	}	
    	// allow field on register page
    	if ( bp_is_register_page() ) {
    		$retval['include_fields'] = '2'; // field ID's separated by comma
    		}		
    	
    	// hide the field on profile view tab
    	if ( $data = bp_get_profile_field_data( 'field=2' ) ) : 
    		$retval['exclude_fields'] = '2'; // field ID's separated by comma	
    	endif;	
    	
    	return $retval;	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );
    #230605
    shanebp
    Moderator
    shanebp
    Moderator

    Read this for a better approach to your issue: Filtering by Xprofile fields

    Another approach: bp_user_query

    #230192
    Cartographer
    Participant

    Is there any way to make the icons following the privacy rules of the related profile fields?

    #230168
    Cartographer
    Participant

    Hi @danbp

    I tried the way you suggested and it works.

    I would like to ask if there is any way the social media icons to follow the privacy rules of the related custom profile fields.

    Thank you!

    #229862
    Brent Havill
    Participant

    Hi Henry

    I went to ‘plugins’/buddypress/settings, and found the following (I note that “account settings” is not ticked – could this be it?)
    I have bolded the ones that are ticked currently.

    Settings:

    Component Description
    Component Description
    Extended Profiles Customize your community with fully editable profile fields that allow your users to describe themselves.
    Account Settings Allow your users to modify their account and notification settings directly from within their profiles.
    Friend Connections Let your users make connections so they can track the activity of others and focus on the people they care about the most.
    Private Messaging Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.
    Activity Streams Global, personal, and group activity streams with threaded commenting, direct posting, favoriting, and @mentions, all with full RSS feed and email notification support.
    Notifications Notify members of relevant activity with a toolbar bubble and/or via email, and allow them to customize their notification settings.
    User Groups Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.
    Site Tracking Record activity for new posts and comments from your site.
    BuddyPress Core It‘s what makes time travel BuddyPress possible!
    Community Members Everything in a BuddyPress community revolves around its members.

    danbp
    Participant

    hi franklinkevin321,

    I have disabled all of my xprofile plugins

    For our understanding, can you tell which plugins you’re speaking about ?
    The snippet is intended for BP, so if you use another source to generate your profile fields, it maybe possible that it screws your template.

    Niels Pilon
    Participant

    Nope, it returns an error that there are no members to display. I guess that I could replace ‘Robin van Persie’ with something blank like this

    substr( strstr( ' ', ' ' ), 1 )

    Just to clarify, this is the full code in my functions.php to sort the members:

     function alphabetize_by_last_name( $bp_user_query ) {
        if ( 'alphabetical' == $bp_user_query->query_vars['type'] )
            $bp_user_query->uid_clauses['orderby'] = "ORDER BY substring_index(u.display_name, ' ', -1)";
    }
    add_action ( 'bp_pre_user_query', 'alphabetize_by_last_name' );
     
    // To reflect the alphabetical sorting of the member directory, you
    // could also format the names to show the last name first. Here is
    // a helper function to format names as follows: Last, First Middle
    // Etc.
    //
    // To use this function every time a user's name is shown or queried,
    // simply add it as a filter:
    //
    // <code>add_filter ('bp_get_member_name', 'format_last_name_first' );</code>
    //
    // To only reformat the name in the member directory, change your
    // members/members-loop.php file in your (child)theme. Look for
    // <code>bp_member_name()</code>
    // and replace it with
    // <code>echo format_last_name_first ( bp_get_member_name() );</code>
     
    /**
     * Helper function for formatting a name: Last, First Middle Etc.
     *
     * @param string $name
     * @return string Formatted name
    **/
    
    function format_last_name_first( $name ) {
        if ( $first_space = strrpos( $name, " ") )
            $name = substr( $name, $first_space + 1 ) . ", " . substr( $name, 0, $first_space );
        return $name;
    }
     
    // BONUS: To make alphabetical sorting the default sorting, use the
    // function below. 
    //
    // In order for this to work properly, <code><option value=&quot;alphabetical&quot;></code>
    // must be the first option for the members-order-select in
    // members/index.php.
     
    function sort_members_alphabetically( $qs = '', $object = false ) {
        if( $object != 'members' ) //for members only
            return $qs;
     
        if ( empty( $qs ) || ! strpos( $qs, "type=" ) ) {
            $args = wp_parse_args($qs);
            $args['type'] = 'alphabetical';
            $args['action'] = 'alphabetical';
     
            $qs = build_query( $args );
        }
     
        return $qs;
    }
    add_action( 'bp_ajax_querystring', 'sort_members_alphabetically', 11, 2 );

    I guess that members are sorted by the default WordPress first and last name fields right? Just because we’ve added some custom fields to the member profile pages to split their names in first name, ‘surname prefix (it’s for words like ‘van’ ‘de’) and last name. Not all members have a surname prefix though.

    #229232
    wrify
    Participant

    Has anyone found a solution to this?

    Basically is as follows:

    Profile fields > Base (Primary) > Category

    Then, field type is a drop down with options

    I just need to list those options in a frontend page, click on it and get the members for that option.

    #229207
    shanebp
    Moderator

    Re: 2. Importing s2member custom fields to buddypress fields
    Instead of, for now, editing the codex page, please note the args parameter for add_action.

    So the ‘2’ here is the arguments parameter. add_action('wp_login','s2_profile_field_update',10,2);
    So the hook provides 2 arguments – very handy & useful.
    But your example doesn’t use them in the function s2_profile_field_update.
    You can use the $user arg instead of $current_user and thereby get rid of that global.
    Use this to see the data in $user:

    function hook_arg_display( $user_login, $user ) { 
       var_dump( $user ); 
    }
    add_action('wp_login','hook_arg_display',10,2);

    imo: There is no Option 1.

    #229144
    Hugo Ashmore
    Participant

    @myg0t Thanks for sharing that with the community, S2 Member has wide use so this ought to be useful to people.

    One point though it’s best not to advise that people edit a core file /buddypress/bp-templates/bp-legacy/..etc BP has a fairly well defined template hierarchy overload allowing files to be copied to the theme or child theme, those are the copies one should edit.

    Another minor point rather than have to edit & pass the arguments in the template could bp_parse_args() perhaps work for this?
    Using bp_parse_args() to filter BuddyPress template loops

    In respect of the profile data would not setting the user visibility options on the profile field/s in the backend not work to provide the privacy for address fields, just a thought but I may have missed the point of this aspect.

    Lastly this could make a nice user example guide for the BP codex if you’d care to post it there and we’ll slot it under a section appropriate.

    #228183
    Tanner Moushey
    Participant

    Hey @qmai! I have setup a system before to link BuddyPress Profile Fields to SalesForce, but it takes a good amount of custom work. The method I ended up doing was to add a piece of custom meta to the Profile Field edit screen that allows you to specify a SF field id. Unfortunately, the process of adding custom meta to a BuddyPress Profile Field is a lot harder than it sounds, but it is doable.

    Let me know if you have any further questions. I can’t seem to find the code that I wrote for this, but I’d be happy to work through this with you.

    #227975
    shanebp
    Moderator

    I believe it only runs when a profile is updated.
    Try doing a ‘save’ on a BP profile – edit screen.

    If it works, at least you know the sync is working going forward.

    That doesn’t address your real issue re all your existing users.
    You’ll probably need to write some code that loops thru your users and creates xprofile fields for them.

    Take a look at function xprofile_set_field_data in
    bp-xprofile/bp-xprofile-functions.php

    #227970
    Emineminero
    Participant

    @shanebp yes, its enabled but nothing happens.
    The filled fields on WordPress profile arent showing on buddypress profiles :/

    #227729

    In reply to: Separate Business User

    Henry Wright
    Moderator

    Hi @navinachettri

    1. Have you searched the plugin directory?
    2. This can be done via hooks. It will need some custom code (not much, just a few lines).
    3. You could hide or show xProfile fields according to role. How exactly roles are created and managed will be dependent on point 1
    4. Again, to distinguish business users from ‘normal’ users, you’d use the roles created via the plugin you’re using from point 1. The jobs and adverts could each have their own custom post type
    5. This will need to be custom coded

    Hope that helps?

    #225864

    In reply to: Members Directory

    Chrisw83
    Participant

    For anyone looking. Here is an update.

    1) I have created a page and called it, Homeowners Directory. In buddypress I have selected this page to show the members directory Buddypress -> Pages -> Members. How do I change the title of this page from Members to something else?

    /wp-content/plugins/buddypress/bp-members/bp-members-loader.php

    ‘directory_title’ => _x( ‘Members’, ‘component directory title’, ‘buddypress’ ),

    Change Members to what you need.

    2) Currently on the Members Directory the members Name is shown, how do I add other profile fields here?
    (Note, I am using s2member)

    Add the following code below “><?php bp_member_name(); ?><br />

    Change street_address to your s2member profile ID.

    <?php
    $id400 = bp_get_member_user_id();
    $fields = get_s2member_custom_fields($id400);
    echo $fields[“street_address”][“user_value”];
    ?>

    /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php

    4) When you click on and view someones profile, what file do I need to edit to add a Return button to go back to the members directory?

    /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php

    #225229
    danbp
    Participant

    hi @kristinrutten,

    have you imported users from an older wp site ?
    Are you hosted on wpengine ? (toc toc @hnla ? )

    Try to use the repair tool: dashboard > tools

    What about avatar settings ? dashboard > general > discussion

    About plugins
    buddypress toolbar was intended for 1.5/1.6/1.7 – outdated now.
    BuddyPress Members Import did you use it more as 1 time ?
    On a default install, WP and BP users are in the same table: wp_users
    In BP settings you can sync WP and BP users. Extended profile fields are stored in 4 other tables: _xprofile_somename
    And WP has is own import tools…
    IMO you can deactivate them.

    Deactivate all plugins, but BP and activate 2013 theme. At this stage the avatars should appear.

    #223908

    In reply to: Members Directory

    danbp
    Participant

    1) https://codex.buddypress.org/getting-started/configure-components/

    2) https://codex.buddypress.org/buddypress-components-and-features/extended-profiles/edit-xprofiles-admin-screen/

    https://codex.buddypress.org/getting-started/guides/displaying-extended-profile-fields-on-member-profiles/

    3) is built in on members directory. Each profile item becames clickable by default, letting users find others having entered the same information.
    Example:
    User A = City -> New York (NY is clickable)
    User B = City -> New York (NY is clickable)
    User C = City -> San Francisco (SF is clickable)

    When user B click on NY he will see user A as search result
    When user C click on SF he will only see himself

    4) He use the buddy menu. This menu can be installed by going to dashboard > apparence > menu. If BP menu is not in the left side, under the other menus, open the screen option (top right corner) and check BuddyPress. Now you can set your BP menu like any other WordPress menu.
    https://codex.wordpress.org/WordPress_Menu_User_Guide

    When you’re new to something, you must read the documentation first. Also before asking on a help forum, you must search if your question wasn’t already asked and answered.

    Happy install ! 😉

    #223419
    ericreynolds007
    Participant

    Thank you. I was able to move the code below in the edit.php file. However, I could only place it below the field input or above the field label. I cannot position it between the field label and the field input.

    <div class="clear"></div>
    
    <?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' );
    ?>
    				
    <p class="description"><?php bp_the_profile_field_description(); ?></p>
    
    <?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>
    danbp
    Participant

    hi @roddaut,

    don’t thought to much, a theme can influence over all a site, including the admin. This happens in 90% of the issues handled on this forum.

    Thought the latest Canvas was 2014.10.14 – version 5.8.5

    #220263
    TAC28
    Participant

    Thanks again 🙂

    I know how to edit the Profile Fields now.

    I have changed the wording in the register.php file and just want to know where to upload it so the changes will show up?

    #220262
    danbp
    Participant

    Members are the heart of BuddyPress. When a user register on a BP activated site, this user is automatically a “member”.

    So i guess “they are not registering for the site, just the members area” is just impossible. Don’t know what you already did to get a “private” member area, but if you have an issue, it’s mostly because you did something wrong. 😉

    To confirm to readers what you already get to work:

    To modify the registration page, on which appears the login fields belonging to WP (user, username, email & password), BP adds his own additionnal fields, under condition you activated the xProfile component.

    By default, BP add only one field in the mandatory field group “Base”: NAME.

    When the admin add a new field, he can choose between different field status, and depending this status, you will see phrase such as “This field can be seen by: “.

    These settings are avaible in Dashboard > Users > Profile Fields

    #220260
    TAC28
    Participant

    Hi and thank you danbp,

    I have read the documentation but not the codex yet.

    I also had read that article on the modifying the registration page but I can’t see anything relating to changing the text on the live registration page. I don’t want it to say “Registering for this site is easy….” because they are not registering for the site, just the members area. I have changed the text in the register.php file but wherever I upload it to the changes do not show up.

    It did help me find the setting in Profile Fields to change the “This field can be seen by: Everyone” text to “This field can be seen by: All Members” 🙂

Viewing 25 results - 1,051 through 1,075 (of 3,593 total)
Skip to toolbar