Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,351 through 1,375 (of 5,755 total)
  • Author
    Search Results
  • #251812
    carson7634
    Participant

    Hello all,

    I’ve been creeping around these forums for a few days, but I’m unable to find a post that explains what I’m looking for in any decent detail.

    I’m trying to remove one of the xprofile fields from the edit page. My end goal is to limit what fields may be modified by the user, based on their membership level using s2membership. I feel if I can figure out how to hide one field, I’ll be able to go from there.

    Now I have found a few posts describing this same action, but the responses seem very vague. What I’ve been trying to do is modify the edit.php file in the “wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile” directory. I realize that modifying the core files is not the best practice, and this will be replaced with the next buddypress update, but I also have not found a detailed explanation on the proper way to edit these files, so I’m sticking with this for the moment just to see if I can get it working.

    I see there is a while loop in this file, and it looks like it iterates for each element in an array containing all of the profile fields. Each iteration grabs the fields type as a string, and compares it to a list of valid options. When a match is found, it performs some html/php magic, and adds a field on the screen to be modified. (php and html are new to me. I am familiar with c++, java, and c#)

    modified snippet from file:

    
    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>		
    
         <div<?php bp_field_css_class( 'editfield' ); ?>>
    
              <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
    
                  *html/php magic*
    
              <?php endif; ?>
         </div>
    
    <?php endwhile; ?>
    

    No matter what edits I make to this file, it does not seem to change anything.

    Any information would be great, and I appreciate your time. Thank you.

    #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.

    #251719
    richdal
    Participant

    Wordpress v4.4.2
    BuddyPress v2.5.1

    Trying to see if there’s a way to exclude the year from the birth date (datebox) field. Probably have some users that would be okay displaying the month and day information but may not want to share their age.

    I was able to find the “BuddyPress Xprofile Custom Fields Type” plugin, but ran into a problem with that. The edit form still loads the three fields for the month, day, and year and didn’t want the year to be a requirement.

    johnywhy
    Participant

    Hi,

    is there a way to display the unavailable profile fields on the Registration form?

    Such as profile photo and cover photo.

    We want to put ALL fields in the registration screen, instead of relying on users to go in and enter the other fields later.

    thx!

    #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.

    kendorama
    Participant

    I have a problem where only the “Administrator” permission is able to see user profile fields.

    Other users can see access the dashboard and even click on various links like “Profile > Edit” but it just directs them to a blank page inside my Theme. If I change that user to an Administrator they have no issues.

    Please help.

    marcus540
    Participant

    Hi, My buddypress search form is unusable on a mobile device, due to the multi-select ‘Checkbox’ fields in the search form displaying (0 selected) instead of the placeholder text title, which describes to the user, what it is they are mean’t to be selecting.

    All the other fields display their typical titles the same, as when it’s being viewed on a desktop. It’s only the checkbox fields that replace the title with (0 selected). How can I prevent this from happening, I can’t find the code responsible for doing this?

    I’ve located 2 older threads, where people have asked about this exact same issue and none of them received any information.

    #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.

    #251228
    richdal
    Participant

    WordPress 4.4.2
    BuddyPress 2.5.1

    Not sure how to change up the form where users would update their extended profile.

    I was able to setup a custom registration page by copying the source file to here and making my changes…

    /wp-content/themes/genbu-child/buddypress/members/register.php

    On the user Profile – Edit page I’m seeing the different fields I wanted to include, but wanted to add some extra description to the three birth date menus that show up. Is there a file similar to register.php I could copy to my child theme and fix up the HTML how I want it?

    #251206
    Kathy_Goss
    Participant

    We have a multisite where we provide templated blogs and also have Buddy Press for xProfile fields and to create a community site. We have latest WP and BP versions.

    When a new users logs into their own site and the first thing they want to do is update their profile picture / cover image, in order to actually go to their profile, they need to login again (actually the login is requiring 2 times). This creates a strange user experience. Is there a way to have a single login for the user at their own site and the buddypress community site so that they can freely go back and forth between them?

    AM77
    Participant

    I need to add some html attributes to some Xprofile fields such as max-length. I was trying to find a filter so I could use str_replace to add attributes, but I eventually found the filter bp_xprofile_field_edit_html_elements in bp-xprofile/classes/class-bp-xprofile-field-type.php.
    I’ve now got this code which works, but I’m not great with PHP so just checking if this is the best way to achieve this:

    function hp_xprofile_add_attributes($r){
    
    	$field_name = bp_get_the_profile_field_name();
    	
    	if( $field_name == 'Name' ) {
    
    		$new_attribute['maxlength']= '20';		 
    		$attributes = array_merge($new_attribute, $r);
    
    	} elseif( $field_name == 'Short Description') {
    
    		$new_attribute['maxlength']= '160';		 
    		$attributes = array_merge($new_attribute, $r);
    		
    	} else {
    		
    		$attributes = $r;
    	}
    		
        return $attributes;
    	
    }
    add_filter('bp_xprofile_field_edit_html_elements', 'hp_xprofile_add_attributes', 11);

    Any help appreciated.

    #250855
    Peatkay
    Participant

    Hi Would like to setup a page for our members that does the following:

    1) has a profile page for each member.
    2) each member can be sent an email with their log in details.
    3) has custom fields displaying the members position on a number of views on topics.
    4) member will be able to log in and change their views.
    5) members can not send messages to each other or edit any other content on the site – only their profiles.
    6) there would be pages where you could view all the members that have a particular view on a particular topic.
    7) you could search for members with particular views on topics

    Is buddy press capable of all of this?

    Many thanks

    #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.

    kieckhafer
    Participant

    Hi, I’m wondering if anyone has had success in creating a ‘Save and Next’ button on the BP custom profile fields. I currently have 7 tabs, instead of having a “Save” button, which just reloads the page, I’d like to have a “save and next” button that will save the current fields, and then go automatically to the next tab.

    #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' );
    #250627
    idoobi
    Participant

    This appears to be a bit of a problem here, as there are others wondering why this is not a core function.
    I am about to launch a forum for a school class. I need forum members to be able to see and recognise both the parent’s names and their child’s (it is not always obvious who sired which sprog).
    I have set up a Child field in the extended profile, but I need that to be immediately available and visible along with the parent’s name, i.e.
    Cuthbert Longstocking | Pippi Longstocking

    Any help out there (before BuddyPress improves itself)?

    The forum page is here: Forum

    And – BuddyPress – is there any way you could maybe get rid of the HTML formatting tags and display the text properly?!

    #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.

    #250588
    richdal
    Participant

    Using WordPress 4.4.2 and BuddyPress v2.5.0

    I had setup a child theme so I could make modifications to WordPress and BuddyPress without messing with the core program. I’m using the Genbu theme so based on the information here (https://buddypress.org/support/topic/register-php-3/) I copied

    Copied: /wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php

    Child theme: /wp-content/themes/genbu-child/buddypress/members/register.php

    I was able to modify parts of the form that were part of WordPress, but wasn’t seeing any HTML related to the BuddyPress profile fields. I dug around and found this BuddyPress file that would affect the profile form fields on the register page and user profile page.

    /wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php

    I can’t figure out how to get that working in my child theme though. What directory location am I suppose save to on my child theme? I tried setting it up here, but doesn’t look like it’s loading at all

    /wp-content/themes/genbu-child/buddypress/bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php

    snazzypack
    Participant

    I have a membership/social network website where users will have their own profile page that gives certain information about themselves.

    But I have different roles and I want each role’s profiles to say different things. For example, if a user is a model, I want to have profile fields related to their height, eye color etc. If a different user is a photographer, no-one needs to know about their height and body color, but instead things like what kinds of photography they do and maybe what kind of camera/equipment they use.

    How can I accomplish this?

    #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.

Viewing 25 results - 1,351 through 1,375 (of 5,755 total)
Skip to toolbar