Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,201 through 1,225 (of 3,608 total)
  • Author
    Search Results
  • #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/

    AIRFieldNotes
    Participant

    Thanks for the response. I think I was a bit confused, I am actually using Magazine Basic, not Buddypress Default, but thanks for the head’s up.

    I created the extended profiles via Users>Profile Fields

    The Doctor
    Participant

    And I resolved it simply.

    Just add

    #buddypress table.profile-fields p {
    	margin-top: 10px !important;
    	margin-bottom: 10px !important;
    }

    or the kind of margin you want, to a custom css, and voíla!

    #185093
    @mercime
    Participant

    username appearing twice on registration form


    @jaciando1
    Change the “User Name” profile field name in the “Profile Details” box -> go to admin menu
    Users > Profile Fields and click on the “edit” button under that profile field name.

    I also appear to have two different register forms???

    You can add the following to your theme’s functions.php page:

    /* If BuddyPress is active */
    if ( class_exists('BuddyPress') ) {
    	add_action('init','mme_redirect_register');
    	function mme_redirect_register(){
    		global $pagenow;
    		if( 'wp-login.php?action=register' == $pagenow ) {
    			wp_redirect('http://buddypress.dev/join-us');
    			exit();
    		}
    	}
    }

    Change http://buddypress.dev/join-us to your site’s register page.

    #184911
    JoshtheDesigner
    Participant

    I tried the exact code that you put in your first response. I put it in my Functions file then updated one of the xProfile fields and it was not in the activity feed.

    #184901
    JoshtheDesigner
    Participant

    Ok yes sorry I knew that. I tried to add it to my functions.php and I updated my profile but it did not show in the activity feed. I would like it to show in the activity feed if anyone updates their profile via the xprofile fields. It looks like from your code that it would only show if I update my profile. Any thoughts?

    #184896
    shanebp
    Moderator

    Use the ‘xprofile_updated_profile’ hook

    function josh_profile_check( $user_id, $posted_field_ids, $errors ) {
      /* check $posted_field_ids to see if one of the fields you are interested in has changed
      if yes, then use bp_activity_add to add to activity stream
      */
    }
    add_action( 'xprofile_updated_profile', 'josh_profile_check', 10, 3 );

    bp_activity_add

    dzung
    Participant

    @mercime – I just fix the issue with notification tab – and that seems to has effect on this too.

    Now logged in members can see other members full profile fields. I want to make the full profile fields including base fields and xProfile group fields public to everyone even not logged in, how can I do this?

    #184763
    dzung
    Participant

    To anyone who want the same thing, follow my below steps.

    I have a text file contains about 600+ names of schools and I want to make a schools-drop-down – So It’s very time-consuming to click add option one by one. It needs another way:

    1. Content of The Schools list text file.
    Tamale Polytechnic
    Kumasi Polytechnic
    Accra Polytechnic
    Cape Coast Polytechnic
    Koforidua Polytechnic
    Ho Polytechnic
    ….600+…
    2. I go to xProfile and create a Drop-down named it Schools – I input one option say “A sample school” – save.
    3. I go to phpMyadmin -to Database to table gsl_bp_xprofile_fields – Search “A sample school” to find the newly created Sample schools row – on the result look at the
    columns: (group_id, parent_id, type , name) . they should have values like: (group_id: 1, parent_id: 127,type :’option’ ,name :’A sample school’).
    4. Next I use a Core Java code(because I don’t know how to do this in PHP) to read the schools list text file one by one and custom the print out like this:

    
    String fileName = "D://Schools.txt";
    String line = null;
    try {
      FileReader fileReader = new FileReader(fileName);
      BufferedReader bufferedReader = new BufferedReader(fileReader);
      while((line = bufferedReader.readLine()) != null) {
        line = line.replace("'", "");
        String sqlBase = "INSERT INTO gsl_bp_xprofile_fields (group_id,parent_id, type,name) VALUES (1, 127,'option' ,"+"'"+line+"'"+");";
        System.out.println(sqlBase);
                }	
        bufferedReader.close();			
    }

    After running the above code I have a list of SQL insert commands printed on my eclipse they look like this:

    INSERT INTO gsl_bp_xprofile_fields (group_id,parent_id, type,name) VALUES (1, 127,'option' ,'Tamale Polytechnic');
    INSERT INTO gsl_bp_xprofile_fields (group_id,parent_id, type,name) VALUES (1, 127,'option' ,'Kumasi Polytechnic');
    INSERT INTO gsl_bp_xprofile_fields (group_id,parent_id, type,name) VALUES (1, 127,'option' ,'Accra Polytechnic');

    ….many more insert commands until the end of the schools file 600+

    5. Next, I copy all these commands, come back phpMyadmin database- table gsl_bp_xprofile_fields – to SQL tab, paste all commands, click run/go to insert all the options.

    That’s all done for me!

    #184564
    elihub
    Participant

    I did the same research as @kansas3d – multiselect only saves the last of multiple fields on the xprofile edit screen. I am running BP 2.0.1 (WP 2.9.1), and have confirmed that rolling back to BP 1.9 (not BP 2.0) fixes the issue. I disabled all plugins and experienced the same problem in my custom theme (built on Bones, not TwentyFourteen-derived).

    Converting multiselect to checkboxes allows for multiple value saving, but is not optimal. I have tracked down some similar tickets (#2176 from BP 1.2 and there’s another somewhere…)

    Update – it appears there is an open ticket (#5672) related to this:
    https://buddypress.trac.wordpress.org/ticket/5672

    #184436
    dzung
    Participant

    For now, I’ve come to another solution, where I allow users to Register new account with base Fields and a Role selection (Student or Lecturer in my case). They then fill in only base field and then after account creation they can update their Student or Lecture xProfile Group Fields in their profile page edit.

    I do these above by using 3 plugins:

    1. https://wordpress.org/plugins/wpfront-user-role-editor/
    This will allow me to add new Role: Student and Lecturer in my case (I have tried other Role plugin but they conflict with other plugins on my site, this one doesn’t).

    2. https://wordpress.org/extend/plugins/wp-roles-at-registration/
    This one allow me to add a Drop down for New user to choose their wanted role : Student or Lecturer

    3. https://wordpress.org/extend/plugins/buddypress-xprofiles-acl/
    This plug in allow me to set buddypress xProfile group to a specific user role. In my case, I created two xProfile Group fields named “Student” and “Lecture” each has different fields. Then using this plugin I assigne the xProfile Student to Student Role, and the xProfile Lecturer to Lecturer Role.

    That’s all done!

    Meanwhile I will use this, but I still want to be able to have two sign up forms with different fields so that I can require New user to fill in the Required field to make the profile better. I can’t code much so hope someone will help!

Viewing 25 results - 1,201 through 1,225 (of 3,608 total)
Skip to toolbar