Search Results for 'profile fields'
-
AuthorSearch Results
-
September 29, 2015 at 10:16 pm #244926
In reply to: mySql querry help
shaunik
Participant@danbp: not sure why not working it comes with error
MySQL said: Not unique table/alias: 'wp_bp_xprofile_data'Tried query in phpmyadmin, same error:
SELECT wp_bp_xprofile_data.value, wp_users.user_email, wp_users.display_name FROM wp_users LEFT JOIN wp_bp_xprofile_data ON wp_bp_xprofile_data.user_id = wp_user.ID LEFT JOIN wp_bp_xprofile_data ON wp_bp_xprofile_fields.id = wp_bp_xprofile_data.field_id LIMIT 0, 30 MySQL said: Documentation #1066 - Not unique table/alias: 'wp_bp_xprofile_data'@shanebp: I wish wpdatatables allow php functions … it does’t
September 29, 2015 at 3:50 pm #244913In reply to: Profile Field Text Area Max Character or Word Length
@mcuk
ParticipantHi @danbp thanks for reply.
Tried the code you wrote in the link above and it works fine. But as with the one referenced in my first post it reduces the string length upon display rather than preventing the user typing in a large number of characters in the first place (and the data being stored in database).
So moved onto looking at the code snippet by @henrywright for the sign up page. Would be suitable if i could convert it to work with profile fields. Got to this stage with a few q’s:
function my_textarea_validation() { $custom_field_id = bp_get_member_profile_data( 'field=Mini Bio' ); //is the use of $_POST['field_' . $custom_field_id] correct to access desired profile field? if ( strlen( $_POST['field_' .$custom_field_id] ) > 5 ) { global $bp; //which $bp->... error message to use? $bp->signup->errors['field_'] = __( 'CUSTOM ERROR MESSAGE', 'buddypress' ); } } //which hook to use? (to affect the textarea on Profile > Edit navigation tab) add_action( '???', 'my_textarea_validation' );September 24, 2015 at 4:49 pm #244765In reply to: Edit profile groups on single page
DanielEngelhardt
Participanti did it that way and it worked for me. so i now have all my profile fields in one group and display only one of the fields on the registration-page
September 23, 2015 at 3:34 pm #244718danbp
ParticipantYou can add custom option fields for References and Places Worked:
Not sure that adding a memberlist as drop down is very clever. What if you get a community of hundreds of members ?
To get database info, see here: (that’s a common WP task)
https://codex.wordpress.org/Class_Reference/wpdbSeptember 22, 2015 at 9:56 pm #244694In reply to: Edit profile groups on single page
shanebp
ModeratorThen create a template overload of this file:
buddypress\bp-templates\bp-legacy\buddypress\members\register.phpIn that file, prevent the display of certain fields by checking them by using
bp_get_the_profile_field_id()orbp_get_the_profile_field_input_name()
in the loop:while ( bp_profile_fields() ) : bp_the_profile_field();September 22, 2015 at 9:33 pm #244692In reply to: Edit profile groups on single page
DanielEngelhardt
Participantthanks for your input, @danbp.
There is, of course, a reason why i want it as requested 🙂
On my registration form, i only want to show one field to not bother new users with unnecessary fields. this one field is in my base group.
All other fields are arranged in another group.From my point of view, it doesn’t make sense to show two tabs on the profile-edit page, but it does make sense to show as less fields as possible on the registration page. I think UX comes first today. Customers pay our rent, so we should avoid putting spokes in there wheel. I also think buddypress is doing a pretty bad job here regarding UX (Of course this behavior gives structure, but we pay with UX for it). Since we live in 2015 it shouldn’t be a matter of “hacking” to reduce the amount of inputs and clicks for such “trivial” actions (from a users perspective) like editing a profile.
Is that reason enough? 🙂
September 22, 2015 at 3:44 pm #244689In reply to: Edit profile groups on single page
danbp
ParticipantTo get all fields on the same tab, you simply add them to the Base tab. Users can then fill in anything from one tab and profile will show only one tab.
This will spare you a lot of time to tweak the original form.
First topic mention: So the user can edit and save all fields without clicking through serveral tabs.
If, as site owner, you create profile field group it is probably because you want some structurized output.Now, before hacking, you have to ask yourself about what you want: structure or UX. And IMHO in this case, the user comes in second position.
Another point of view, if it so “complicated” for user to fill in several tabs, consider your work first and justify why you have so many fields, that your user consider it is a mess to fill them… 😉September 18, 2015 at 12:03 pm #244549JECPFG
ParticipantHi djsteveb, I appreciate that but it’s been several days since I asked on the wpmudev’s support forums and they haven’t replied yet, so I’m anticipating the “you’ll need to ask BuddyPress” response. I figure if I ask in both forums, one side may have an answer.
And since this is a function of the BuddyPress Profile Fields, I assumed I might have a better chance of getting a response here anyway. I know this isn’t overly complex for someone who knows the answer, I’m just hoping to find someone who does.
September 17, 2015 at 9:17 pm #244526In reply to: Auto Affiliate Link and Call Functions
danbp
ParticipantYou’re lucky !
Download the latest version of the plugin, as it seems that this is now in since 101 minutes:
Added support for Buddypress custom profile fieldshttps://plugins.trac.wordpress.org/browser/wp-auto-affiliate-links/
September 10, 2015 at 3:18 am #244209rezon8dev
ParticipantOK yup that does it. A question and one more request. @danbp I really do appreciate this, you’re helping me learn some basic stuff and some more detail on BP in general!
Question, why does bp_member_profile_data pull in the array data but not print the classes?
Request, I need the fields returned from musical genre to all be on one line and they should be if all the values of the array are returned wrapped in the class rather than than each of the values being wrapped in the class, I just can’t figure out the syntax to make that happen…
Thanks a million!
September 9, 2015 at 11:39 pm #244205In reply to: Add a Text Area Field
danbp
Participanthi,
Dashboard > Users > Profile Fields > Add new fieldName []
Description []
Type > select Multi-line Text AreaSeptember 9, 2015 at 10:47 pm #244201danbp
ParticipantOk, i see… multiselectbox/checkbox values are returned in a array.
if ( $data = bp_member_profile_data( 'field=Musical Genre' ) )....endif;thing cannot work, because we have to fetch the whole array of values, not only one.
Give this a try:function custom_display_xprofile_fields() { if ( $data = bp_get_profile_field_data( 'field=Artist Name' ) ) : echo '<div class="artist"><h4 class="user-nicename">'. xprofile_get_field_data( 'Artist Name', bp_displayed_user_id() ) .'</h4></div>'; endif; if ( $datas = bp_get_profile_field_data( array( 'field' => 'Musical Genre' ) ) ) : foreach ( $datas as $data ) { echo '<div class="genre">'. $data .'</div>'; } endif; if ( $data = bp_get_profile_field_data( 'field=Location' ) ) : echo '<div class="location">'. xprofile_get_field_data( 'Location', bp_displayed_user_id() ) .'</div>'; endif; } add_action( 'bp_profile_header_meta' , 'custom_display_xprofile_fields' );September 9, 2015 at 6:50 pm #244198rezon8dev
ParticipantChanging the function to this:
/* * Add xprofile fields to member header */ function custom_display_xprofile_fields() { if ( $data = bp_get_profile_field_data( 'field=Artist Name' ) ) : echo '<div class="mdetcenter"><div class="artist"><h4 class="user-nicename">'. xprofile_get_field_data( 'Artist Name', bp_displayed_user_id() ) .'</h4></div></div>'; endif; if ( $data = bp_member_profile_data( 'field=Musical Genre' ) ) : echo '<div class="mdetcenter"><div class="genre">'. xprofile_get_field_data( 'Musical Genre', bp_displayed_user_id() ) .'</div></div>'; endif; if ( $data = bp_get_profile_field_data( 'field=Location' ) ) : echo '<br>'; echo '<div class="mdetcenter"><div class="location">'. xprofile_get_field_data( 'Location', bp_displayed_user_id() ) .'</div></div>'; endif;Gives me this HTML output:
<div class="mdetcenter"><div class="artist"><h4 class="user-nicename">No Way Back</h4></div></div> Alternative, Blues, Country, Electronic <br><div class="mdetcenter"><div class="location">Detroit, MI. US</div></div>September 9, 2015 at 4:50 pm #244190rezon8dev
ParticipantOK this mostly worked and I do not know how to fix the portion that is not working. I’ve entered this:
/* * Add xprofile fields to member header */ function custom_display_xprofile_fields() { if ( $data = bp_get_profile_field_data( 'field=Artist Name' ) ) : echo '<div class="mdetcenter artist"><h4 class="user-nicename">'. xprofile_get_field_data( 'Artist Name', bp_displayed_user_id() ) .'</div>'; endif; if ( $data = bp_get_profile_field_data( 'field=Musical Genre' ) ) : echo '<div class="mdetcenter genre">'. xprofile_get_field_data( 'Musical Genre', bp_displayed_user_id() ) .'</div>'; endif; if ( $data = bp_get_profile_field_data( 'field=Location' ) ) : echo '<div class="mdetcenter location">'. xprofile_get_field_data( 'Location', bp_displayed_user_id() ) .'</div>'; endif; } add_action( 'bp_profile_header_meta' , 'custom_display_xprofile_fields' ); add_filter( 'bp_before_member_header_meta', 'custom_display_xprofile_fields' );The Musical Genre field is a multi-select field type and the echo is printing “array” rather than the array of selected values in this field…
@danbp can you help here?September 9, 2015 at 4:32 pm #244188danbp
ParticipantHow else would I override the buddypress file unless it was in my child theme with the same name?
You should NOT override core files. The only files you alter from child theme are template files.
To alter core functions, you use custom functions and add them via filter hooks, preferably added to bp-custom.php – so you won’t loose your work at next update.
member-profile.php doesn’t exist in BuddyPress.
Codex is your friend !
… and forum search too. 😉
September 9, 2015 at 3:49 pm #244184danbp
ParticipantIs your child theme working correctly with Kleo ?
Is the altered member-header.php file in your child-theme ?
Do you really use a file called member-profile.php, as stated in your first topic ? Bad !Remove all your custom snippets and revert back to original BP template fisrt, then try this in bp-custom.php:
function custom_display_xprofile_fields() { echo 'Custom display fields'; echo '<ul>'; if ( $data = bp_get_profile_field_data( 'field=Artist Name' ) ) : echo '<li>'. xprofile_get_field_data( 'Artist Name', bp_displayed_user_id() ) .'</li>'; endif; if ( $data = bp_get_profile_field_data( 'field=Musical Genre' ) ) : echo '<li>'. xprofile_get_field_data( 'Musical Genre', bp_displayed_user_id() ) .'</li>'; endif; if ( $data = bp_get_profile_field_data( 'field=Location' ) ) : echo '<li>'. xprofile_get_field_data( 'Location', bp_displayed_user_id() ) .'</li>'; endif; echo '</ul>'; } add_action( 'bp_profile_header_meta' , 'custom_display_xprofile_fields' ); add_filter( 'bp_before_member_header_meta', 'custom_display_xprofile_fields' );September 9, 2015 at 2:52 pm #244181rezon8dev
ParticipantHas anyone seen the duplicating profile fields issue happen when displaying xprofile fields in the member header before?
September 8, 2015 at 11:37 pm #244175rezon8dev
ParticipantOK will do @shanebp.
Can anyone give me a hand and let me know if this code looks proper? Even if I remove this from my child theme functions.php file and add the following to my member-header.php file:bp_member_profile_data( 'field=Artist Name' ); bp_member_profile_data( 'field=Musical Genre' ); bp_member_profile_data( 'field=Location' );I get similar results; the custom fields being displayed multiple times, oddly when I add the above to the member-header.php I get the Artist name field showing 4 times in a row rather than repeating sets of fields 1-4 and then fields 1-4 again duplicating when the code in a previous post above is in the functions file…
September 8, 2015 at 10:32 pm #244172rezon8dev
Participant@shanebp, I’ve tracked it down but still cant figure out what is wrong. This was all working until I upgraded to the latest bp… It is in my functions file for my theme, it is this function to place 3 xprofile fields in the member header area:
/** * Add extended profile fields to the member profile header area */ add_action( 'bp_profile_header_meta' , 'display_user_xprofile_fields' ); function display_user_xprofile_fields() { $artistname = bp_get_member_profile_data('field=Artist Name'); $musicalgenre = bp_get_member_profile_data('field=Musical Genre'); $location = bp_get_member_profile_data('field=Location'); if ($artistname || $musicalgenre || $location) { echo '<div class="mdetcenter artist"><h4 class="user-nicename">'. '' . $artistname . '</h4></div>'; echo '<div class="mdetcenter genre">'. '' . $musicalgenre . '</div>'; echo '<div class="mdetcenter location">'. '' . $location . '</div>'; } }Can you see what is wrong? This is driving me crazy…
September 8, 2015 at 6:34 pm #244168shanebp
Moderator>they now see their profile fields displayed 2 times.
Rhetorical questions:
As 2 sets or double entries?
Does the issue remain if you remove the 3rd shortcode?It should be easy to narrow it down by following the clues given when you explore those questions.
September 7, 2015 at 4:34 pm #244152In reply to: required Username twice at Registration
modemlooper
Moderatorthe column on the right are added profile fields, you can remove the field from the admin
more info on profile fields https://codex.buddypress.org/administrator-guide/extended-profiles/
September 6, 2015 at 10:53 pm #244138In reply to: required Username twice at Registration
nilje
ParticipantNo, there is no other plugin which could cause it
I’ve made a screenshot
http://www.danielaholl.de/Apublic/Unbenannt-1.jpg
I think the left side is the WordPress registration and right the one for buddypress.. there are my custom profile fields too.September 6, 2015 at 7:13 pm #244123In reply to: How to use bp_member_profile_data when its type URL
danbp
ParticipantTake a look at DB tables related to xprofile:
_bp_xprofile_data
_bp_xprofile_fields
_bp_xprofile_groups
_bp_xprofile_metaIf users entered data like
https://twitter.com/comandovictoruse a mysql command to wipe outhttps://twitter.com/via phpMyAdmin.UPDATE table_name SET col_name = REPLACE(col_name, 'old_value', 'new_value');wp_ is default table prefix, change it if you use another prefix.
UPDATE wp_bp_xprofile_data SET col_name = REPLACE(value, 'https://twitter.com/', '');That’s the fastest method. Don’t forget to backup the table BEFORE doing this.
Changing the field type can be done from the xprofile admin.
September 6, 2015 at 8:32 am #244118In reply to: Profile Signature
danbp
ParticipantIt is standard! At least if you use xprofile component to let your users enter their signature.
1) Create a new field. Call it Signature and give it a textarea type.
2) Once this field is edited by a user, during registration or later, the signature appears on his profile.3) if you want this field somewhere else, for ex on the profile header, you simply write a function to call this field and hook it into the template you want.
Ie. Add this to child theme functions.php or bp-custom.php
function my_signature() { if ( bp_is_active( 'xprofile' ) ) if ( $signature = xprofile_get_field_data( 'Signature', bp_get_member_user_id() ) ) : // field name; case sensitive echo $signature; endif; } add_filter( 'bp_before_member_header_meta', 'my_signature' );Or to use Henry’s advice
add_filter( 'bp_after_profile_content', 'my_signature' );Reference
August 31, 2015 at 3:40 pm #243899In reply to: Profile Fields not showing on 2.3.3
shanebp
ModeratorDid you put the profile fields in the ‘Base (Primary)’ group?
By default, only those fields appear on Register.Did you try switching to a WP theme like 2015 to determine if the issue is in your theme?
-
AuthorSearch Results