Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 801 through 825 (of 3,593 total)
  • Author
    Search Results
  • #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.

    #250447
    modemlooper
    Moderator

    BuddyPress search is not 100% accurate. Member search searches usernames and profile fields. Think of it more like a filter than search.

    #250338
    miguelcortereal
    Participant

    Issue solved.

    It was a function at child theme filtering one of the xprofile fields.

    Thanks a lot for your concern.

    #250283
    shanebp
    Moderator

    afaik, by default all profile fields are visible ( and editable ) by site admins.
    So there is no need for Visibility: Admins Only.
    Fields set to Visibility: Only Me will be visible to the member and site admins.

    #249918
    shanebp
    Moderator

    There are several multi-select fields available when you create a profile field.
    https://codex.buddypress.org/administrator-guide/extended-profiles/

    #249905
    johnywhy
    Participant
    #249904
    johnywhy
    Participant
    #249838
    shanebp
    Moderator

    I’ve added a group in BuddyPress profile panel…

    If you add / move that group into the Base (Primary) field group in wp-admin > Users > Profile Fields, then it will appear on the registration screen.

    #249742
    johnywhy
    Participant

    the basic php filter code was share with me, needed for this. Now i’m investigating how to put a ‘Rich Text’ checkbox on the fields editor.

    Feel free to help over here
    https://wordpress.org/support/topic/how-to-add-textarea-field-to-buddypress-xprofile-custom-fields-type

    thx!

    #249741
    johnywhy
    Participant

    thank you very much!

    your solution is slightly different from this other one, which helps me learn.
    https://wordpress.org/support/topic/how-to-add-textarea-field-to-buddypress-xprofile-custom-fields-type?replies=5#post-8009134

    thx!

    #249701
    johnywhy
    Participant

    note, i also edited the .po file, and generated a new .mo from that

    you can download my zip here:
    https://www.dropbox.com/s/nx0ox3weg5khlpi/buddypress-xprofile-custom-fields-type-JW-TEXTAREA.zip?dl=0

    i noticed modernizr.js mentions ‘textarea’. Not sure what it’s doing, but i don’t think this is the cause:
    ‘ var c = a.html5 || {},
    d = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
    e = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,
    f, g = “_html5shiv”,
    h = 0,
    i = {},
    j;
    (function() {
    try {
    var a = b.createElement(“a”);
    a.innerHTML = “<xyz></xyz>”, f = “hidden” in a, j = a.childNodes.length == 1 || function() {
    b.createElement(“a”);
    var a = b.createDocumentFragment();
    return typeof a.cloneNode == “undefined” || typeof a.createDocumentFragment == “undefined” || typeof a.createElement == “undefined”
    }()
    } catch (c) {
    f = !0, j = !0
    }’

    #249700
    johnywhy
    Participant

    hmm, ok, taking a different approach. i’m inspecting donmik’s files in ‘buddypress-xprofile-custom-fields-type’. Hope that’s ok, donmik!

    i found ‘datepicker’ in:

    bp-xprofile-custom-fields-type.php
    classes\Bxcft_Field_Type_Datepicker.php
    lang\buddypress-xprofile-custom-fields-type.pot
    lang\en_US.mo
    lang\en_US.po

    (ignoring the non-english files for the moment).

    i simply duplicated all the ‘datepicker’ code-chunks in these files, and replaced ‘datepicker’ with ‘textarea’.

    also duplicated the file ‘classes\Bxcft_Field_Type_Datepicker.php’, renamed it ‘Bxcft_Field_Type_Textarea.php’, and removed any date-specific code i found there.

    and so on and so forth.

    then i zipped it, uploaded to wordpress, activate, and added my new Textarea field to a form.

    i actually got no errors, and actually got a text field on my registration form!

    unfortunately, it’s only a one-line textbox, not a multiline textarea.

    hrm. In inspector, the displayed field is:

    <input type="string">

    so something in donmik’s code, or BP, or WP, is causing this to render as an <input> rather than <textarea>

    ….

    #249696
    johnywhy
    Participant

    thx for that! css will be our quick-and-dirty fallback. But not a long-term solution.

    it would be cool to develop a proper control. i’m guessing this is part of the recipe for displaying on the user-profile page:

    bp_profile_field_data()

    but would be awesome if someone can share the full recipe to develop a custom field.

    i’m looking here for clues-

    Profile Fields Loop

    and also searching the buddypress install for ‘multiselectbox’– just to see how that one gets handled 🙂

    thx!

    #249689
    calvin
    Participant

    After adding the fields you want using xprofile, go to your regi page. If you are using google chrome, right click on the multiline box and inspect

    you should find out the the id of the visual/text box something similar this ‘wp-field_664-editor-tools’ (yours should be a bit different cos field number is different)

    you should also find out the id of the mce panel using the same method

    After that you should be able to add the custom css to your theme stylesheet.
    Example (hiding the item using css):
    #wp-field_664-editor-tools {display:none;}

    You may need to double check on the edit profile page. if it still appears there, you can use the same method to hide it.
    Hope this helps.

    #249668
    johnywhy
    Participant

    hi, thx for reply.

    enter in user registration form, and display in user front-end profile.

    want to be able to use it like any other field in “user fields” editor.

    thx!

    #249651
    SuitePlugins
    Participant

    Greetings vendocartoni,

    Cimy User Extra Fields seem to serialize these entries in the database. I do not know of a tool to assist with the import but if you are familiar with coding you can use maybe_unserialize to unserialize the data to an array then create an update/insert function to store the information to BP Profile.

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