Search Results for 'profile fields'
-
AuthorSearch Results
-
August 9, 2014 at 11:02 am #186354
In reply to: How to change buddypress profile fields text color
GKK
Participanti 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.
August 7, 2014 at 11:28 pm #186247danbp
ParticipantHi @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.
August 7, 2014 at 12:24 pm #186090In reply to: Connect Extended Profile to WP Standard Profile
Hugo Ashmore
ParticipantWhat 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?
August 7, 2014 at 9:42 am #186082In 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. 🙂
August 6, 2014 at 9:25 am #186016danbp
Participant
Did you tried this plugin or worse, for inspiration ?
https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-typeAugust 6, 2014 at 7:14 am #186010Ross Wintle
ParticipantThanks 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
August 5, 2014 at 10:14 pm #185996shanebp
ModeratorI’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.
August 5, 2014 at 8:58 pm #185992Ross Wintle
ParticipantThanks 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
August 1, 2014 at 10:49 pm #185848dzung
ParticipantI 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.
July 30, 2014 at 2:37 pm #185757In reply to: Disable BP registration and enable WP registration
danbp
Participantyou removed and added the same action, so nothing would changes: it’s just normal !
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.And here is an answer to your question:
https://buddypress.org/support/topic/wordpress-login-and-registration-page/#post-171826July 29, 2014 at 11:58 pm #185736NANOPASS
ParticipantJuly 29, 2014 at 9:12 pm #185727NANOPASS
ParticipantHi 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.
July 23, 2014 at 1:22 am #185437rcjr24
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.
July 22, 2014 at 7:39 am #185402In reply to: [Resolved] Limited Checkbox Selection
noyzen
Participanti 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?
July 18, 2014 at 6:36 pm #185263@mercime
ParticipantHow 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/July 17, 2014 at 3:40 pm #185215AIRFieldNotes
ParticipantThanks 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
July 17, 2014 at 11:10 am #185207The Doctor
ParticipantAnd 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!
July 15, 2014 at 12:48 am #185093@mercime
Participantusername 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-usto your site’s register page.July 8, 2014 at 10:03 pm #184911In reply to: Adding xprofile data in my Activity Stream
JoshtheDesigner
ParticipantI 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.
July 8, 2014 at 7:13 pm #184901In reply to: Adding xprofile data in my Activity Stream
JoshtheDesigner
ParticipantOk 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?
July 8, 2014 at 5:40 pm #184896In reply to: Adding xprofile data in my Activity Stream
shanebp
ModeratorUse 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 );July 3, 2014 at 7:45 pm #184784dzung
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?
July 3, 2014 at 6:39 am #184763In reply to: How to have a Dynamic xProfile field?
dzung
ParticipantTo 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!
June 30, 2014 at 1:17 am #184564In reply to: Multi Select Box in Profile fields doesn't work
elihub
ParticipantI 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/5672June 26, 2014 at 8:10 am #184436In reply to: How to have Two Sign up forms?
dzung
ParticipantFor 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 Lecturer3. 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!
-
AuthorSearch Results