Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,651 through 1,675 (of 5,755 total)
  • Author
    Search Results
  • CodeMonkeyBanana
    Participant

    I have deleted all field groups in admin panel and I am trying to add a new one with ID of 1.

    This is my code:

               $args = array(
                    'field_group_id' => 1,
                    'name'           => 'Base',
                    'description'    => 'These fields appear on your signup form',
                    'can_delete'     => true
                );
    
                $results = xprofile_insert_field_group($args);

    It ignores my specified ID and returns a different number. Anyone know why?

    #240114

    In reply to: Per-group Identity?

    Tony G
    Participant

    Well, group meta allows meta data to be applied to groups. I’m thinking along the lines of data in the usermeta table which is only consumed by specific groups. This might be expressed as a name/value pair in the profile. So with reference to my original example, a GroupName profile value would include:
    school:Robert
    home:Bobby
    coolGame:Zarcon

    The BuddyPress Profile Shortcodes plugin allows for custom fields and related shortcodes to be used. This is much closer to my needs but still not quite there. I can’t create a profile field for every possible group. Ideally there would be a pulldown of groups to which the user belongs, where they can enter the name they wish the use for that group, and the group/name pairs would be displayed in a grid.

    Now I’m thinking one of the better user meta plugins could handle that. But I would also need to customize it so that there can only be one WP user with a specific value for a specific group. This is a unique key per group, as some reference to @Bobby can’t apply to more than one person, but the @Bobby in one group can be different from @Bobby in another group.

    On the client side, I would then need to modify bbPress to get the user name that’s specifically for the current group, rather than using wp_get_current_user()->display_name or whatever it has there. For example:
    get_user_meta($user_id,’groupName_’.$group_id,true)
    or better
    get_user_meta($user_id,’groupNames’,false)[$group_id]

    Actually I’d rather abstract all requests for a user name to a function which can then be replaced with custom code just once. I don’t suppose anyone has already done that, or it’s been proposed as a BP/BBP enhancement?

    I’m a noob with coding into WP, haven’t touched BP/bbP, and know little about the APIs, so please bear with me on the syntax and other specifics and focus on the concepts. Thanks.

    The more I try to flesh it out above the more it seems possible for me to do this myself. But it would be really helpful if someone has already done it. Or if someone with knowledge in this area can see a more direct line from an exiting plugin to the solution I’m describing.

    Thanks for your time!!

    #240082
    johnegg
    Participant

    HI there

    Im want my users to be able to set “dates available” on their profiles. I tried using the date picker & date select profile fields but these do not allow date ranges, only 1 date.

    Also I need to allow the public to then search date ranges also & return results base don what users have set in their profiles.

    Is this possible? Any help much appreciated!

    John

    #240029
    shaquana_folks
    Participant

    My apologies @danbp I had a plugin called “BuddyPress xProfile Custom Fields Type” set up, that’s where the button came from. I just deactivated the plugin. But even when I still try to fill out the registration form, there’s no error that shows up this time, however, it takes me right back to that same registration page and it still did not create that new user for me. It would still just show up on the screen like this:

    New registration screenshot

    Any suggestions why this is still happening? Also, is there a good plugin that anyone can recommend for me to use so that when users create their profiles, they’ll be able to upload a profile picture?

    #239985
    CodeMonkeyBanana
    Participant

    I’ve been staring at the code for a while and it’s starting to make sense.

    I’m not great with databases but looking at the function I gather it changes a few fields into primary keys that point to the data table so fields can be individual.

    It runs the table modification code on the dbdelta_create_queries hook.

    The wordpress codex seems to say that this action will happen anytime a database or a table is created.

    Am I right in saying that this only ever has to be run once? Can I just run it once on admin init then remove it and add the modify_bp_global_xprofiles_tablenames at runtime or have I misunderstood it?

    CodeMonkeyBanana
    Participant

    Hi,

    I am using this plugin to enable buddypress on my multisite: http://buddydev.com/plugins/buddypress-multi-network/

    However it does not allow the subsite to create profile fields.

    I found this page: https://codex.buddypress.org/themes/guides/segregated-x-profile-fields-for-multisite/

    But I am a little worried about creating some sort of conflicts.

    Can someone provide me some advice on how to approach this? Is there a plugin that does this already? Should I try to merge that page with the code in bp multi network plugin?

    Thanks

    #239800
    shanebp
    Moderator

    I’m calling it from the buddypress-xprofile-custom-fields-type plugin, do you think could be some filter that intercept querystring and reset it ?

    I doubt it.
    Where in the plugin are you calling it?
    In a function?
    And what is that function hooked to?
    Is that hook being called on the page where you manually call the $_GET? Probably not.

    #239799
    city4run
    Participant

    Hello Shane,
    I called manually the URL in the browser with the ?var1=TEST to be sure that it’s called properly but nothing change.

    I’m calling it from the buddypress-xprofile-custom-fields-type plugin, do you think could be some filter that intercept querystring and reset it ?

    #239723
    Tony G
    Participant

    I’m building a site where a user’s identity in one group isn’t related to his/her site identity, and where the identity is different across groups.

    So for example, the WordPress.org site provides single-signon between that site and this BuddyPress.org site. But while I’m Starbuck there, I might prefer to be “MrBuddy” here, or “TechDude” in some other developer site.

    My application is for a single site but the concept is the same. A user has a single site account and wants to be in different groups where he is recognized by a different name, has different different profile fields, etc.

    Given that scenario I’m also trying to figure out the best way to manage group invitations. Some people invited to a group will already be site members. Rather that requiring group admins to have the email address for all group members I’d prefer that they invite site members by their member name/ID, with an email going out to the user from the site using a stock template : “You’ve been invited to the ZSite group Blah, click here to accept…”.

    Can anyone refer me to extensions/plugins for this? I’ve found some that do some of this, but not all, and nothing that’s been maintained for a while.

    Thanks!

    #239696
    dsr07mm
    Participant

    Ok so this comes from complete beginner when coding come in question.

    Can I actually change like complete design/template of buddypress profile page look ? I dont mean on fields and tabs, I mean about making everything smaller ?

    Also I would like to add comment count and history including follow button for profiles.

    Any links to guides/example where I could learn more about that if its possible it would be appreciated.

    danbp
    Participant

    Please search before asking. Search: Remove Profile Links brings up:

    https://buddypress.org/support/topic/on-profile-base-answers-to-fields-works-as-links/

    #239608
    tammywashington
    Participant

    We are using WordPress Multisite version 4.2.2 with sub-domain folders. We are using the following plugins:

    BuddyPress ver. 2.2.3.1, BuddyPress Xprofile Custom Fields Type ver. 2.1.6, and s2Member Framework ver. 150311 + s2Member Pro v150311.

    When a user uploads their avatar image to the primary website along with additional BuddyPress Profile Custom Field information the avatar image does not show in the subdomain for the user account. We added the following code to the bp-custom.php file suggested from this link but it still does not allow the profiles images to show in the sub-domain:

     /* This fixes the MULTIBLOG avatar problem */
    function nfm_bp_avtar_upload_path_correct($path){
    	if ( bp_core_is_multisite() ){
    		// $path = ABSPATH . get_blog_option( BP_ROOT_BLOG, ā€˜upload_path’ );
    		$path = ABSPATH . 'wp-content/uploads/';
    	}
    	return $path;
    }
    
    add_filter('bp_core_avatar_upload_path', 'nfm_bp_avtar_upload_path_correct', 1);
    
    function nfm_bp_avatar_upload_url_correct($url){
    	if ( bp_core_is_multisite() ){
    		$url = get_blog_option( BP_ROOT_BLOG, 'siteurl' ) . '/wp-content/uploads';
    	}
    	return $url; 
    }
    
    add_filter('bp_core_avatar_url', 'nfm_bp_avatar_upload_url_correct', 1);
    tstrickland415
    Participant

    Ok now everything works as you mentioned, but there’s just one caveat. The xprofile gets updated fine, but it’s not updating the actual Members Type field in the Extended Profile section of the Users panel in the backend.

    To clarify, when we make the xprofile field it’s a completely separate field than the Members Type field that Buddypress introduced recently. So in the Users->Extended Profile section there’s two fields for Member Types, the one we created and the one Buddypress introduced. Your code is only affecting the one we created and not the real Buddypress Member Type field. Is there a way to have the BP Member Type field get updated with the corresponding member type from the xprofile field?

    danbp
    Participant

    Yes indeed, there is a way.

    Step by step tutorial with example code which you add to bp-custom.
    Note: use this code as is and follow the instruction. Once you understood what it does and how it works, you will be able to modify it to your needs.

    First, create a new xprofile field in the first group field (aka Base Group and containing Name as default field). Only fields created in that group are visible on the register page. Call it Type, enter description and choose multiselectbox as field type. Add operator, vendor, coach as select option.

    That’s all for the register part handled by BuddyPress.

    Now we need to declare the whole thing to get it work on front-end.
    Member-type is an additionnal functiony to select members by… type ! Not by role, not by latest, mst popular or anything else. Just (for the moment) by a custom type of your choice.

    We have to built a member directory for our types. We have 3 types and they will be shown on 3 new tabs on that directory.

    1) we formally declare the member types
    2) we count members by type (to stay correctly informative on the directory)
    3) we display the tabs

    function using_mt_register_member_types() {
    	bp_register_member_type( 'operator', array(
    		'labels' => array(
    			'name'          => __( 'Operators', 'using-mt' ),
    			'singular_name' => __( 'Operator', 'using-mt' ),
    		),
    	) );
    
    	bp_register_member_type( 'vendor', array(
    		'labels' => array(
    			'name'          => __( 'Vendors', 'using-mt' ),
    			'singular_name' => __( 'Vendor', 'using-mt' ),
    		),
    	) );
    
    	bp_register_member_type( 'coach', array(
    		'labels' => array(
    			'name'          => __( 'Coaches', 'using-mt' ),
    			'singular_name' => __( 'Coach', 'using-mt' ),
    		),
    	) );
    }
    add_action( 'bp_init', 'using_mt_register_member_types' );
    
    function using_mt_count_member_types( $member_type = '', $taxonomy = 'bp_member_type' ) {
    	global $wpdb;
    	$member_types = bp_get_member_types();
    
    	if ( empty( $member_type ) || empty( $member_types[ $member_type ] ) ) {
    		return false;
    	}
    
    	$count_types = wp_cache_get( 'using_mt_count_member_types', 'using_mt_bp_member_type' );
    
    	if ( ! $count_types ) {
    		if ( ! bp_is_root_blog() ) {
    			switch_to_blog( bp_get_root_blog_id() );
    		}
    
    		$sql = array(
    			'select' => "SELECT t.slug, tt.count FROM {$wpdb->term_taxonomy} tt LEFT JOIN {$wpdb->terms} t",
    			'on'     => 'ON tt.term_id = t.term_id',
    			'where'  => $wpdb->prepare( 'WHERE tt.taxonomy = %s', $taxonomy ),
    		);
    
    		$count_types = $wpdb->get_results( join( ' ', $sql ) );
    		wp_cache_set( 'using_mt_count_member_types', $count_types, 'using_mt_bp_member_type' );
    
    		restore_current_blog();
    	}
    
    	$type_count = wp_filter_object_list( $count_types, array( 'slug' => $member_type ), 'and', 'count' );
    	$type_count = array_values( $type_count );
    
    	if ( empty( $type_count ) ) {
    		return 0;
    	}
    
    	return (int) $type_count[0];
    }
    
    function using_mt_display_directory_tabs() {
    	$member_types = bp_get_member_types( array(), 'objects' );
    
    	// Loop in member types to build the tabs
    	foreach ( $member_types as $member_type ) : ?>
    
    	<li id="members-<?php echo esc_attr( $member_type->name ) ;?>">
    		<a href="<?php bp_members_directory_permalink(); ?>"><?php printf( '%s <span>%d</span>', $member_type->labels['name'], using_mt_count_member_types( $member_type->name ) ); ?></a>
    	</li>
    
    	<?php endforeach;
    }
    add_action( 'bp_members_directory_member_types', 'using_mt_display_directory_tabs' );

    We also need to sort the members list on each type tab using the loop scope.

    function using_mt_set_has_members_type_arg( $args = array() ) {
    	// Get member types to check scope
    	$member_types = bp_get_member_types();
    
    	// Set the member type arg if scope match one of the registered member type
    	if ( ! empty( $args['scope'] ) && ! empty( $member_types[ $args['scope'] ] ) ) {
    		$args['member_type'] = $args['scope'];
    	}
    
    	return $args;
    }
    add_filter( 'bp_before_has_members_parse_args', 'using_mt_set_has_members_type_arg', 10, 1 );

    And we finally clean the cache to stay up to date with the output

    function using_mt_clean_count_cache( $term = 0, $taxonomy = null ) {
    	if ( empty( $term ) || empty( $taxonomy->name ) || 'bp_member_type' != $taxonomy->name )  {
    		return;
    	}
    
    	wp_cache_delete( 'using_mt_count_member_types', 'using_mt_bp_member_type' );
    }
    add_action( 'edited_term_taxonomy', 'using_mt_clean_count_cache', 10, 2 );

    That’s all for a members directory page showing All Members and tabed Members by type.

    If you want to show the type of a member on his profile header, use this:

    function using_mt_member_header_display() {
    	$member_type = bp_get_member_type( bp_displayed_user_id() );
    
    	if ( empty( $member_type ) ) {
    		return;
    	}
    
    	$member_type_object = bp_get_member_type_object( $member_type );
    	?>
    	<p class="member_type"><?php echo esc_html( $member_type_object->labels['singular_name'] ); ?></p>
    
    	<?php
    }
    add_action( 'bp_before_member_header_meta', 'using_mt_member_header_display' );

    Or if you want to display the type under each user avatar on the member directory, you can use this snippet. Note: was originally made to add a geoloc shortcode below the member type. I let it as is, so you can see how it’s done.

    function who_are_you_directory() { // by member_type name + geoloc (wpgeo me)
    $user = bp_get_member_user_id();
    $terms = bp_get_object_terms( $user,  'bp_member_type' );
    
    	if ( ! empty( $terms ) ) {
    		if ( ! is_wp_error( $terms ) ) {		
    				foreach( $terms as $term ) {
    					echo '<p>' . $term->name . '</p>'; 					
    					echo do_shortcode('[gmw_member_info]');
    				}		
    		}
    	} 
    
    }
    add_filter ( 'bp_directory_members_item', 'who_are_you_directory' );

    Anything inspired by Codex and heavy topics reading.

    Member Types

    Members Loop

    May this help.

    #239507
    PersepolisTehran
    Participant

    I changed this note “Registering for this site is easy. Just fill in the fields below, and we’ll get a new account set up for you in no time” to my custom note, and i changed “Blog detail” to “Profile detail”. Then i made 2 file : 1) – buddypress-en_US.mo . 2) buddypress-en_US.po and i uploaded both to /wp-content/languages/plugins/ .

    danbp
    Participant

    @minglonaire,

    i’m part of the one percenter who cares about well formed urls and a basic system which is working on 23% of www’s sites !

    If you have enhancement ideas, feel free to post in the appropriate forum or open a ticket on Trac.

    BP is only a WP plugin and doesn’t handle registration. On the other hand, WP use a very short registering form, containing 3 fields: username, email and password.

    First and last name are optionnal fields on the standard WP user profile. These fields are not mandatory, never appear on the registration page and it’s in the freedom of everyone to use them or not. When BP is installed, he provides a mandatory Name field, which can be used to enter a username or a first/last name.

    Even if i have no percentage to give you, i’m pretty sure that almost all users are satisfied to use a CMS which doesn’t ask them for real names at first ! And why not their address, blood group, gran’mother nickname or their mom’s phone number ?

    This are privacy options, and WP is smart enough to not abuse of such things, by default. Smart enough also to use the simpliest existing register routine, like all other major web operators, a username, a valid email and an encrypted password.

    Anything else is matter of flexibility, one of the major interrest to use BuddyPress. And definetly no, not all communities have members who knows each others. Don’t make you the spokeman of such behalf speculation. šŸ˜‰

    I think you’re confused by system requirements and your own desires. To get it clear for the register aspect, read here please.

    Oh, and the answer to your question is here:

    Customizing Labels, Messages, and URLs

    Mickey
    Participant

    Default Privacy:
    Private
    Friends
    Logged in Users
    Public

    I would assume this is who can see the profile, but changing the fields does not do anything.

    How is this supposed to work or what is it supposed to do?

    #238943
    thomasoriis
    Participant

    @modemlooper – It could be nice if one could handle this from the xprofile fields in wp_admin as well – do you know how to do that ? I don’t think I have to request that feature I am sure it will come.

    Could be nice : )

    David Jensen
    Participant

    On the BP registration page, I have several xProfile fields of varying field types.

    If I do a test registration, and purposely leave a required field blank (or similar action to trigger an error message), all the xProfile field values get erased and I have to re-enter them.

    Looking at the code the fields are generated using an admin_field_html() method, but I do not see a way to retain their values if an error occurs.

    Is this possible or can someone lead the way on how to do this?

    #238908
    modemlooper
    Moderator

    Your question is vague. Please tell more. Are you referring to profile fields?

    danbp
    Participant

    The unique field coming with BP xtended profile is called Name by default. This field name can be changed and you can add some specific description to it to fit your need.

    On the register page you have on the left the 3 mandatory fields from WP
    username
    password
    email

    on the right BP’s Name field in which you can enter first and last name.

    Registration

    #238867
    shanebp
    Moderator

    Try this in your theme/functions.php or in bp-custom.php

    function klosurdo_unlink_fields( $field_value ) {
    
    	$no_link_fields = array( 'Photographer Bio' );
    
    	$bp_this_field_name = bp_get_the_profile_field_name();
    
    	if ( in_array( $bp_this_field_name, $no_link_fields ) )
    		$field_value = strip_tags( $field_value );
    
    	return $field_value;
    
    }
    add_filter( 'bp_get_the_profile_field_value', 'klosurdo_unlink_fields', 99, 1 );
    #238866
    Klosurdo
    Participant

    Hi,

    I like the idea of having certain fields link to other members with the same selection however, in one of the text fields buddypress seems to have arbitrary selected text to link that makes no sense (see screen capture). Why has it selected those sentences as links? Is there a way to remove that from happening without effecting the other dropdown and selection fields. This field should be pure text without arbitrary links.

    screenshot

    Thanks

    #238836
    jasnmallory
    Participant

    Hi, I recently started my first WordPress site, on a new WP 4.2.2 install, and with BP 2.2.3.1 plugin installed, but I can’t find anything inside the plugin about the member type feature!?! I have read up on it, but nothing has let me know exactly what to do to get it on my dashboard, or to enable it in any way… Can someone please hold my hand on this? If I need to copy and paste code from here: https://codex.buddypress.org/developer/member-types/ I have no idea of where to do it? I’m ready to start populating profiles, but need the member type feature, and separate member type questions/fields in order for the site to function properly. Please help. My site is GigTrain.com – Thanks.

    danbp
    Participant

    hi @tiquality,

    to show the user’s mail above the other user information, you can add the following snippet to bp-custom.php or child-theme’s functions.php

    Assuming users gave a valid email at registration, we can output that address.
    Avantage is that they haven’t to enter their mail a second time while completing their profile.

    So we just need to manually add this address to the template, using one of the action hook avaible in profile-loop.php

    function tiquality_add_custom_field() {
    
    	if ( bp_is_active( 'xprofile' ) ) :
    
    		if ( is_user_logged_in() ) {
    ?>
    	<div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
    		<table class="profile-fields">
    			<tr class="my_mail">
    
    				<td class="label">Contact me</td>
    
    				<td class="data"><a href="mailto:<?php bp_displayed_user_email(); ?>"><?php bp_displayed_user_email(); ?></a></td>
    
    			</tr>
    		</table>
    	</div>
    <?php 
    		}
    	endif; 
     
    }
    add_action('bp_profile_field_buttons', 'tiquality_add_custom_field');

    If you prefer it on the profile header, use the action hook indicated by Brajesh
    add_action('bp_member_header_actions', 'tiquality_add_custom_field');

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