Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1 through 25 (of 4,145 total)
  • Author
    Search Results
  • #235369
    Profile photo of car1979
    car1979
    Participant

    Hi everyone!

    I have a custom field in the registration page asking the new user to give us his/her ideas of what’s on their mind about a personal project so we can help him/her make it possible.

    The thing is that I need that custom field to be part of the notification email that the admins recieves whenever somone registers.

    I tried to follow the instructions given here:

    https://buddypress.org/support/topic/using-xprofile-fields-in-notification-mail/

    But I’m not sure whre to put this code. In the functions.php? Is that code right?

    Thaks ahead!

    Profile photo of tipsy
    tipsy
    Participant

    Hey, I’m kinda stuck for a day now got a tips to check the database, but can’t find any solution.

    I use this to get a avatar:
    <?php echo get_avatar(1); ?>

    Then I use this to get the name:

    <?php 
    	$user_id = 1;
    	$key = 'first_name';
    	$single = true;
    	$user_first = get_user_meta( $user_id, $key, $single ); 
    	echo '<span>' . '' . $user_first . '</span>'; 
    ?>

    This above works great but when I now have created “profile fields” with BuddyPress in the user area I trying to do the same thing but can’t get the right result out of it.

    <?php 
    	$bp_get_member_user_id = 1;
    	$key = 'field_2';
    	$single = true;
    	$user_last = bp_get_user_meta( $bp_get_member_user_id, $key, $single ); 
    	echo '<span>' . '' . $user_last . '</span>';  
      ?>

    In this code above I have found that the field has the name field_2, but this aint right? If I change it to first_name it generate the first_name How can I find the real field name?

    Profile photo of AfromanJ
    AfromanJ
    Participant

    Basically Ive been asked to fix this field problem on someone elses website, Ive just been given access to FTP so can now make changes to the server files.

    They are using a theme called Huddle and have BuddyPress install on the latest version:

    http://themeforest.net/item/huddle-wordpress-buddypress-community-theme/835549

    The theme folder has a members folder in for BuddyPress, which i assumed was the standard for BuddyPress. I have overridden the templates you suggested in /themes/huddle/members/single and the issue is still present.

    I switched to a default WordPress theme to test compatibility and the fields are working like normal. So the issues is with the Huddle theme, now that its using the correct profile-loop and edit templates im not sure what the problem can be?

    Profile photo of Hugo
    Hugo
    Moderator

    Those two fields do work fine, I suspect that you are working with an older version of the view & edit templates? The manner in which xprofile fields are looped to be displayed changed so you will need to grab latest versions of these templates from the bp-legacy directory in the core plugin.

    Profile photo of AfromanJ
    AfromanJ
    Participant

    I am trying to add a new xProfile field to be displayed on the user profile pages.

    The two that are not working are URL and Number fields.

    When clicking on profile > edit I can see the HTML is not correct and the new field has not been rendered. This is what the html looks like:

    <div class="editfield field_9 field_facebook optional-field visibility-public field_type_url"><p class="description"></p></div>

    All the other fields are working and have been tested.
    – What am I doing wrong?
    – Is there a work around?

    #234912
    Profile photo of Outdoorsmen
    Outdoorsmen
    Participant

    There was an interesting article on wpmudev.org that shows how to add the profile fields and a few other tricks. The hardest part was determining the exact location for the data.

    Thanks for your help.

    #234906
    Profile photo of danbp
    danbp
    Moderator

    Bumping after 20mn is a bit abused, no ?

    If you use BP, you can edit, add or remove custom profile fields if you activate the extended profile component.

    To add an external plugin to the user profile edit, try to add it to the profile template.
    Or modify the plugin so he use BP specific templates.

    https://codex.buddypress.org/plugindev/

    https://codex.buddypress.org/developer/add-meta-box-to-admin-extended-user-profile/

    and much more to read on codex and forum.

    #234894
    Profile photo of amitjethva16
    amitjethva16
    Participant

    I want to edit other external fields but those are update but I want to include that page in user profile edit page

    I am using other plugin for add more field for user .. I am using pi-register but I want include pi-register page into buddypress user profile page -> edit

    How it is possible..?

    #234895
    Profile photo of amitjethva16
    amitjethva16
    Participant

    I want to edit other external fields but those are update but I want to include that page in user profile edit page

    I am using other plugin for add more field for user .. I am using pi-register but I want include pi-register page into buddypress user profile page -> edit

    How it is possible..?

    #234830
    Profile photo of shanebp
    shanebp
    Moderator

    This works for me. It’s basically just a cleaner version of what eberger3 did.
    You’ll have to hack the ‘where’ clauses if you want to include search terms.

    function add_sortby_price() { 
    ?>
    	<option value="price">Price</option>
    <?php
    }
    add_action( 'bp_members_directory_order_options', 'add_sortby_price' );
    
    function users_sortby_price( $object ) {
        global $wpdb, $bp;	
    	
        // Only run this if price option is selected
        if ( ! in_array( $object->query_vars['type'], array( 'price' ) ) ) 
    	return;
    	
    
        $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $object->query_vars['type'] ) );
    		
         $object->uid_name = 'user_id';
         $object->uid_table = $bp->profile->table_name_data;
         $object->uid_clauses['select']  = "SELECT u.{$object->uid_name} as id FROM {$object->uid_table} u";
         $object->uid_clauses['where'] = " WHERE " . $wpdb->prepare( "u.field_id = %d", $field_id ); 
         $object->uid_clauses['orderby'] = "ORDER BY u.value";
         $object->uid_clauses['order']   = "ASC";		
    		
    }
    add_action( 'bp_pre_user_query', 'users_sortby_price' );
    #234792
    Profile photo of danbp
    danbp
    Moderator

    BuddyPress was made to extend WP standart profile fields. Normally you haven’t to use WP’s profile fields (aim, jabber, bio, etc) I you need a bio you recreate one.

    The only required fields for profiles at the registering level are 4 by WP (username, email, password & pwd confirm) and the Base (field group) Name field which is added by BuddyPress.

    If you use bbpres as standalone forum aside BP, you can syncing with wordpress

    #234772
    Profile photo of Matthias70
    Matthias70
    Participant

    Did not find a solution to work it out with the standard wordpress fields.
    The only way to go around this problem, was setting up xprofile fields…

    Profile photo of --Q--Shadows
    –Q–Shadows
    Participant

    I am using mycred on my website and would like to display users rank with logo in the users profile area. I know the shortcode for displaying the rank with image is –

    echo do_shortcode( ‘[mycred_my_rank show_title=”1″ show_logo=”1″ user_id= ” bp_displayed_user_id();'”] );

    The issue I am facing is how do it put this shortcode in the profile area of members without changing the core files.

    Would really appreciate if anyone could provide some help on this.

    Cheers :)

    #234714
    Profile photo of friloo
    friloo
    Participant

    Hello,

    sry for my bad english but i am from Germany.
    I use WordPress 4.1 and Buddypress 2.2.1….

    Now i want to enable HTML for profile fields, because the user want to iframe some soundcloud players. i know it’s a problem fpr security, but thats no problem because only 10 users are allowed tu have a profile.

    i’ve tried to enable html for this fields on this way in the bp-custom.php but i only geht a white site.

    function stuff_i_want_triggered_after_bp_loads(){
    
    remove_filter( 'xprofile_get_field_data', 'wp_filter_kses', 1 );
    
    }
    
    add_action('wp', 'stuff_i_want_triggered_after_bp_loads');

    any idea what i can try now? I really want to enable html.

    kind regards
    friloo

    #234700
    Profile photo of Matthias70
    Matthias70
    Participant

    I think @azinfiro had the same problems a few month ago.
    Seems it is the normal buddypress behavior, not to show the wordpress fields

    https://buddypress.org/support/topic/wp-profile-fields-not-editable-in-bp-profile/

    This is a bit strange, cause I can change the wordpress fields in bbpress but not in buddypress?!?!
    Makes no sense to me!

    Thanks
    Matthias

    #234693
    Profile photo of shanebp
    shanebp
    Moderator

    You don’t need to touch any core files to add an Order By.

    Example for adding a Contributor option, put in bp-custom.php or theme/functions.php

    // add order options to members loop
    function ch_member_order_options() {
    ?>
       <option value="contributing"><?php _e( 'Contributing Members', 'buddypress' ); ?></option>
    <?php
    }
    add_action( 'bp_members_directory_order_options', 'ch_member_order_options' );
    
    // filter ajax members by contributing
    function ch_filter_ajax_querystring( $querystring = '', $object = '' ) {
    
    	if( $object != 'members' )
    		return $querystring;
    
    	$defaults = array(
    		'type'            => 'active',
    		'action'          => 'active',
    		'scope'           => 'all',
    		'page'            => 1,
    		'user_id'         => 0,
    		'search_terms'    => '',
    		'exclude'         => false,
    	);
    
    	$ch_querystring = wp_parse_args( $querystring, $defaults );
    
    	if( $ch_querystring['type'] == 'contributing' ) {
    	
    // to get members by xprofile field, you need some custom sql here
    // here's an example: 
    //https://codex.buddypress.org/developer/loops-reference/the-members-loop/#code-examples
    
    		$users = get_users( array( 'fields' => array( 'ID' ), 'role' => 'contributor' ) );
    		
    		$users_str = '';
    		foreach ( $users as $user ) {
    	             $users_str .=  $user->ID . ',';
    	        }
    		$users_str = rtrim($users_str, ",");
    
    		$ch_querystring['include'] = $users_str; 
    		$ch_querystring['type'] = 'alphabetical'; 
    		
    		return $ch_querystring;
    		
    	}	
    	
    	else
    		return $querystring;
    			
    }
    add_filter( 'bp_ajax_querystring', 'ch_filter_ajax_querystring', 20, 2 );
    Profile photo of MattPurland
    MattPurland
    Participant

    Warning in advance: I rarely, if ever, use WP – so please bare with me, and I apologise if any of my terminology is way off base!

    I’m using BuddyPress Profile Search (BPS) for member searches and the initial search form I’ve created works as expected, but when using AJAX to get more results a specific BP filter (bp_pre_user_query_construct) that needs to run is missing. This filter is used to run a function that modifies the BP_User_Query object by adding IDs to ‘include’, based on the BPS form fields.

    When I say ‘missing’, I mean it’s not part of the $wp_filters array when do_action_ref_array is executed to trigger the filter (line 171 of bp-core-classes.php). I found this when debugging the do_action_ref_array function, if I debug the code at line 556 (the if statement that locates the filter in $wp_filters) it returns due to not being found, and so isn’t executed.

    I really hope that makes sense to someone. I’m not sure why this specific filter is missing, as it seems the rest do exist (or a lot of them do).

    Any help would be appreciated!

    #234672
    Profile photo of mikewelsh
    mikewelsh
    Participant

    I am using the SweetSate theme, a dating/matching theme which is built on Buddypress.

    Instead of people searching for people with profile fields, I want to match people with universities/colleges.

    I have my colleges entered in through my admin.

    I want students to register on the site but I do not want them visible to anybody else.

    I only want the universities/colleges to be visible.

    How can I do this?

    In the search box for University Locations I can have Medchool – UK or Medschool – Overseas, but it also includes a null/blank field. I want blank fields in all the other search fields but not this one. If all the fields are blank it finds and displays all members.

    Site can be seen here: http://hotzoc.com/medical-schools/

    I have colleges registered as site role contributors and site users who sign up as subscribers.

    Is there any way I can restrict the search only to my ‘contributors’ group not the ‘subscribers’ group?

    I want users registered if possible so I can contact them and monitor their profile preferences. I cannot do this if I do not allow registration and just have my colleges as the only registered users.

    Any ideas or help greatly appreciated.

    #234671
    Profile photo of Matthias70
    Matthias70
    Participant

    hi @danbp,
    I’m using the plugin version of bbpress. And it’s running fine.
    I can edit all fields from the backend in the frontend, too under

    http://exampample.com/forums/users/USER/edit

    In buddypress I can access the users profile and I can set the password and the email notifications
    BUT
    there is no way to change the “public name” and the “website field” oder the “biographical info”
    For editing this, the user has to go to the backend!!!

    Thanks
    Matthias

    #234660
    Profile photo of peter-hamilton
    peter-hamilton
    Participant

    hi aymanomar

    you should look into this plugin

    profile widgets

    It allows images/video/music displayed in a widget on profile pages, then add a few xprofile fields to your profiles and it should be possible.

    I added a few fields to show gaming on my profiles

    #234581
    Profile photo of tascam424
    tascam424
    Participant

    Hi folks, this is my first post here, so please forgive me if i am posting in the wrong place. I was just wondering if there is a plugin in existence for filtering members on Custom Fields.

    So for example in a Dating Site environment to search for

    Females, Min Age 25, Max Age 30, Min Height 5ft etc etc

    In this case i would have set the above as custom profile fields.

    If such a plugin doesn’t exist, could anybody please point me in the direction of creating some of the functionality.

    Greatly appreciate any help you may be able to offer.

    #234575
    Profile photo of danbp
    danbp
    Moderator

    Hi @myg0t,

    you do it wrong. WP auto embeds youtube videos automagically (and over 40 other online video providers). In a post or topic or mention, simply copy/paste the video URL, and it’s done.

    xprofile use a form with different fields. Because these fields are striped for security reason (classic form security), you can’t embed videos like previously described.

    But there is a URL field type ?
    Yes, this let you enter a video url, but the field will render the URL, not the embed action. It’s a form field and it’s striped.

    So what ?
    We will use a normal text field, and will only enter an alpha numeric value.

    How can i do this ?

    As example, we gona use this video https://www.youtube.com/watch?v=TZPN9g2pmPQ

    And to show the video on a profile, we’ll use only the doc ID: TZPN9g2pmPQ

    By entering this kind of text in a profile field, it is not striped and will be handled like an ordinary text field and throwed to DB with his filed ID and field value.

    To embed the video, we also have to add what WP does on a blog, but not on xprofile page, an iframe to control the video output, so it can be streamed correctly and be read by browsers.

    Now we first create a new field and name it Spotlight (or what ever). No matter where, you can use the Base group or any other custom group.
    We select the field type and give it a single text area type.
    Save.

    We go on a profile to modify it and enter TZPN9g2pmPQ in regard of Spotlight.
    Save.

    And voilĂ  ! The video is correctly embeded and displayed.

    As usual for customisation, we’ll use a snippet which we put into bp-custom.php

    function set_video_field( $field_value ) {
    	$bp_this_field_name = bp_get_the_profile_field_name();
    	// field name (case sensitive)
    	if( $bp_this_field_name == 'Spotlight' ) {
    		$field_value = strip_tags( $field_value );
            // building the HTML and h/w of the iframe
    		$field_value = '<iframe width="420" height="315" src="http://www.youtube.com/embed/'.$field_value.'" frameborder="0" allowfullscreen></iframe>';
    	}
    	return $field_value;
    }
    add_filter( 'bp_get_the_profile_field_value','set_video_field');

    Caution: do not remove the iframe, or video won’t work.

    Hope this help.

    #234572
    Profile photo of Myg0t
    Myg0t
    Participant

    Hi there guys. I posted about this a few months ago, but the topic was closed, so i’ll have to create a new one.

    I had gotten quite a few helpful responses but wasn’t able to get it working. Decided to take another look at it and i’ve gotten it sort-of working…

    So…

    In my plugins/bp-custom.php i’ve got the line

    add_filter('bp_get_the_profile_field_value','wp_oembed_get');

    this works, but only partially. It allows the video to be embeded into the Spotlight field; but at the same time strips away all the text from the other fields. So it seems that the filter is attempted to embed all the fields.

    As a remedy, i’m working with this code that was suggested to me:

    function bp_youtube_in_profile(){
    add_filter('bp_get_the_profile_field_value','bp_enable_youtube_in_profile',9,3);
    }
    add_action('bp_init','bp_youtube_in_profile',0);
    
    function bp_enable_youtube_in_profile($val,$type,$key){
    $field = new BP_XProfile_Field($key);
    $field_name = $field->name;
    $val = strip_tags($val);
    if(strtolower($field_name) == 'Spotlight'){
    return wp_oembed_get($val,array('width'=>300));
    }
    return $val;
    }

    but this particular bit of code doesn’t want to work. Does the code look right to you guys?

    Can someone explain to me how $val,$type, and $key in function bp_enable_youtube_in_profile($val,$type,$key) comes from?

    Thanks for all of yall’s support!
    M

    #234560
    Profile photo of nunolopes99
    nunolopes99
    Participant

    Hi,
    I’m trying to show all members filtered by a specific Xprofile Field. The field type, in this case, is a multiselectbox.

    I check the topic Members Loop and tried the following code:

    <?php if ( bp_has_members( my_custom_ids( 'name_of_the_multiselect_box' ) ) ) : ?>

    The code works fine in text fields but not multiselectboxe’s.

    Any help?

    Profile photo of ch1n3s3b0y
    ch1n3s3b0y
    Participant

    Hi

    I have noticed an issue for how I am trying to set up buddypress. The current setup is a profile ‘home page’ here /members/exampleuser and an actual profile page with profile fields here /members/exampleuser/profile. I want the profile that people see to appear at this URL /members/exampleuser. It is the reason I am having this problem…https://buddypress.org/support/topic/custom-profile-template-only-shows-in-exampleuserprofile-instead-of-exampleuser/

    So where should you actually be adding a custom profile. I’m sure there are lots of scenarios where people don’t want visitors to go through to a page and then have to click to go through to another page to view the profile.

Viewing 25 results - 1 through 25 (of 4,145 total)