Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 851 through 875 (of 3,608 total)
  • Author
    Search Results
  • #248982
    nickdanks
    Participant

    I thought this would be a buddy press question as the members relate to the plugin not users for our community website with custom profile fields.
    Thanks Nick

    #248850
    Slava Abakumov
    Moderator

    All fields that are in the first Base fields groups will appear on registration page.
    So you can just move those fields to another fields group, that you can create on this page /wp-admin/users.php?page=bp-profile-setup using this link http://cosydale.com/wp-admin/users.php?page=bp-profile-setup&mode=add_group.

    Another option

    Find the ID of a field that you want to hide in admin area (when you edit the field it’s in the URL like this /wp-admin/users.php?page=bp-profile-setup&group_id=1&field_id=2&mode=edit_field = field_id=2 is what you need), make sure that this field is NOT required, then open style.css of your theme and add there something like this:
    #profile-details-section.register-section .editfield.field_2 {display:none}
    For reference: http://take.ms/lONUD

    #248809
    Hastig
    Participant

    I’m probably misunderstanding the question but for the first part (“List each field where I want”) are you trying to control the order the fields appear to a user on this page?

    your.website/members/admin/profile/edit/group/1/

    If so, have you already tried reordering them in admin panel -> users -> profile fields ?

    #248807
    Hastig
    Participant

    This plugin may be of help to you..

    https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/

    This plugin add more fields type to Buddypress extension: Xprofile. The fields type added are: Birthdate.. Image.. Number within min/max values..

    #248409

    In reply to: Members – Masonry

    Hastig
    Participant

    without seeing your css i can give you an ugly, possible solution..

    (please backup that file before attempting the change)

    delete

    <div class=”profile_fields”><?php bp_member_profile_data(‘field=Organizational Name’); ?></div>

    replace

    <div class=”item-title”>
    <?php bp_get_member_name(); ?>
    </div>

    with

    <div class=”item-title”>
    <?php bp_get_member_name(); ?>
    <div style="display: block;"><?php bp_member_profile_data(‘field=Organizational Name’); ?></div>
    </div>

    you may want to change style="display: block;" to class="whateverName" and edit from your style sheet.

    #248408

    In reply to: Members – Masonry

    kmw1130
    Participant

    Here is my code. It is on the Members Page
    if ( function_exists(‘bp_is_active’) ) {
    if ( bp_has_members( $params ) ){
    ob_start();
    echo ‘<div class=”wpb_wrapper”>’;
    echo ‘<div id=”members-dir-list” class=”members dir-list”>’;
    echo ‘<ul id=”members-list” class=”item-list row kleo-isotope masonry ‘.$class.'”>’;
    while( bp_members() ) : bp_the_member();
    echo ‘<li class=”kleo-masonry-item”>’
    .'<div class=”member-inner-list animated animate-when-almost-visible bottom-to-top”>’
    .'<div class=”item-avatar ‘.$rounded.'”>’
    .’‘. bp_get_member_avatar() . kleo_get_img_overlay() . ‘‘;
    if ($online == ‘show’) {
    echo kleo_get_online_status(bp_get_member_user_id());
    }
    echo ‘</div>’
    .'<div class=”item”>
    <div class=”item-title”>’
    .’‘. bp_get_member_name() . ‘
    </div>
    <div class=”profile_fields”>’.bp_member_profile_data( ‘field=Organizational Name’ ).'</div>’;
    ‘<div class=”item-meta”><span class=”activity”>’.bp_get_member_last_active().'</span></div>’;

    if ( bp_get_member_latest_update() ) {
    echo ‘<span class=”update”> ‘. bp_get_member_latest_update().'</span>’;
    }

    do_action( ‘bp_directory_members_item’ ); echo ‘</div>’;
    echo ‘<div class=”action”>’;
    do_action( ‘bp_directory_members_actions’ );
    echo ‘</div>’;
    echo ‘</div><!–end member-inner-list–>
    ‘;
    endwhile;
    echo ‘‘;
    echo ‘</div>’;
    echo ‘</div>’;
    $output = ob_get_clean();
    }`
    }
    else
    {
    $output = __(“This shortcode must have Buddypress installed to work.”,”k-elements”);
    }

    #248267
    Xtremefaith
    Participant

    So does this mean you cannot use standard WordPress First & Last name fields, that if I want them accessible on their profile I have to use the xprofile component? Seems either redundant to keep them in both or a waste to not use the WP standard fields.

    Is there not an easy easy way to modify the profile form to make standard fields visible and editable?

    #248245
    shanebp
    Moderator

    I’m not aware of a plugin that does what you want.
    You might try https://wordpress.org/plugins/members-import/ as a starting place.
    You would need to modify the code to handle profile fields like postal codes.

    The search function would be separate.
    There are plugins that search profile fields, such as https://wordpress.org/plugins/bp-profile-search/

    #248077
    VersGemerkt
    Participant

    Jigesh,

    Thanks for the help! This is how it looks right now:

    Screenshot order.php

    As you can see to the right of the profile image their are some data showing from the custom fields. @mcUK and @shanebp helped me out achieving this. BUT, this is not the correct data it should be showing for this user… It shows data that the logged in user filled in.

    I logged in as the user that filled in the correct data, and then it’s showing the right data for the user. But this is because I’m logged in as that user…

    Screen

    NOTE: I’m transferring this data across two plugins: buddypress and learnpress. Just so you know!

    This is the php in bp-custom:

    <?php
    
    function bptest_show_a_field () {
    	$user_id = bp_loggedin_user_id();
    	$firstname = xprofile_get_field_data( 'First Name', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$lastname = xprofile_get_field_data( 'Last Name', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$birth = xprofile_get_field_data( 'Date of birth', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$education = xprofile_get_field_data( 'Highest Education Grade', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$profession = xprofile_get_field_data( 'Profession', bp_loggedin_user_id(), $multi_format = 'comma' );
     
    	if ( ! $firstname && ! $lastname && ! $birth && ! $education && ! $profession ) { 
    	   return; 
    	}   
    	else {
    	    echo 'Voornaam: ' . $firstname . '<br />' ; 
    	    echo 'Achternaam: ' . $lastname . '<br />' ; 
    	    echo 'Geboortedatum: ' . $birth . '<br />' ; 
    	    echo 'Hoogste graad: ' . $education . '<br />' ; 
    	    echo 'Beroep: ' . $profession . '<br />' ; 
            
    	}
    }
    
    add_action ( 'user_a_field', 'bptest_show_a_field' );
    ?>
     
    #248048
    @mcuk
    Participant

    Hi David,

    Copying the code method does work. (Renaming the function, the variables/fields within and the add_action bits).

    Just tried this out too and it appears to work fine, though not tested thoroughly so you’d need to double check:

    function bptest_show_a_field () {
    	$user_id = bp_loggedin_user_id();
    	$field_one = xprofile_get_field_data( 'Field One', bp_loggedin_user_id(), $multi_format = 'comma' );
    	$field_two = xprofile_get_field_data( 'Field Two', bp_loggedin_user_id(), $multi_format = 'comma' );
     
    	if ( ! $field_one && ! $field_two ) { 
    	   return; 
    	}   
    	else {
    	   echo $field_one ; 
    	   echo $field_two ; 
    	}
    }
    
    add_action ( 'user_a_field', 'bptest_show_a_field' );

    Then put do_action ( 'user_a_field' ); in your desired location.

    #248044
    VersGemerkt
    Participant

    Got one question now that I’m working with the provided code:

    Do you have tips for using this code for multiple custom fields? How should I edit this code in bp-custom.php if I want to add multiple custom fields?

    <?php
    
    function bptest_show_education_field () {
    	$user_id = bp_loggedin_user_id();
    	$education_field = xprofile_get_field_data( 'Highest Education Grade', bp_loggedin_user_id(), $multi_format = 'comma' );
    	if ( ! $education_field  ) { 
    	   return; 
    	}   
    	else {
            echo 'Hoogste opleiding: ' . $education_field . '<br />'; 
    	}
    }
    add_action ( 'user_education_field', 'bptest_show_education_field' );
    ?>

    I’m now trying to copy this code for every custom field, but that’s not really a clean way of doing this. And it’s not working either. Hope you can help me out with this one as well!

    #247957
    VersGemerkt
    Participant

    Hi mcUK!

    Thanks for you reply. I’m working with Lotte on this issue.

    I tried adding your code. Everything should be in place right now, but it’s still not showing the custom fields. I’m probably using the code wrong…

    I tested your code with a custom field ‘Opleiding’ which I added in WordPress: Users -> Profile fields:

    Screenshot with the custom field

    I added this to bp-custom.php:

    <?php
    
    function bptest_show_opleiding_field () {
    	$opleiding_field = bp_get_member_profile_data( 'field=Opleiding' ); 
    	if ( ! $opleiding_field  ) { 
    	   return; 
    	}   
    	else {
    	   echo '<span class="custom-field-text">' . $opleiding_field . '</span>'; 
    	}
    }
    
    add_action ( 'user_opleiding_field', 'bptest_show_opleiding_field' );
    ?>

    Then I added this to order.php (the php file where the custom field should pop-up):

     <div id="user-opleiding">
    	                           <?php 
    		                          do_action ( 'user_opleiding_field' ); 
    	                           ?>
                                 </div>

    What am I doing wrong? It’s probably a typo or a wrongly added term… But I can’t figure out what it is!

    Hope you can help us out! Thanks for the help so far!

    David

    #247920
    @mcuk
    Participant

    Hi,

    Not used LearnPress so unable to comment much on that . The method I used to insert/display my own custom profile fields into a header on the user activity page was as follows (in this case, a Location field which was created in the WP dashboard).

    1. Add to bp-custom.php :

    //Add Location field to header if user has entered data into it
    //Nothing is shown if user hasn't entered anything into field
    function bptest_show_location_field () {
    	$location_field = bp_get_member_profile_data( 'field=Location' ); 
    	if ( ! $location_field  ) { 
    	   return; 
    	}   
    	else {
    	   echo '<span class="custom-field-text">' . $location_field . '</span>'; 
    	}
    }
    //user_bio_location_field is used within the member-header php template file
    add_action ( 'user_location_field', 'bptest_show_location_field' );

    2. In my member-header.php file (which was copied into my child theme) entered the div :

    <div id="user-location">
    	<?php 
    		do_action ( 'user_location_field' ); 
    	?>
    </div><!-- #user-location - function is found in bp-custom -->

    Obviously the php code in step two is placed wherever you want the field to display, just put it in the correct location of the correct php file. In my case it was member-header.php but for you i’m guessing its the one that generates your order page?.

    Not sure if you have already tried any of that or if it even helps!

    #247908
    dlongm01
    Participant

    In fact I have found a reasonable solution using CSS. I found some key clues on in the support forum for this plugin: Buddypress Xprofile Custom Fields Type (though I’m not using that plugin).

    If anyone has any advice about how to improve this I would be glad to hear it. Thanks

    /* Buddypress profile field description position*/
    .editfield {
    position: relative;
    top: 5px;
    }
    .editfield label {
    font-weight:bold;
    margin-bottom: 30px;
    }
    .input field_4 {
    margin-top: 5px;
    }

    form.standard-form p.description {
    margin: 0 0 15px;
    position: absolute;
    top: 20px;
    line-height:1em;
    }

    #247832
    AdventureRidingNZ
    Participant

    Add me to the list. I want to be able to have a page with a members list which lists 6 xprofile fields if a particular one of those fields is populated.

    #247622

    In reply to: Repeating Group Tabs

    NickAcs
    Participant

    Just an additional note to this issue – each time I refresh/revisit Profile Fields in the backend, more “Social” and “CoverOptions” tabs are added. The list grows!

    George Notaras
    Participant

    @sbrajesh

    Hi Brajesh,

    Thank you very much for the insight. Your reply clarifies a lot of things for me. Really enlightening.

    I was planning to make my plugin able to understand the following field notation:

    
    some field name @ some field group
    

    for easier/friendlier association of xprofile fields to profile properties, for which the plugin can generate metadata.

    Now that I have this information, I’ll have to rethink about the implementation.

    Thanks again!

    Best Regards,
    George

    Brajesh Singh
    Participant

    Hi George,
    No, There is no API function to fetch field group id from field group name and you will need to write your own sql query for the purpose.

    Also, In your example you have passed the profile_group_id to the bp_get_profile_field_data. Please note, it does not take that as a valid argument. It only accepts user_id and field. group id is not required for fetching field data.

    Now, If we forget about the group name API and come to the original requirement, Do you plan to fetch the data for multiple users(In loop) or just once/twice.

    For fetching data, these two functions work

    You can either use

    
    $data = xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' )
    
    

    where $field is field id or name( If you know the id, It will fetch from any group, Name has the issue)

    or as you specified

    
    $data = bp_get_profile_field_data( array(
    	'user_id'	=> $user_id,
    	'field_id'	=> $field
    	
    ) );
    
    

    The xprofile data APIs do not allow passing group in general. You either pass a field id or name.

    The problem will happen when multiple fields have same name. In that case, the first field with the name matches if you use the above functions.

    Another point, In both the cases, There is no group arguement and if you use field name, that will need one extra query(field id should be preferred if the id is known).

    Honestly speaking, It is ok to use it one or 2 time on page but avoid using it inside the loop. If you plan to use it inside the loop, you should try to first fetch the xprofile data and cache and then use any of these functions. One way to cache will be by calling

    
    
    BP_XProfile_ProfileData::get_value_byid( $field_id, $user_ids )
    

    Where $field_id is the id of field(not name) and $user_ids is one or more user ids.

    Hope that helps.

    #247218
    ShMk
    Participant

    I know that Base group are shown in the Registration Form, but I have to add over 30 fields during registration so if they could be logically separated from the base group during registration and inside the user profile would be of great help for the customer.

    #247213
    @mercime
    Participant

    @shmk profile fields you add in the Base Field Group shows up in the Registration Form https://codex.buddypress.org/administrator-guide/extended-profiles/

    #247159
    Henry Wright
    Moderator

    Hi @koreancandy

    Looking at the Name and Location profile fields, they’re also linked? To remove these links, check out the bp-custom.php article.

    #246983
    ShaneValiant
    Participant

    @doublef

    Here is the latest error log:

    PHP message: WordPress database error Table ‘mysitename.wp_16_bp_xprofile_groups’ doesn’t exist for query SELECT DISTINCT g.id FROM wp_16_bp_xprofile_groups g WHERE g.id = 0 ORDER BY g.group_order ASC made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, bp_init, do_action(‘bp_init’), call_user_func_array, woffice_social_fields, xprofile_insert_field_group, BP_XProfile_Group->__construct, BP_XProfile_Group->populate, BP_XProfile_Group::get
    PHP message: WordPress database error Table ‘mysitename.wp_16_bp_xprofile_groups’ doesn’t exist for query INSERT INTO wp_16_bp_xprofile_groups (name, description, can_delete) VALUES (‘Social’, ”, 1) made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, bp_init, do_action(‘bp_init’), call_user_func_array, woffice_social_fields, xprofile_insert_field_group, BP_XProfile_Group->save
    PHP message: WordPress database error Table ‘mysitename.wp_16_bp_xprofile_groups’ doesn’t exist for query SELECT * FROM wp_16_bp_xprofile_groups WHERE name = ‘CoverOptions’; made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, bp_init, do_action(‘bp_init’), call_user_func_array, woffice_cover_add_field
    PHP message: WordPress database error Table ‘mysitename

    #246971
    shanebp
    Moderator

    Tricky task… I don’t envy your use case testing!

    BP uses the WP user – but stores profile data separately. But some fields are duplicated – like name.

    You may have to write profile data to both user meta and xprofile tables.
    And then use a conditional re whether the BP Extended Profiles component is enabled.
    If it isn’t, then pull from user meta, etc.

    More info:

    xprofile_sync_wp_profile() syncs Xprofile data (nickname, first name and last name) to the standard built in WordPress profile data.

    xprofile_sync_bp_profile() syncs the standard built in WordPress profile data to XProfile.

    #246858
    r-a-y
    Keymaster

    Are you using BuddyPress Multilingual as well?

    My guess is that BuddyPress has newer translation strings in v2.4.0 and you’ll need to update the BuddyPress-specific strings on your WPML install to reflect that.

    Read their “Translating profile fields” tutorial:

    BuddyPress Multilingual

    They also have a support forum here:
    https://wpml.org/forums/topic-tag/buddypress/

    It might be that their plugin will need to be updated.

    If it ends up that this is indeed a BuddyPress problem, please let us know.

    #246843
    doubleF
    Participant

    Hi @r-a-y,

    Here is the function :

    function woffice_birthdays_add_field() {
    	
    	if ( bp_is_active( 'xprofile' ) ){
    		global $bp;
    		global $wpdb;
    		// We check for multisite : 
    	    if (is_multisite() && is_main_site()) {
    		    $table_name = $wpdb->base_prefix .'bp_xprofile_fields';
    	    } else {
    	    	$table_name = $wpdb->prefix .'bp_xprofile_fields';
    	    }
    	    $sqlStr = "SELECT <code>id</code> FROM $table_name WHERE <code>name</code> = 'Birthday'";
    	    $field = $wpdb->get_results($sqlStr);
    	    if(count($field) > 0)
    	    {
    	        return;
    	    }
    		xprofile_insert_field(
    	        array (
    	        	'field_group_id'  => 1,
    	            'field_id' => 'woffice_birthday',
    				'can_delete' => true,
    				'type' => 'datebox',
    				'description' => __('We will only use it for the Birthday widget, so we can celebrate everyone\s birthday.','woffice'),
    				'name' => 'Birthday',
    				'field_order'     => 1,
    				'is_required'     => false,
    	        )
    	    );
    	 }
    	 
    }		
    add_action('bp_init', 'woffice_birthdays_add_field');

    I’m able to reproduce it so I’ll try to troubleshoot it now 😉 I keep you updated,

    2F

Viewing 25 results - 851 through 875 (of 3,608 total)
Skip to toolbar