Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 426 through 450 (of 4,122 total)
  • Author
    Search Results
  • shanebp
    Moderator

    >… XProfile fields are not set when user profiles are created via import from Active Directory

    You will need to adjust the code that does the importing or contact the creators of that code and have them make the changes.

    warrencat
    Participant

    For Buddypress user profiles, we create user profiles in WordPress by syncing with Active Directory. This creates new WP user profiles and also syncs data over to BP XProfile fields.

    In configuring this process, I’ve learned that BP Visibility rules for XProfile fields are not set when user profiles are created via import from Active Directory; they are only set when an existing profile is manually edited and updated. Is there a way to fix or work around this, to get the Field Visibility rules applied to user profiles regardless of when/how the profiles are created (via import, etc.)?

    #306378
    Hustl
    Participant

    Hi,

    I have created a lot of additional profile fields for the members on my site and set up a members page with a search, but I was wondering if there were a way to create a multi-step search using the info from profile fields?

    So first step could e.g. be Male/female, the next step could be Mentor/Mentee, etc. and then after finishing the multistep search only the members that meet the criteria would be shown?

    This is the page: http://danwise.democrunch.dk/members/womens-network/

    Hope you can help thanks!

    salmansaleem920
    Participant

    Hi,
    I have a community site build on buddypress. So far, all is going good but now my client wants extended profile field (Surname of user) to be shown in place of default first and last name of user. How can i do this ? Please help

    HDcms
    Participant

    Hello,
    I have a site that no longer displays member profiles.
    I need to quickly migrate to a new site by exporting all buddypress members with xprofile fields.
    I found a paid pugin, but too expensive for an association or old plugins.
    Would you have a script to do this migration?
    Regards

    #306247

    In reply to: Profile Syncing

    shanebp
    Moderator

    The sync is only within the installation. No outside data is involved.
    It syncs some fields from the WP users table and the BP xprofile fields table – mainly the name fields.
    See this file for more details: buddypress\bp-xprofile\bp-xprofile-functions.php

    warrencat
    Participant

    I finally have a follow up on this issue.

    I’ve been in touch with the NADI Plugin Developer about the “Only Me” fields being visible to anyone viewing a user’s profile page. After explaining the issue and providing some of our user data to them, this was their reply:

    The source of this issue resides in buddypress/bp-xprofile/bp-xprofile-functions.php :: bp_xprofile_get_fields_by_visibility_levels(): If the user or administrator has not explicitly saved a profile, the wp_usermeta attribute “bp_xprofile_visibility_levels” is empty. This is the case after a NADI import of a new or already existing user happens.

    With the attribute ‘bp_xprofile_visibility_levels‘ being empty, the default visibility an administrator has configured won’t get applied.

    These are my argument why BuddyPress should apply the attached fix:

    1. From a developer point of view, it is not intuitive that the default visibility settings are not applied if the user’s profile has not been previously saved.
    2. From an administrator’s point of view, the current solution allocates unnecessary hard disk space. My integration database contains 10.000 user, which is a realistic user base size for the NADI plug-in. Alone for the unnecessary default visibility settings around 4 Mbyte have to be allocated. To be fair, NADI also uses duplicate data to work with BuddyPress.

    From my point of view as a NADI developer:

    1. Importing 10.000 users already takes a long time. Explicitly calling BuddyPress’ save methods would result in additional SQL queries which I would like to avoid
    2. bp_xprofile_get_fields_by_visibility_levels is not a hook, so I can’t apply the patch in our plug-in

    They are recommending this issue be addressed in the core BuddyPress files, specifically in the bp-xprofile-functions.php file. They provided me with a file containing proposed code changes, though this modified file with an attempt to fix did not specifically for me in my environment. I’m not sure how to provide it to you for your consideration/review since there is no attachment facility on this forum.

    csiworkforce
    Participant

    Hi ,
    I’m sure this is a simple fix but I’ve spent too much time on this issue that I’m ready to un install BuddyPress.
    When a user logs in and select “View profile”, the page is bank. I does not display the user profile. When the selects edits it displays all fields correctly. Please note that I’ve integrated BuddyPress with s2 members. Basically, the user is allowed to edit profile but not view only…weird.
    I can modify the code if only I know when it need to be done.
    Thanks

    Venutius
    Moderator

    Hi there, if you look in Profile Fields you will see it is showing the default profile group called Main, this is the registration profile group and all profile fields you add to it will be included in the registration form. You can create other profile groups and place your fields in there.

    NaRanJiTo
    Participant

    Hi,
    I want a tab in user profile where the user is able to fill some fields.

    I used “BuddyPress Xprofile Custom Field Types” to create that fields. But that fields appears in register page, so the registration is with many extra fields (awful).

    I don’t want these fields to appear when an user wants to create an account, i want these extra fields i created appearing only in user profile, and then the user can fill there instead registration form.

    Is this possible? If so, what i have to do?

    Thanks so much in advance!

    kjhjkhjk
    Participant

    Hi

    Is there a way (plugin or code) to limit the length of xprofile fields to a specific amount of characters?
    Or better, what’s above + like a left character countdown.

    Thanks

    I read that post before where they posted a link with a possible solution, but now the link it’s down…Anyone pls tell me a solution…

    I have been hours searching for a solution…

    https://buddypress.org/support/topic/how-to-limit-length-of-a-xprofile-field/

    #305947
    btees
    Participant

    Got it sorted.

    I set up a new search-form.php in my child theme:

    <div class="<?php bp_nouveau_search_container_class(); ?> bp-search" data-bp-search="<?php bp_nouveau_search_object_data_attr() ;?>">
    <form action="" method="get" class="bp-dir-search-form" id="<?php bp_nouveau_search_selector_id( 'search-form' ); ?>">
    <select onchange="this.form.submit()" id="<?php bp_nouveau_search_selector_id( 'search' ); ?>" name="<?php bp_nouveau_search_selector_name(); ?>">
    		  <option value="" disabled selected>Filter by Industry</option>
    		  <option value="">All</option>
      <?php  $result = $wpdb->get_results ( "SELECT * FROM wp_bp_xprofile_fields WHERE id='2'" );
      foreach ( $result as $print );
      $options = $wpdb->get_results ( "SELECT * FROM wp_bp_xprofile_fields WHERE parent_id='$print->id'" );
          foreach ( $options as $option )   { ;?>
        	
        <option class="<?php echo $option->name;?>" name ="field_<?php echo $print->id;?>_match_any[]"value="<?php echo $option->name;?>"><?php echo $option->name;?></option>
              <?php } ;?> 
    		</select>
    </form>
    </div>
    

    And then Ravi over at BuddyDev figured out how to change what the search applies to:

    // Activity Search by Category
    
    function buddydev_filter_activities_query_args( $r ) {
    
    	$searched_category = empty( $r[ 'search_terms' ] ) ? false : $r[ 'search_terms' ];
    
    	if ( ! $searched_category ) {
    		return $r;
    	}
    
    	$r['search_terms'] = false;
    
    	if ( empty( $r['meta_query'] ) ) {
    		$r['meta_query'] = array(
    			array(
    				'key'     => 'bpcat',
    				'value'   => $searched_category,
    			)
    		);
    	} else {
    		array_push( $r['meta_query'], array(
    			'key'     => 'bpcat',
    			'value'   => $searched_category,
    		) );
    	}
    
    	return $r;
    }
    add_filter( 'bp_after_has_activities_parse_args', 'buddydev_filter_activities_query_args' );
    fatboyslim1
    Participant

    I have used this code here:

    https://codex.buddypress.org/developer/loops-reference/the-members-loop/

    and I want to filter users by certain criteria. The example for the bp-custom page is:

    function my_custom_ids( $field_name, $field_value = '' ) {
    
      if ( empty( $field_name ) )
        return '';
    
      global $wpdb;
    
      $field_id = xprofile_get_field_id_from_name( $field_name ); 
    
      if ( !empty( $field_id ) ) 
        $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id;
      else
       return '';
    
      if ( $field_value != '' ) 
        $query .= " AND value LIKE '%" . $field_value . "%'";
          /* 
          LIKE is slow. If you're sure the value has not been serialized, you can do this:
          $query .= " AND value = '" . $field_value . "'";
          */
    
      $custom_ids = $wpdb->get_col( $query );
    
      if ( !empty( $custom_ids ) ) {
        // convert the array to a csv string
        $custom_ids_str = 'include=' . implode(",", $custom_ids);
        return $custom_ids_str;
      }
      else
       return '';
    
    }

    Example Usage: Get all members who have filled out the xprofile field ‘dogs’ and selected the value ‘poodles’.

    <?php if ( bp_has_members( my_custom_ids( 'dogs', 'poodles' ) ) ) : ?>

    How do I add more conditions to the dogs/poodles. What If I also want ‘birds’, ‘parrot’ as well as ‘dogs’, ‘poodles’ ?

    #305839
    btees
    Participant

    I’ve added a category option to activity updates using the following code:

    // Add Cat to Buddypress Activity Updates 
    
    function my_custom_activity_meta_stuff( $content, $user_id, $activity_id ) {
    	bp_activity_update_meta( $activity_id, 'bpcat', $_POST['bpcat'] );
    }
    add_action( 'bp_activity_posted_update', 'my_custom_activity_meta_stuff', 10, 3 );
    
    function add_bpcat_form_func(){
      global $wpdb;
      $result = $wpdb->get_results ( "SELECT * FROM wp_bp_xprofile_fields WHERE id='2'" );
        foreach ( $result as $print )   { ;?>
    	<div class="bpcat <?php echo $print->id;?>">
    		In Search Of: <select name="bpcat" id="bpcat">
    		  <option value="" disabled selected>Optional</option>
      <?php $options = $wpdb->get_results ( "SELECT * FROM wp_bp_xprofile_fields WHERE parent_id='$print->id'" );
          foreach ( $options as $option )   { ;?>
        	
        <option class="<?php echo $option->name;?>" name ="field_<?php echo $print->id;?>_match_any[]"value="<?php echo $option->name;?>"><?php echo $option->name;?></option>
              <?php } ;?> 
    		</select>
    	</div>
     <?php }
    } ; ?>
    <?php
    add_action('bp_activity_post_form_options', 'add_bpcat_form_func');

    What I’d like now is to be able to either filter the sitewide activity feed by category or include the activity metas in what is search by /common/search/search-form.php

    warrencat
    Participant

    Thank you for the suggestion. Here is what I did, as well as the results.

    All of the current extended profile fields were data being synced using the NADI add-on. I created a new text field to test with in the Base (Primary) field group and configured it the same: Required, “Only Me” visibility and Enforce field visibility selected. I edited an existing user profile, added some text to this new field and saved the profile.

    I viewed the profile as an admin and could see both fields – the original and the new test field – that should be hidden. All good there. I switched to a subscriber account and reloaded the profile and both the original and new test fields no longer displayed.

    This leads me to think there is an issue with the process of adding data to the extended BuddyPress profile fields using a sync process that somehow ignores the Field Visibility element, but that is corrected when the profile is manually updated.

    Regarding PHPMyAdmin, this site is installed on an internal company server and, as such, I don’t have PHPMyAdmin or any similar tool at my disposal to be able to easily look in on the database tables, unfortunately. But knowing which table has this data in it will be helpful as I work with my IT support on any further analysis/diagnosis.

    shanebp
    Moderator

    Do you have this issue for profile fields that you did create or populate with the NADI plugin?
    If not, use a database tool like phpmyadmin and check the visibility settings for that field id – those settings are in the _bp_xprofile_meta table.

    warrencat
    Participant

    In the extended profile fields, I’ve created a field that automatically pulls in data using the process described further below. This field is required and is located in the Base (Primary) group of profile fields.

    The issue I’ve run into is that I’ve configured the field to be visible to “Only Me” and have selected the option to Enforce field visibility, but when I look at the public-facing profile page, this field is still visible to any other logged in user, regardless of role. (I have confirmed this by logging in with a subscriber level account and viewing the profile page.)

    The profile fields data import process:

    I am using the NADI plugin (https://active-directory-wp.com/) to automatically create and sync users and user data from company Active Directory database. This plugin has an add-on tool that will subsequently sync selected data from the user WordPress profile over to the BuddyPress profile.

    Troubleshooting steps I’ve already completed:

    1. I’ve deactivated all plugins other than BuddyPress; the “Only Me” profile is still visible on the public-facing user profile page for any logged in user. It doesn’t appear to be caused by a plugin conflict.
    2. I’ve changed to a default WordPress bundled theme; again, the “Only Me” profile is still visible on the public-facing user profile page for any logged in user. It doesn’t appear to be caused by a theme conflict.

    WP Version: 5.2
    BP Version: 4.3.0
    NADI Plugin Version: 2.1.9 (Up to date)
    NADI Add-on Version: 1.0.4 (Up to date)

    I hope I’ve provided enough information. I’m struggling to determine why this profile field that should only be visible to the person who is logged in and no else is visible to every user. I also hope someone here might have a suggestion or recommendation for what I might try next.

    Thanks.

    #305767
    bdd
    Participant

    I’d like to take the URL entered in an Xprofile field and display it on another page using a different Xprofile field as the link text (instead of using the URL entered in the the Xprofile field as both the link text and the destination).

    So as an example, the Xprofile fields are Blog Name and Blog Address. On the profile, the Blog Name is plain text, and the Blog Address is a URL. When I display it on the other page, I want the Blog Name field to show up as the link text, and then the link’s destination will be the Blog Address field.

    I’m able to grab and display both Xprofile fields as is, but the URL field is coming through as the full link (with link text and address).

    How do I convert that URL Xprofile field to text? Or split it up somehow so I’m just getting the address part?

    #305763
    bdd
    Participant

    Thanks again. I’ll try that.

    I’ve been making some progress and getting closer. Created a new template with a copy of the member directory code, then started manipulating that.

    Tried using what’s in the “Filtering by Xprofile fields” section here to guide me:
    https://codex.buddypress.org/developer/loops-reference/the-members-loop/

    Right now I have a few errors, but I also see a link to just the one member that has a blog field filled in. (Long way to go, but feels like I’m getting to the right track.)

    #305753
    Venutius
    Moderator

    Sorry I don’t.

    The code to get the xprofile field data for a member is as follows:

    $field_data = xprofile_get_field( $field_id, $user_id, true );
    $field_value = $value->data->value;

    One thing you could do as a first step is to add these fields to the standard members loop:

    add_action( 'bp_directory_members_item', 'bpex_add_profile_field_data' );
    
    function bpex_add_profile_field_data() {
        $field_data = xprofile_get_field( $field_id, bp_member_user_id(), true );
        $field_value = $value->data->value;
        
        echo '<span>' . $field_value . '</span>';
    }

    You’d need to supply the $field_id for this to work.

    That would obviously add this data to all the members directory view which may not be what you want but it’s a start.

    #305749
    Venutius
    Moderator

    One option would be to setup a members list and filter the members based on if they have certain profile fields set then display the extra profile fields in the loop.

    #305747
    Venutius
    Moderator

    I’ve created a group member list shortcode in the same plugin that allows extra profile fields to be displayed as part of a group member list, don’t suppose all the members you want to display belong to the same group?

    #305734
    Venutius
    Moderator

    You can add shortcodes to display the members profile fields and links to profile using BP Profile Shortcodes Extra. I don’t think you can set a condition that if one profile field is filled in then so should the other one by default but you could write some code to carry out that check an reject the change if the appropriate field is not filled in.

    #305718
    bdd
    Participant

    I would like to ask members for Blog Name and Blog Address (URL) in their profiles, and then if they fill in those fields, I’d like to display that info on a Member Blogs list on a separate page.

    Is there a way to do this?

    Wishlist:
    1. Ideally, I’d like to require both Blog Name and Blog Address if one or the other is filled in.
    2. I’d like to display the username (linked to the member’s profile) along with the linked blog name.

    Thanks.

    #305682
    allnamestaken
    Participant

    1)How would I go about group name/members to show username | age | location
    I have added those fields in user profile.

    2)Would I be able to have age displayed as number instead of date?

Viewing 25 results - 426 through 450 (of 4,122 total)
Skip to toolbar