Search Results for 'profile fields'
-
AuthorSearch Results
-
December 3, 2017 at 4:30 pm #269393
Boone Gorges
KeymasterIt’s not possible to use a regular BP profile field to keep track of data changes over time. BP doesn’t keep records of old profile field values – it only stores the most recent one.
There are a number of ways you could accomplish it. If you had the technical know-how, you could build a tool that hooks into XProfile and syncs user-entered data to another system (maybe an array in usermeta or something like that). Another option is to manually created new fields every 3 months, but then you’d need to do some customization to the way fields are displayed on the front end so that the profile doesn’t show all past entries as separate items. Either way, some customization would be required.
Maybe someone on this forum knows of an existing tool that will help.
December 2, 2017 at 3:34 pm #269360In reply to: Register page editor
Boone Gorges
KeymasterBuddyPress’s Register page is a special kind of page that cannot be edited via the Dashboard. That’s why it’s blank when you view it in the normal way.
To add additional fields to the registration process, go to Dashboard > Users > Profile Fields. Add one for Address and one for Phone Number. Make them required and/or private, if you’d like. As long as they are part of the ‘Base’ profile field group, they will appear as part of the registration process.
November 28, 2017 at 10:54 pm #269210In reply to: Special characters output in profile fields
Boone Gorges
KeymasterHi @Sander – Thanks for reporting this. It looks like a legitimate bug. I’ve opened a ticket to track it: https://buddypress.trac.wordpress.org/ticket/7631
While we try to figure out a way to make this work better, you can work around the issue by disabling autolink for the field in question. Dashboard > Users > Profile Fields > Edit, and look for the Autolink metabox at the right.
November 20, 2017 at 8:21 pm #269091In reply to: BuddyPress email problem
Boone Gorges
KeymasterYou may be able to disable the linking in the admin. Go to Dashboard > Users > Profile Fields. Find the Email field, and click Edit. On the right-hand column, find the “Autolink” metabox. Switch it to ‘Disabled’ and save.
November 20, 2017 at 7:56 pm #269089In reply to: customize members page
Boone Gorges
Keymaster> i created customed fields for the inner-page of the user, but they don’t show in the members list page.
The details depend on how you created these “customed fields”. If they are xprofile fields, then the simplest way is to do this:
$user_id = bp_get_member_user_id(); $data = xprofile_get_field_data( 'Custom Field Name', $user_id ); if ( $data ) { echo $data; }If you stored it in user meta, do something similar:
$data = get_user_meta( $user_id, 'custom_field_name', true );Either way,
bp_get_member_user_id()is how you get the ID of the current user in the loop.November 18, 2017 at 7:16 pm #269034In reply to: Need to Export Profile Fields
Boone Gorges
KeymasterHi @barkins – BP doesn’t have a built-in tool for this (though it should – see https://buddypress.trac.wordpress.org/ticket/7393, https://buddypress.trac.wordpress.org/ticket/408). If you know that user IDs will remain the same between the local WP install and the live install, then you can do a simple database export/import, something like:
$ mysqldump -u db_user -p db_name wp_bp_xprofile_groups wp_bp_xprofile_fields wp_bp_xprofile_data > ~/xprofile-export.sql$ mysql -u db_user -p db_name < ~/xprofile-export.sqlIf the user names will not be the same, you’ll need to write a script to handle this, but the details will depend on how you plan to identify users (email address, etc).
November 6, 2017 at 6:36 pm #268860Boone Gorges
KeymasterHi @willallen83 – I’m afraid I haven’t integrated with s2member in many years, so I can’t provide exact advice. But briefly, it appears that the code above is meant to sync the
$s2member_fieldsfields – which I assume are defined somewhere in s2member – to the corresponding members of the$xprofile_fieldsarray. The latter fields are created in Dashboard > Users > Profile fields; make sure the names (like ‘Last Name’) match exactly, or the lookup will fail.Note also that it may be more reliable to fetch user info from the values passed by the ‘wp_login’ hook to the function. So something like this:
function s2_profile_field_update( $user_login, $user ) { //Array of xprofile field names $xprofile_fields = array('Last Name','Country','Introduce yourself to Aisha Salem'); //Array of s2member field slugs $s2member_fields = array('last_name','user_country','member_letter_aisha'); //Populates BP with S2 info get_currentuserinfo(); // if( current_user_is("s2member_level1") ) { for($i = 0; $i < sizeof($xprofile_fields); $i++) { if(xprofile_get_field_data($xprofile_fields[i], $user->id) == '' && get_user_field($s2member_fields[i]) != '' ) { xprofile_set_field_data($xprofile_fields[i], $user->id, get_user_field($s2member_fields[i]) ); } } // } }Note that, according to this code, it’ll only update the BP xprofile fields if they’re empty. You’ll have to remove that check if you always want s2member values to take precedence.
Beyond this, your best bet for figuring out why this is not working is to place some debug statements at various points. Use
error_log()or good old-fashionedvar_dump()to make sure (a) the function is actually firing at ‘wp_login’, (b) the xprofile field values are actually being fetched properly, (c) theget_user_field()function is fetching data properly, and from the correct user https://s2member.com/kb-article/user-custom-fields-via-php-code/#toc-460a2dd2, etc.November 3, 2017 at 4:45 pm #268803In reply to: Profile Fields Date format-> Range not working.
Boone Gorges
KeymasterSure, I’m happy to point you in the right direction.
The BuddyPress Custom XProfile Field Type plugin is probably a good one to start with. It uses the
BP_XProfile_Field_Typeclass to register its fields. It even has an existing Datepicker field that you can use as a starting place: https://github.com/donmik/buddypress-xprofile-custom-fields-type/blob/master/classes/Bxcft_Field_Type_Datepicker.phpThere are a few changes you’ll need to make in order for this to show two datepickers instead of one.
– The
set_formatvalidation regex expects a single date. This will need to be modified for your new format. https://github.com/donmik/buddypress-xprofile-custom-fields-type/blob/1126cf093bd2b6e9f917b5c15f52e203f17cbb9e/classes/Bxcft_Field_Type_Datepicker.php#L14
– You’ll need to modify theedit_field_htmlmethod so that it loads two separate input fields, and then write some JavaScript that assigns a jquery-datepicker to each one of them. Then you’ll need to write a little bit of extra JS that combines the two datepicker inputs into a single (probably hidden) field, which is the one that BP will actually save to the database. https://github.com/donmik/buddypress-xprofile-custom-fields-type/blob/1126cf093bd2b6e9f917b5c15f52e203f17cbb9e/classes/Bxcft_Field_Type_Datepicker.php#L29
– If you decide to store the start and end date in a single row in the profile field, you’ll also need some logic that splits it into start and end when you load theedit_field_html. Another option is to store the concatenated display text – say,April 2017 - May 2017– in BP’s native xprofile field, and to store the start and end date separately, as xprofilemeta. You’d need a custom save routine for this, but it may be a bit cleaner.Good luck! Sounds like a fun project.
November 3, 2017 at 4:26 pm #268799In reply to: Profile Fields Date format-> Range not working.
amitrwt
ParticipantIf you want your users to be able to select start and end times, my best suggestion is to create two separate xprofile fields, and name them accordingly: ‘Start Date’, ‘End Date’ or something like that.
That is exactly what I did, that was only way around I found for time being. If you have any insight can you pls tell me if it is possible to have a field with JQ datepicker where I can select start and end date. I’m planning to create a filed like this just need something to start with.. that’s the hard part once I’ll have a slate to start with I can write what I want. I’ve no issues getting my hands in code I’d rather enjoy it.
November 3, 2017 at 2:48 pm #268792In reply to: Profile Fields Date format-> Range not working.
Boone Gorges
KeymasterHi @amitrwt – The ‘Start’ and ‘End’ fields in the BP admin settings define the start and end dates of a single datepicker. That is, if you want to have a datepicker, but you only want to show dates between the years 1970 and 1990, you’d use those dates as the Start and End.
If you want your users to be able to select start and end times, my best suggestion is to create two separate xprofile fields, and name them accordingly: ‘Start Date’, ‘End Date’ or something like that.
November 3, 2017 at 2:24 pm #268788Boone Gorges
KeymasterHi @redcompolitica – I’ve built multi-page registration processes for clients in the past, but unfortunately, it’s not very easy to do – BP’s registration system is not built in such a way as to make it easy.
If your main goal is to make registration less overwhelming, you might consider moving some or most of your registration fields out of the “Base” group. This will mean that they don’t show up during the registration process, and users will have to fill them in by editing their profile after signing in.
If your goal is to have *conditional* registration steps – where, for example, step 2 depends on a specific value provided in step 1 – then I’m afraid it’d have to be custom-built. Much of the work could be done with a custom theme template
members/register.phpand by modifying the way that registration data is saved and validated https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-members/bp-members-screens.php?marks=113#L72Some Trac tickets that are somewhat related that you might want to follow:
https://buddypress.trac.wordpress.org/ticket/1842
https://buddypress.trac.wordpress.org/ticket/4278Good luck with your project!
November 1, 2017 at 10:44 pm #268762In reply to: get age from date
psnation
ParticipantBuddyPress Xprofile Custom Fields Type plugin is what I use to do this.
It shows up on the profile as age. If you want it on the members page that takes some code editing. I saw a tutorial on BPDev site.
November 1, 2017 at 12:15 pm #268754amitrwt
ParticipantI want to set a profile field where a user will list his experience in a particular organization. From and To.. I tried Date -> Range but it just renders single dropdown. The best possible scenario would be having a datepicker with range.?
I’ve installed BuddyPress Xprofile Custom Fields Type but even this doesn’t have a range date picker.
Anyone has any suggestion/solution would be appreciated.October 30, 2017 at 3:47 pm #268725In reply to: Paid Membership Pro and Buuddypress – Registration
willallen83
ParticipantI struggled with this for weeks. It never worked out well for me.
I used the Register Helper add-on plugin to add custom fields to the PMPro registration. I tried the above mentioned fixes, but nothing I tried let the PMPro registration process communicate with the BuddyPress (basically, I wanted one registration page to fill out the BuddyPress profile AND the necissary PMPro info).
Whichever way I tried it, they remained seperate. Of course, the PMPro registration process did add the user to BuddyPress, but with an empty profile, regardless of the custom fields that I added.FINALLY, after MANY hours of working with this, I tried s2Member. This plugin is much more involved to configure, BUT it works perfectly AND integrates well with MailChimp. So now, I not only have integration with BuddyPress (specifically the profile, although the display is a bit off), but also with Mailchimp. And, this means that I can have different mail-lists or mail-list groups within Mailchimp! Perfect 🙂
Basically, what I am saying is that if you want a better integration, go with s2Member.
Note: I did not pay the $300 / year for paid membership pro support (too expensive for me), maybe they would have been able to help me resolve this issue. I did scour the forum and glean every bit of info I could to solve this without paying, but to no avail. BUT, with s2Member, it is free AND only $80 one time for the Pro version of the plugin.
Good luck!
And, if anyone sees this and has a solution, please add. As people (I assume because I was) are still looking for a solution.
October 30, 2017 at 3:25 pm #268723michaeltcarlson
ParticipantThanks so much for the solution above. How can I modify the code to apply only to a specific page:
.field-visibility-settings-toggle {
display: none !important;
}
.field-visibility-settings-notoggle {
display: none !important;
}In my case, I’d like “This field can be seen by Anyone” removed from the registration page (#371), but still be visible on a users profile, thus giving users some control over the privacy levels of their fields.
Thanks in advance for the assistance.
October 25, 2017 at 7:34 pm #268667David Cavins
KeymasterYou can save extra things manually on the
bp_core_signup_userhook:
https://buddypress.trac.wordpress.org/browser/tags/2.9.1/src/bp-members/bp-members-functions.php#L1900But I imagine that the simpler answer would be to use Profile Fields. If you add profile fields to the base group, then they appear on the registration form and are saved at signup. https://codex.buddypress.org/administrator-guide/extended-profiles/
Best,
-David
October 24, 2017 at 9:10 am #268643In reply to: Profile fields to appear in directory
sostenibles
Participant@shanebp Thank you very much for your reply.
I got the correct file and issue is solved.
Problem was because fields indicated in the code have to be exact to the field name, and that includes both spaces and accents.
I am displaying more than one field now, and code looks like this (see the accents and spaces!):<?php bp_member_profile_data( ‘field=Área de negocio’ ); ?>
<br>
<?php bp_member_profile_data( ‘field=Comunidad Autónoma’); ?>
<br>
<?php bp_member_profile_data( ‘field=La empresa’); ?>October 10, 2017 at 6:25 am #268427In reply to: BP sign up page in two rows
metalhead
ParticipantPut it all in one column:
/* Aligns Registration Profile Details fields to the left */ #buddypress .standard-form #basic-details-section, #buddypress .standard-form #blog-details-section, #buddypress .standard-form #profile-details-section { width: 100%; } #profile-details-section { margin-top: 20px; }And the finish button too (recommended):
#buddypress .standard-form#signup_form div.submit { float: left!important; margin: -12px 3px 3px 3px!important; }That should line it all up in 1 row. Congrats on not paying someone $1000 for that info 🙂
September 28, 2017 at 9:26 am #268249In reply to: Custom profile properties
theredeclipse
ParticipantI come up with this piece of code, it just add class for fields but its enough for me
function bp_add_class($elements){ $elements['class'] = 'field'; return $elements; } add_action('bp_xprofile_field_edit_html_elements','bp_add_class');September 21, 2017 at 12:10 am #268147In reply to: Contact user
xmginc
Participant@flashvilla, hope this helps:
I’m using Gravity Forms to display a contact form on each member profile page and dynamically populating a hidden field with the member’s email address.
Here’s info on dynamically populating a field in GF
Their example:
add_filter( 'gform_field_value_your_parameter', 'my_custom_population_function' ); function my_custom_population_function( $value ) { return 'boom!'; }I have changed this to:
add_filter('gform_field_value_bp_member_email', 'bp_member_email'); function bp_member_email($value){ return bp_get_displayed_user_email(); }In Gravityforms, I have then created a hidden field and in the advanced tab of that field, checked “Allow field to be populated dynamically” and entered the “Parameter Name:” as “bp_member_email”
Then, in the notifications, the “Send to Email” should be changed from a standard email to a Gravityform tag. You can get that by clicking the little arrow key beside many fields such as “From Name” box. Find the name of your hidden field and click that. It should give you something like this: {BP Member Email:7} where “BP Member Email” is the name I gave the hidden field – yours will be whatever you named it.
You’ll also need to embed the form to your child theme: /themes/yourchildtheme/buddypress/members/single/home.php
Details on how to embed into your theme can be found here. Example: (where 1 is the ID of your form and 12 is the starting tabindex)
<?php gravity_form(1, false, false, false, '', true, 12); ?>If this worked, you can view the source code of the member page and you’ll see the member’s email as an input value in the hidden field.
Hope this helps!
Please note: if you can’t have the person’s email displayed publicly in the source code for privacy (even though it’s not visible on the site), you will need an alternative method. Members on my site all have their emails visible so it’s not an issue for me.
September 16, 2017 at 6:48 pm #268087In reply to: How to Edit Register Page?
xmginc
ParticipantNote some steps could be missing here but hope this helps with the general direction 🙂
1. Look for “Users” in left sidebar of WordPress wp-admin area
2. Click “Profile Fields” and there should be a box which you might have named “Terms of Use” – NOTE: if you changed the “Name (Primary) (Required)” to your terms of use field, you should change this back as it syncs with the person’s name
3. Click the blue button “Add New Field” and name it “By registering to ThoseCrazyVegans.net, you agree to the <a href="/terms-of-use/">Terms of Use</a>” (the title accepts HTML at least for now)
4. Then, choose “Checkboxes” for the “Type” below it and type “Yes, I agree to the terms of use” and don’t check Default Value
5. You can also choose “requirement” as required
6. Choose “enforce field visibility”
7. Then click updateI use a different method for registering but hope this helps.
(Sorry having difficulties posting to the forum. Apologies for duplicate replies… Wish there was a way to delete)
September 15, 2017 at 6:00 pm #268075In reply to: Multisite issue with profile syncing
xmginc
ParticipantUPDATE: found possible solution (?) by going into profile fields section in both dashboards and clicking “edit” and “update” for the required name section. This then appears to have reset things. Now the name updates in both Extended Profile tab and the WordPress default Profile tab when making an edit in the member profile page.
FYI: I have found several times now that there are strange quirks but I’m sure it is 99% user error (mine) but not everything is straightforward such as this above. To find this method took quite some time trying every standard option and the last was clicking every option over again…
September 8, 2017 at 2:34 pm #267962Peter Hardy-vanDoorn
ParticipantActually, ‘Admin’, ‘Everyone (Admin Editable)’ and ‘Only Me (Admin Editable)’ are not part of BuddyPress and are added by the plugin.
If you use the plugin and set the field visibility to ‘Only Me (Admin Editable)’ then the field will only be visible to the user and the Admin. You could also use the ‘Admin’ settings to, for example, add notes about the user that the user can’t see.
The plugin initially sets the admin to be the main admin account, but it gives this code snippet in its FAQs to enable you to set the capability required, so editors can also see the field:
function custom_profile_fields_visibility() { return ‘edit_others_posts’; // Editors } add_filter( ‘bp_admin_only_profile_fields_cap’, ‘custom_profile_fields_visibility’ );September 6, 2017 at 1:46 pm #267900In reply to: registration page styling
zo1234
ParticipantI use the #1 selling wordpress theme Newspaper by tagdiv, and it’s mainly the User Profile & Registration page that can use some tweaking. Also I wish there was a way or easy way to add more user fields to the Member Directory – like a responsive and sortable table format.
I appreciate the work that is put in to Buddy Press, the versatility of it, and that it’s a free plugin, but I think it is being short-changed by not having a premium version that can make it look ‘prettier’. Not sure who’s in charge of the business operations, but should consider a premium add-on for UI/UX. People really would pay for it. Look at Ultimate Member. Buddy Press has a leg-up on them because you have more scale-ability with all the 3rd party add-ons, better performance, and larger user base.
I have had to paid a php guy to customize it, but I need more customizations. This is the only plugin stopping my site from blowing up. Do any of you BPers do custom work? I’ll pay for any custom work to get the layout moved around on User Profile (https://ibb.co/gNat1v) + sortable table Member Directory.
I’d go with Ultimate Member for looks alone, but it slows the crap out of my site and it doesn’t have some of the BP add-ons I want. If Buddy Press looked like UM or BuddyBoss, but kept the drop down menu user section (like Twitter), I’d be your first paying customer.
August 31, 2017 at 9:21 am #267803In reply to: Hide a group of Profile Fields
artempr
ParticipantHi. If it still an issue , I d recommend you to look at bp-xprofile-settings.php
function bp_xprofile_get_settings_fields( $args = '' ) { //if u have ome custom user roles you can simply filter here which groups to hide if(!current_user_can("owner")){ $query='5,6,4'; }else{ $query='1,3,4,5'; } // Parse the possible arguments. $r = bp_parse_args( $args, array( 'user_id' => bp_displayed_user_id(), 'profile_group_id' => false, 'hide_empty_groups' => false, 'hide_empty_fields' => false, 'fetch_fields' => true, 'fetch_field_data' => false, 'fetch_visibility_level' => true, 'exclude_groups' => $query, 'exclude_fields' => false ), 'xprofile_get_settings_fields' ); return bp_has_profile( $r ); } -
AuthorSearch Results