Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 801 through 825 (of 3,608 total)
  • Author
    Search Results
  • #252863
    gregsee
    Participant

    Hi Modemlooper, thank you, I did manage to work it out. Problem partly due to my WP theme has a social counter plugin that provides a stack of fields for links that I assumed were part of the WP or BP basic profile fields. I have set up some of my new xProfiles fields now and have it working – just need to organise these for groups better.
    Thanks

    modemlooper
    Moderator

    You can update a field with this function

    xprofile_set_field_data( $field, $user_id, $value, $is_required = false )
    
    $fields = field id
    $user_id = current login user id
    $value = inserted value
    $is_required = boolean

    Hook your function to

    do_action( 'bp_core_activated_user', $user_id, $key, $user )

    modemlooper
    Moderator

    BuddyPress users are the same as WordPress so you can create a user using https://codex.wordpress.org/Function_Reference/wp_create_user

    To set profile fields data:

    xprofile_set_field_data( $field, $user_id, $value, $is_required = false )
    
    $fields = field id
    
    $user_id = current login user id
    
    $value = inserted value
    
    $is_required = boolean
    #252857
    modemlooper
    Moderator

    BuddyPress searches username and profile fields to find a member. You would need to develop a custom solution for this. Is this requirement for site admins? If so, you can find members by id in the admin -> Users menu item.

    #252856
    modemlooper
    Moderator

    Any profile fields you create in the admin that are in the first section are automatically added to the registration form.

    User Extended Profiles

    #252794
    mairaj
    Participant

    Ok thank you! I was by the way referring to the custom xprofile fields that I have on my current site (the multisite one that I have now).

    I assume when I import the back up database file to the new site those custom xprofile fields would be created automatically.

    #252786
    mairaj
    Participant

    Thank you for the reply 🙂 Since you have suggested to export TABLES OF WP_xprofile, I believe I don’t need to create any xprofile fields in the new installation.

    #252630
    Henry Wright
    Moderator

    This doesn’t happen for me. When I set the page “Register” to a static front page, I can still see custom profile fields in the sign up form. Can you post some details about your set up?

    • Theme
    • Plugins active
    • Do you use custom code snippets in bp-custom.php or functions.php?
    • etc
    #252259
    ngoegan
    Participant

    I still can’t get it to work. I do have header images enabled so I edited this file:

    buddypress\bp-templates\bp-legacy\buddypress\members\single\cover-image-header.php

    as follows:

    <?php
    
    				 /**
    				  * Fires after the group header actions section.
    				  *
    				  * If you'd like to show specific profile fields here use:
    				  * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
    				  *
    				  * @since 1.2.0
    				  */
    		
    
    bp_member_profile_data( 'field=city' );
    bp_member_profile_data( 'field=state' );
    
    		 do_action( 'bp_profile_header_meta' );
    
    				 ?>
    
    			</div>
    #252254
    ngoegan
    Participant

    I tried this and it isn’t showing up on profile pages:

    <?php do_action( 'bp_member_header_actions' ); ?>
    
    		</div><!-- #item-buttons -->
    
    		<?php
    		/***
    		 * If you'd like to show specific profile fields here use:
    		 * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
    		 */
    
    bp_member_profile_data( 'field=city' );
    bp_member_profile_data( 'field=state' );
    
    		 do_action( 'bp_profile_header_meta' );
    
    		 ?>
    
    #252253
    ngoegan
    Participant

    I’m sorry, but where exactly in that code would I enter that? Like this?

    <?php
    /***
    * If you’d like to show specific profile fields here use:
    * bp_member_profile_data( ‘field=About Me’ ); — Pass the name of the field
    */
    do_action( ‘bp_profile_header_meta’ );

    bp_member_profile_data( ‘field=City’ );
    bp_member_profile_data( ‘field=State’ );

    ?>

    #252252
    shanebp
    Moderator

    You have identified the correct code location:

    Assuming your field names are City and State, try:

    bp_member_profile_data( 'field=City' );
    bp_member_profile_data( 'field=State' );

    If you need to do some formatting or add text or check for empty fields, use:

    $city = bp_get_member_profile_data( 'field=City' );
    echo $city;
    #252205
    concoa
    Participant

    UPDATE:
    I deleted all BP files and the plugin and did a reinstall.

    PROBLEM #1)
    I am still having trouble with the Register page. I do not know what this error refers to:

    displays an error message:
    “Profile Details
    Warning: Creating default object from empty value in /home/content/p3pnexwpnas09_data01/28/2853428/html/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php on line 649”

    Line 649 is:
    $fields[ $key ]->visibility_level = $field_visibility;

    PROBLEM #2)
    Registration submission is now working, but an auto response email is being sent. Is there something in BuddyPress (or WordPress) to disable this? I’m getting an email saying:
    Hi test4,
    Thanks for registering!

    To complete the activation of your account, go to the following link: http://blahblahblah.com/activate/ef23a0f24958c3a125917f7e3bac95f8/

    I’m using s2Member to allow admin approval of registrations. This email needs to be removed. Thx.

    #252077
    Ike Ten
    Participant

    Hi @ch1n3s3b0y @jokyfoot @ksimpson1986 @ksimpson1986 ,

    I think I found something something close.

    A free plugin called ‘Conditional Profile Fields for BuddyPress’ on buddydev.com/
    It allows you to set conditions for profile field so each user has a different set of fields based on their previous answer or input.

    Plugin Link: http://buddydev.com/plugins/conditional-profile-fields-for-buddypress/

    It does it by hiding or showing fields based on specific answer given. The great thing here is that you now have to use just one dynamic registration form for all user types or groups.

    Use this tutorial for a better understanding how the plugin works http://wptavern.com/new-plugin-adds-conditional-profile-fields-to-buddypress/

    I hope it helps.

    #251970
    valuser
    Participant

    The second ask — i can’t usefully contribute!

    for the first ask

    Assuming your new user fills in her/his profile fields on registration

    Something like the following MIGHT work.

    On FIRST login a user is redirected to say .$user -> user_login.’/profile/change-avatar/’;

    then add something like this to the functions.php file of your theme

    function alaiam(){
    
    global $current_user, $wpdb, $bp;
    
    get_currentuserinfo();
    
    $user_id = get_current_user_id();
    
    $firstname = xprofile_get_field_data( "First Name" ,$user_id);
    update_user_meta( $user_id, 'first_name', $firstname);
    
    $lastname = xprofile_get_field_data( "Last Name" ,$user_id);
    update_user_meta( $user_id, 'last_name',$lastname);
    
    $gender= xprofile_get_field_data( "Gender" ,$user_id);
    update_user_meta( $user_id, 'gender',$gender);
    
    $xdob= xprofile_get_field_data( "Date of Birth" ,$user_id);
    update_user_meta( $user_id, 'dob',$xdob);
    
    /*and so on.........*/
    
    add_action('bp_before_profile_avatar_upload_content', 'alaiam', 10, 0);
    #251941
    DrHariri
    Participant

    Thanks for your response @henrywright.

    That’s a very good suggestion. I actually had no idea that was possible.

    So you are saying I can disable the profile/Xprofile fields and create my own BP plugin component to act as a profile tab? If yes, this is good news for me!

    Thanks!

    #251774
    allisonnance
    Participant

    How would this stop custom profile fields from site A showing up on site B? For example, on one site we have a field where the user puts their annual company revenue. We don’t want this to show on the other site/s. We need other questions. I’ve attached a screen shot.
    profile screenshot

    #251768
    allisonnance
    Participant

    That could work for some but each site is pulling the same custom user profile fields. Each site needs different fields.

    #251584
    @mcuk
    Participant

    Hi,

    If you’re referring to the profile page of a member, the function <?php bp_user_firstname(); ?> may work for you. Just add it into the file creating the page title within the H1 tags.

    Or if you created profile fields in your WP Dashboard > Users > Profile field, then another option might be to use: <?php bp_member_profile_data ( 'field=First Name' ); ?>. Change the First Name text to whatever you called the field for the user’s first name.

    #251532
    jrytesting
    Participant

    Hello, I had this same problem and this is how I fixed it. It was mentioned in this thread
    (https://buddypress.org/support/topic/bad-link-to-profile-edit/)
    that there may be a problem in the database table “wp_bp_xprofile_groups”. For some reason the first item id there is not “1” but something else. As you change the id to 1, everything works. Then it also shows the Profile details side Name field (required) in the registration page.

    Also there was a problem to edit profile, it went to “Page not found”. This gets fixed also now, now you can edit the fields.

    This seems to be some kind of bug in the installing process in some circumstances. I tested this by removing the BuddyPress and also deleting the BuddyPress database tables. They must be deleted manually, they wont get out by deleting the plugin.

    New installation put the first id number to “3” to “wp_bp_xprofile_groups” table. Even the group_id in the table “wp_bp_xprofile_fields” was “1” (after I activated some components in BuddyPress menu, before that the tables were empty) for the first field item. So now the field item and the group item never matched.

    Hopefully this helps someone. It seems that there are a lot of discussion of this problem, and this is a very annoying problem if you are really using BuddyPress.

    Basically the registering had a workaround for example by using plugin “Theme my login”. The registering also looks simpler as there is not that “extra” name field. It is however unknown how BuddyPress works without that name field. Well, but perhaps that is an another story.

    #251231
    richdal
    Participant

    Thanks! I was able to copy that to my child theme

    /wp-content/themes/genbu-child/buddypress/members/single/profile/edit.php

    and can do some basic edits. Not familliar with making these types of changes but how would I change up some of the form field information. As an example I wanted to add some description text next to the 3 date fields for the Birth Date. If looked like those were getting generated here…

    
    <?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();
    

    but not sure how to change those up.

    #250847
    johnywhy
    Participant

    i checked here, but not sure if answers my question:

    Profile Fields Loop

    shanebp
    Moderator

    Did you create the phone & address fields via wp-admin > Users > Profile Fields?

    BP stores profile data in a table called {your table prefix as set in wp-config}_bp_xprofile_data.
    So you need to write those fields to that table.

    Unless somebody here has used Form Maker, it is doubtful that you will get a detailed answer.

    #250714
    shanebp
    Moderator

    Please use the code button when sharing code.

    The fields field_id and field_value do not exist in the function you are attempting to filter.
    See this for accepted fields:
    https://buddypress.trac.wordpress.org/browser/tags/2.2.1/src/bp-members/bp-members-template.php#L453

    I think you want this field retval['include'].

    Something like:

    function see_woman_gender( $retval ) {
    	global $wpdb;
    
    	$field_id = 3;
    	$field_value = 'Woman';
    	
    	$query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id . ' AND field_value = ' . $field_value;
    
    	$woman_ids = $wpdb->get_col( $query );
      
    	if ( !empty( $woman_ids ) ) 
    		$retval['include'] = $woman_ids;
    
    	return $retval;
    }
    add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );

    There are field re meta data; I don’t think they work with profile data.
    But you could try this and let us know if it works:

    function see_woman_gender( $retval ) {
         $retval['meta_key'] = '3';
         $retval['meta_value'] = 'Woman';
     
        return $retval;
    }
    add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );
    #250589
    shanebp
    Moderator

    You’ll need to be able to write and debug code.

    You can create a template overload of this file:
    buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.php

    Set a variable with the current user role. Google how to get that value.

    Then create an array of profile field ids for a role.
    For example :

    if ( $current_role == 'model' )
        $show_fields = array( 1, 5, 23 ); 
    elseif( $current_role == 'photographer' ) 
        $show_fields = array( 1, 7, 12, 35 );

    Then check if the current profile field is in that array.
    Something like:

    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    
    	<?php if ( in_array( bp_get_the_profile_field_id(), $show_fields ) ) : ?>
    	
    		<?php if ( bp_field_has_data() ) : ?>
    	
    			<tr<?php bp_field_css_class(); ?>>
    	
    				<td class="label"><?php bp_the_profile_field_name(); ?></td>
    	
    				<td class="data"><?php bp_the_profile_field_value(); ?></td>
    	
    			</tr>
    	
    		<?php endif; ?>
    		
    	<?php endif; ?>

    Avoid setting any fields to ‘required’ if you’re only going to show them based on role.

Viewing 25 results - 801 through 825 (of 3,608 total)
Skip to toolbar