Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,176 through 1,200 (of 3,593 total)
  • Author
    Search Results
  • Joe
    Participant

    well i pasted the following code into the member-header.php file in buddypress where it says to add code and still no luck.

    <div id="member_profile">
        <div class="profile_fields">Position <span><?php bp_member_profile_data( 'field=Position' );?></span></div>
    		</div>		
    <?php
    /***
    * If you'd like to show specific profile fields here use:
    * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
    */
    do_action( 'bp_profile_header_meta' );
    
    ?>
    Any ideas?
    Joe
    Participant

    @butlerweb that’s a good call on the plugin Code Snippets — sounds like a really useful plugin.

    Okay, so using the code from the link you gave me (which should be added to the buddypress member header file):

    <div id=”member_profile”>
    <div class=”profile_fields”>Category: <span><?php bp_profile_field_data( ‘field=Category’ );?></span></div>

    If the Category Field was an array (a multicheck boxes), would this code be different, do you know? Maybe this is the issue I’m running into to.

    Thanks. –Joe

    ButlerWeb
    Participant

    Where are you putting your code? Directly in the template file or elsewhere?

    And mine were Multiselect boxes, rather than checkboxes, but it should give you the same array output. For those, I had to parse the strings into something a bit more readable.

    Again, I use xprofile fields, but this is what my code looks like:

    <h4><strong>Arts Subcategories:</strong> <?php echo (implode( ', ', (array) xprofile_get_field_data ('Arts Subcategories'))); ?></h4>

    I did not want to edit template files so I used a plugin called ‘Code Snippets’ which allows me to write code without editing the theme’s functions.php file or, like I said, the BP template files. However, to add them to the pages I had to use the “add_action()” hook.

    ButlerWeb
    Participant

    Haha I have about 47 different plugins installed into my site and it runs fairly smoothly. The only thing is my geolocation plugin causes my page to refresh the first time you view it.

    Aside from that, I found this article: http://bp-tricks.com/snippets/displaying-certain-profile-fields-on-your-members-profile-page/

    In step 2 it shows PHP code to grab profile field data. You’ll have to either edit the template you want or create your own tab if you want it on a new page besides one of the pages you already have up on your site.

    As far as adding social icons, I used this tutorial: https://buddypress.org/support/topic/display-users-social-follow-buttons-in-profile/
    But that one requires xprofile fields.

    Hope that helps some! 🙂

    ButlerWeb
    Participant

    Possibly! what ‘current profile extension fields’ do you have or are you working with.

    I only recommend xProfile Fields because I know how to use the hooks! Haha 🙂

    Joe
    Participant

    Hi @butlerweb thanks for the response!

    I’m not using xprofile fields because I didn’t want to add a birthdate field and whatnot, just wanted to display my current profile extension fields. Is that not possible without the install of xProfile Fields?

    Thanks.

    #186429
    ButlerWeb
    Participant

    Does the area you want your users to write need to be like many different blog posts? Or just like a single biography section?
    I can help you with code for a biography section. For that you need Xprofile Fields installed.

    For blog posts, the answer I’ve gotten for that is to activate a Multisite network and then get the plugin for front-end blog posting (look for one that is compatible with BuddyPress).

    ButlerWeb
    Participant

    I did something similar to you, I made a whole new profile page though, for my users.
    First off, do you have xProfile Fields installed and active? You’ll need that.

    Take a look at the page I’m working on currently: http://ishocase.net/members/chiherah/

    #186424
    bluemuse
    Participant
    #186399
    Hudson Atwell
    Participant

    So far this is as close as I have gotten:

    
    public static function get_extended_fields( $user_id ) {
    		
    		$fields = array();
    		
    		/* Get User Extended Data */
    		$r = bp_parse_args( $args['args'], array(
    			'profile_group_id' => 0,
    			'user_id'          =>  $user_id
    		), 'bp_xprofile_user_admin_profile_loop_args' );
    
    		$i = 0;
    		
    		if ( bp_has_profile( $r ) ) {
    			
    			while ( bp_profile_groups() ) {
    				
    				bp_the_profile_group(); 
    				
    				while ( bp_profile_fields() ) {
    					
    					bp_the_profile_field();
    					$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    
    					$fields[ $i ]['name'] = bp_get_the_profile_field_name();
    					$fields[ $i ]['id'] = bp_get_the_profile_field_input_name();
    					$fields[ $i ]['value'] = bp_get_the_profile_field_edit_value();
    	
    					$i++;
    				}
    			}		
    		}
    		return $fields;
    		
    	}
    
    #186354
    GKK
    Participant

    i am using “fine pro” theme, the child theme was created as dafault, can i use this child theme for buddypress customization? , if yes, where can i find that text CSS CODES for changing style in table profile fields? I have searched for table profile fields CSS code in buddypress default.css, but i don’t know which code is related to profile field text.

    danbp
    Participant

    Hi @csimpson,

    the answer is on the codex (bp_parse_args)

    Add this to your theme’s functions.php or into bp-custom.php

    function bpfr_make_name_members_only( $retval ) {	
    	//hold all of our info
    	global $bp;
    	
    	// is xprofile active ?	
    	if ( bp_is_active( 'xprofile' ) )
    	
        // The user ID of the currently logged in user
        $current_user_id = (int) trim($bp->loggedin_user->id);
    	
        // The author that we are currently viewing
        $author_id  = (int) trim($bp->displayed_user->id);
    	 
    	// user can see only his name && admin can see everyone 
    	if ($current_user_id !== $author_id && !current_user_can('delete_others_pages') ) {
    		$retval['exclude_fields'] = '1';	
    	}
    	return $retval;	
    }
    add_filter( 'bp_after_has_profile_parse_args', 'bpfr_make_name_members_only' );

    EDIT: this snippet does work only on BP 2.0+. Don’t use it with older versions.

    #186090
    Hugo Ashmore
    Participant

    What you ask would require some custom functions being created and that would require fairly extensive php skills and knowledge of BP.

    There are some connect plugins around that are BP aware, nextend google connect springs to mind as one that does populate BP profile fields with user data so it may be worth hunting around for other plugins?

    #186082

    In reply to: Remove profile links

    Nicole
    Participant

    @matthew_radich you should check out the code Sharmavishal wrote, it works great, and I also use Buddypress Xprofile Custom Fields. 🙂

    danbp
    Participant
    Ross Wintle
    Participant

    Thanks again Shane. I’ll try to explain again.

    At high level, I want users, in their user profile, to be able to select one or more skills that they have. Skills are posts of a post type.

    At lower level, I want, in a BP user profile, a field which is either a multi-select, or a set of checkboxes. The values selectable should be titles of posts from the “Skills” post type (I’ll actually save the IDs of the posts, but the titles should be displayed).

    The user should be able to select these values both when registering and when editing their profile.

    Possible implementations I can think of would be:
    – Implement a new field TYPE called “skill”, create a field of that type in BuddyPress, and write some hooks that display and save the field.
    – Add some custom code using action hooks to the bottom of the registration and edit profile screens.

    I know it’s kinda hard to explain in a short forum post. There just doesn’t seem to be some simple, documented hooks that a plugin can use to extend the user profiles with new custom fields of new types and I was looking for some guidance/best practice for doing this.

    Thanks again for your help.

    Ross

    shanebp
    Moderator

    I’m still not clear on what you’re trying to do.

    Those hooks should provide a starting point.
    But adding profile fields dynamically and adding/setting dynamic values to existing fields are 2 different things.

    See:
    buddypress\bp-xprofile\bp-xprofile-admin.php
    re adding adding profile fields dynamically.

    The latter item should be quite straightforward.

    Then, as you point out, there is the lamentable difference between field handling in reg and profile.

    Ross Wintle
    Participant

    Thanks Shane.

    I was thinking more of something that’s like profile fields, that you edit in the member sign-up and profile edit screens, rather than creating new screens. What I’d REALLY like is something like the Group extension API for users. But instead the registration/register.php and /members/single/profile/edit.php templates seem to have a large amount of almost-duplicated code and inconsistent hooks.

    Yeah, I know – if I want an extension system I should contribute it, right? 🙂

    Any thoughts on adding profile fields with dynamic values in the way that I need? The best way would seem to be to use something like the bp_custom_profile_edit_fields and bp_signup_profile_fields action hooks, but I’m not sure that they are specific enough.

    Thanks

    Ross

    dzung
    Participant

    I still get this issue, now only User can see his xProfile – Even Admin can’t see other user xProfile. I have tried to switched to the Twenty Theme, but it still happens.

    I have traced to here:

    //I have two profile Groups, the Base group and one more I created.
    // I created a User with full profile fields data.

    <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    <?php if ( bp_profile_group_has_fields() ) : ?>

    If the user view his own profile the bp_profile_group_has_fields() will return True two times. But if another user view this user profile it will only return True 1 time and the 2nd time is false – that makes it display only Base group profile Fields and xProfile fields can’t display.

    I use WP 3.9 Latest BuddyPress and installed a lot of plugins.

    #185757
    danbp
    Participant

    @osamanuman,

    you removed and added the same action, so nothing would changes: it’s just normal !

    BuddyPress Action Hook Sequence During Startup

    The difference beetween BP and WP registration is the BP xprofile additionnal fields for your members.
    This means that BP modifies the aspect, not the registration process.

    Modifying the Registration Form

    Register and Activation Pages

    And here is an answer to your question:
    https://buddypress.org/support/topic/wordpress-login-and-registration-page/#post-171826

    NANOPASS
    Participant

    Sorry, it was my lack of explanation.
    I created an item of birth date the setting of Profile Fields

    standard display of birthdate has become a DD-MM-YY.
    I want to change to YY-MM-DD this

    NANOPASS
    Participant

    Hi danbp
    It Seems to me the answer to my question
    But, the problem is not resolved.
    I am very troubled!

    plugins/buddypress/bp-xprofile/bp-xprofiles-class.php(bp-xprofile-classes.php):1459

    
    	/**
    	 * Constructor for the datebox field type
    	 *
    	 * @since BuddyPress (2.0.0)
     	 */
    	public function __construct() {
    		parent::__construct();
    
    		$this->category = _x( 'Single Fields', 'xprofile field type category', 'buddypress' );
    		$this->name     = _x( 'Date Selector', 'xprofile field type', 'buddypress' );
    
    		$this->set_format( '/^\d{4}-\d{1,2}-\d{1,2} 00:00:00$/', 'replace' );  // "Y-m-d 00:00:00"
    		do_action( 'bp_xprofile_field_type_datebox', $this );
    	}
    
    	/**
    	 * Output the edit field HTML for this field type.
    	 *
    	 * Must be used inside the {@link bp_profile_fields()} template loop.
    	 *
    	 * @param array $raw_properties Optional key/value array of {@link http://dev.w3.org/html5/markup/input.html permitted attributes} that you want to add.
    	 * @since BuddyPress (2.0.0)
    	 */
    	public function edit_field_html( array $raw_properties = array() ) {
    		$user_id = bp_displayed_user_id();
    
    		// user_id is a special optional parameter that we pass to {@link bp_the_profile_field_options()}.
    		if ( isset( $raw_properties['user_id'] ) ) {
    			$user_id = (int) $raw_properties['user_id'];
    			unset( $raw_properties['user_id'] );
    		}
    
    		$year_html = $this->get_edit_field_html_elements( array_merge(
    			array(
    				'id'   => bp_get_the_profile_field_input_name() . '_year',
    				'name' => bp_get_the_profile_field_input_name() . '_year',
    			),
    			$raw_properties
    		) );
    
    		$month_html = $this->get_edit_field_html_elements( array_merge(
    			array(
    				'id'   => bp_get_the_profile_field_input_name() . '_month',
    				'name' => bp_get_the_profile_field_input_name() . '_month',
    			),
    			$raw_properties
    		) );
    

    Please tell me Where Do I change specifically.

    rcjr24
    Participant

    @mercime I manage to rearrange all the fields using the code I posted, and now I have a code like this,

    <?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1&hide_empty_fields=0' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
    <?php if ( 'Country of Residence' == bp_get_the_profile_field_name() ) : ?>
    
    	<select class="country-residence" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" placeholder="<?php _e( bp_the_profile_field_name().':' ); ?>">
    		<?php //bp_the_profile_field_options(); 
    			
    			global $wpdb;
    			$sql = "SELECT * FROM wp_country_list";
    			$results = $wpdb->get_results($sql) or die(mysql_error());
    			echo '<option data-value="holder-only" class="holder">Country of Residence:</option>';
    				foreach( $results as $result ) {
    
    					echo '<option data-value="'. $result->three_letter_code .'" value="'. $result->three_letter_code .'">'.$result->name.'</option>';
    				}
    		?>
    	</select>
    	<?php do_action( bp_get_the_profile_field_errors_action() ); ?>
    
    <?php endif; ?>
    <?php endwhile;  ?>
    
    <?php endwhile; endif; endif; ?>

    Now the problem is, when the registration completes, this field doesn’t reflect to the user profile after successful registration. Hope you’ve got my point here.

    #185402
    noyzen
    Participant

    i have same need.
    is there any plugin to make more advanced profile fields??

    another thing i need is when people select for example country from a combobox next combobox load cities of that country so he can select city of country.

    any plugins?

    @mercime
    Participant

    How to customize the order of fields of registration


    @rcjr24
    you can change the order within Users > Profile Fields panel
    https://codex.buddypress.org/buddypress-components-and-features/extended-profiles/

Viewing 25 results - 1,176 through 1,200 (of 3,593 total)
Skip to toolbar