Search Results for 'profile fields'
-
AuthorSearch Results
-
August 31, 2009 at 10:04 pm #51844
In reply to: Making Prebuilt Profile Fields?
Andy Peatling
KeymasterThis used to be possible with CSV files, but the code was old and not that great so I’ve removed it for now.
August 31, 2009 at 8:46 pm #51838In reply to: Automatic Group Joining
takuya
ParticipantThere’s plugin that helps users to join certain groups on signup. But not based on profile fields.
August 31, 2009 at 3:29 am #51793In reply to: Making Prebuilt Profile Fields?
3612275
InactiveOk, thanks for the reply.
August 31, 2009 at 1:51 am #51790In reply to: Making Prebuilt Profile Fields?
John James Jacoby
KeymasterphpMyAdmin import/export of the tables would probably be easiest? There isn’t a method within BP to do this unfortunately, and I’m not sure it’s on the roadmap either.
August 29, 2009 at 12:21 am #51707In reply to: Private xprofile fields
Lriggle
ParticipantThanks guys, I’ll take a look!
August 28, 2009 at 7:31 pm #51700In reply to: Edit input tag profile field_1?
peterverkooijen
ParticipantI see the html for the xprofile input fields is in function get_edit_html in bp-xprofile-classes.php:
switch ( $this->type ) {
case 'textbox':
$html .= '<div class="signup-field">';
$html .= '<label class="signup-label" for="field_' . $this->id . '">' . $asterisk . $this->name . ':</label>';
$html .= $this->message . '<input type="text" name="field_' . $this->id . '" id="field_' . $this->id . '" value="' . attribute_escape( $this->data->value ) . '" />';
$html .= '<span class="signup-description">' . $this->desc . '</span>';
$html .= '</div>';
break;So I guess I could add onkeyup=”copyinput()” there, but then all xprofile fields will get that. Would that mess up the system? The Javascript refers to the fields by ID.
According to Jeff Sayre this method will be deprecated in version 1.1, but I need a temporary solution before I make the switch.
Trying that now…
August 23, 2009 at 9:41 pm #51470In reply to: Import existing user
peterverkooijen
ParticipantApparently Manoj Kumar’s very essential users import plugin does not work with the latest version:
The Big K at 19:19 on 9 August 2009
Hi Manoj,
The plugin is not compatible with WPMU 2.8.3 & Buddypress 1.0.3. Could you please fix it.
This is also the version of the plugin I’ve tried – I gave the wrong link earlier.
In my installation the plugin worked for the essentials – username, email address – but nothing was added to meta in wp_signup and the xprofile fields.
Next I’ll try it in a fresh install of Buddypress 1.0 RC…
August 23, 2009 at 4:18 pm #51449In reply to: Show xprofile data?
Treblamah
ParticipantThis should help:
I had to separate the fields by group to pull only one field at a time that preserved the formatting. The other ways I found to pull individual field data produced text without line breaks.
August 22, 2009 at 12:59 am #51398r-a-y
KeymasterDitto!
August 21, 2009 at 11:58 pm #51395peterverkooijen
ParticipantI’d like to test this plugin as well.
August 21, 2009 at 11:40 pm #51392In reply to: Extended Profiles on Sign up?
Nightlyfe
Participantcan the default / built in profile system be extended to have advanced & fully developed profiles (custom fields and such)?
what is gained by going with bp if so?
August 21, 2009 at 11:25 pm #51390Nightlyfe
ParticipantDid this get released?
August 20, 2009 at 12:04 am #51279In reply to: Clean professional user registration?
peterverkooijen
ParticipantThe html of the custom xprofile fields is generated by yet another function; get_edit_html() in bp-xprofile-classes.php. So if you want to change anything in the custom fields, including the * for required fields, you’ll need to copy/rename that function to bp-custom.php as well.
EDIT: …which is not straightforward:
Fatal error: Call to undefined method BP_XProfile_Field::custom_get_edit_html() in /serverpath/wp-content/mu-plugins/bp-custom.php on line 256
August 19, 2009 at 8:50 pm #51271In reply to: Autogenerate or remove username
peterverkooijen
ParticipantIf so, the display name is still editable via the “Edit Profile” screen (like I stated above). Not sure what would happen if you attempted to change the display name… would it sync up with the usermeta table?
Yes it does, that’s what the original xprofile_sync_wp_profile() already did, although I think you can turn it off in the admin area. Even if you did that, it wouldn’t mess up anything vital.
My main concern was to consistently get a separate first name + last name in the database, because I need them for several other scripts. That only needs to happen on activation.
Also I needed to learn how to use the fullname value in a function so I could autogenerate a username from it.
Re: rearranging the signup page… BP 1.1 will enable you to move fields around on the sign up page. Check out testbp.org as an example of a customized register page.
I need my site done before Labor Day or September 1st really. And the new more versatile template system does not solve any of my other issues.
August 19, 2009 at 8:41 pm #51270In reply to: Clean professional user registration?
peterverkooijen
ParticipantTemporary solution how to customize registration form until 1.1 arrives, FYI and my own reference:
Changed this line in function bp_show_register_page() in functions.php in my template:
require ( BP_PLUGIN_DIR . '/bp-core/bp-core-signup.php' );to
require ( 'custom-signup.php' );Copied bp-core-signup.php to the template folder, renamed to custom-signup.php.
Go customize!

Unfortunately the custom fields are generated by yet another core function:
do_action( 'signup_extra_fields', $errors );This action is associated with the function xprofile_add_signup_fields in bp-xprofile/bp-xprofile-signup.php.
Copied the function to bp-custom.php, renamed action and function to custom_signup_extra_fields and custom_xprofile_add_signup_fields.
Used this CSS trick to hide the avatar upload. Will use the same trick to hide the username field.
August 19, 2009 at 8:25 pm #51269In reply to: Autogenerate or remove username
r-a-y
KeymasterOh sorry! I think I’m confusing what you’re trying to do.
You’re trying to auto-generate the username based off the display name xprofile field, correct?
If so, the display name is still editable via the “Edit Profile” screen (like I stated above). Not sure what would happen if you attempted to change the display name… would it sync up with the usermeta table?
My guess from the post I wrote above is “no”, since you only have your function running when a user has activated their account. But I guess that’s the point!
—
Re: rearranging the signup page… BP 1.1 will enable you to move fields around on the sign up page. Check out testbp.org as an example of a customized register page.
August 19, 2009 at 4:58 pm #51259In reply to: Autogenerate or remove username
peterverkooijen
ParticipantThis function for bp-custom.php adds fullname from xprofile field_1 to wp_usermeta.
function synchro_wp_usermeta($user_id, $password, $meta) {
global $bp, $wpdb;
$fullname = $meta[field_1];
$space = strpos( $fullname, ' ' );
if ( false === $space ) {
$firstname = $fullname;
$lastname = '';
} else {
$firstname = substr( $fullname, 0, $space );
$lastname = trim( substr( $fullname, $space, strlen($fullname) ) );
}
update_usermeta( $user_id, 'nickname', $fullname );
update_usermeta( $user_id, 'first_name', $firstname );
update_usermeta( $user_id, 'last_name', $lastname );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $user_id ), $user_id ) );
}
add_action( 'wpmu_activate_user', 'synchro_wp_usermeta', 10, 3);It shouldn’t be a big step to make the fullname lowercase, strip the spaces and store it as username.
Make lowercase and strip space looks something like this:
$str = strtolower($str);
$str = str_replace(' ', '', $str);But does the system even allow changing the username at the wpmu_activate_user stage?
The username is stored in four places in the database:
wp_signups -> user_login
wp_users -> user_login
wp_users -> user_nicename (?!)
wp_users -> user_url (as last part)
Manually changing the username at these points in the database does NOT screw up my system. Login with email address continues to work fine with the same password. The profile page and links function as normal.

That is good news. It means it is possible to simply update the username from this same function.
Now I just have to figure out the PHP and the queries for those four fields. Any pointers apprecriated!
EDIT: Is $user_id a number or the username? That could complicate things…
I assume $user_id is the username. Can I make this a two-stage rocket? First run the synchro_wp_usermeta function and then a separate function to deal with username, synchro_name_username? Put them in a plugin with something like this at the bottom?:
add_action( 'wpmu_activate_user', 'synchro_wp_usermeta', 10, 3);
add_action( 'wpmu_activate_user', 'synchro_name_username');Would that execute the functions in the right order?
August 18, 2009 at 7:19 pm #51213In reply to: Clean professional user registration?
peterverkooijen
ParticipantBTW, how will fullname/firstname+lastname be handled in the new version? Will it be synchronized with wp_usermeta? Or will there be built-in fields in xprofile? Or another solution?
Will there be an option to make them required? Will you offer an option to autogenerate username from fullname?
Trying to decide which way to go for temporary solutions.
August 17, 2009 at 10:48 pm #51187peterverkooijen
ParticipantWhen I do this:
$fullname = $wpdb->get_var("SELECT meta FROM $wpdb->signups");
echo $fullname;I get the serialized content of the first meta field in wp_signups:
a:8:{s:7:"field_1";s:13:"Julius Caesar";s:18:"xprofile_field_ids";s:2:"1,";s:20:"avatar_image_resized";s:84:"/serverpath/wp-content/blogs.dir/1/files/avatars/0/caesar.jpg";s:21:"avatar_image_original";s:84:"/serverpath/wp-content/blogs.dir/1/files/avatars/0/caesar.jpg";s:6:"public";s:1:"1";s:7:"lang_id";i:1;s:8:"blogname";s:9:"theempire";s:10:"blog_title";s:16:"The Roman Empire";}The function inserted this crap also into the wp_usermeta fields. Success! (Sort of…)
The bit of data I need is the fullname, the second bit, in this case ‘Julius Caesar’. I’d need the second bit of data from the user with the activation key.
How would I add that to the query?
I’ll first try this:
$fullname = $wpdb->get_var("SELECT meta FROM $wpdb->signups WHERE activation_key = %s", $key);
echo $fullname;Nothing…

I probably had to add $key as an argument. Trying again after some food…
August 17, 2009 at 6:40 pm #51172In reply to: Signatures (BBPress & BuddyPress)
gerikg
ParticipantSorry about the empty response. I thought I had it and when it didn’t work it screwed up. I edited out my post.
Okay this is the fix I came out with. I created a new group in BP profile called signature and the field name signature too.
In BBpress in the post.php I inserted (note I don’t know PHP, if anyone can shorten this would be appreciated):
<?php if ( bp_has_profile('user_id='.get_post_author_id().'&profile_group_id=XXX') ) : ?>
<?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
<?php if ( bp_profile_group_has_fields() ) : ?>
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
<?php if ( bp_field_has_data() ) : ?>
<?php bp_the_profile_field_value() ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php else: ?>
<?php endif;?>Just replace XXX with your group id #, mine was 3.
What it doesn’t do is toggle between signature, anyone want to try that?
August 16, 2009 at 5:42 pm #51107In reply to: Member directory browsing issue.
omgitsrfb
ParticipantI got the same issue with an upgrade to WPMU2.8.4a and BP1.0.3. Have two issues one is the one mentioned above by Arezki
Hi all: I noticed that the listing of members using the alphabetical feature is not working. When you go to: http://tatazara.com/members and try any letter like F or S for Francis Stevenson, you get the link: http://tatazara.com/members#f but the page stays at /members directory. Any thought?
and the other is that is gives me the ‘ol:
No members found. Members must fill in at least one piece of profile data to show in member lists.
error that othe threads have brought up.
I upgraded to bp1.0.3 to get rid of the second issue per Andy’s instructions in a previous thread, but that didn’t help.
the groups and blogs alpha directory work just as advertised but not the member alpha directory. yes, people have entered info into profile fields. the member search function works fine.
Anyone got an idea about this? Could it be something with the different types of name fields?
Thanks in advance for your advice.
August 16, 2009 at 6:03 am #51093peterverkooijen
ParticipantThe ideal registration form would look like this:
– fullname
– email address
Both fields would of course be mandatory. Ideally fullname would be checked for two or more parts, but xprofile_sync_wp_profile() can handle one part input and I can live with an occassional missing last name.
I use a jQuery validation script on another form in my site, that I may also be able to use on the registration form. As far I understand it doesn’t interfere with anything on the server side.
Username would be generated behind the scenes from fullname.
Many other member information fields would be optional under edit profile.
If I can figure out how to select fullname from meta in wp_signups, adapting xprofile_sync_wp_profile() shouldn’t be that difficult.
Or are my latest attempts above still nowhere near a solution? If you see the obvious mistakes, please point them out.
August 16, 2009 at 4:51 am #51091peterverkooijen
ParticipantMike Pratt, you’re right, that is one way to do it. Then you have the following fields on your registration form: username, name, first name, last name. That is an excellent solution if your aim is to annoy potential members.
Another option is to use the default “fullname” field for first name and create a second one for last name, but then you’re kinda messing with the system and perhaps causing problems in the future. I have already done this solution in an earlier version. It’s my fallback option.
But why would I have to create custom fields when WordPress already has the first_name and last_name fields in wp_usermeta? And there is even a ready-to-use Buddypress function that synchronizes the fields in wp_usermeta with the fullname in BP.
Unfortunately at the moment that function is only run when the user updates his profile, so it’s completely useless. I’m trying to tweak it and make it useful and introduce to Buddypress the wonders of a first_name, last_name in the database. (Wow, I know…)
Also I’d like to get rid of the username on the form, by autogenerating it from the fullname – make lowercase, take out spaces, store as username. That should be a relatively easy next step once I’ve figured out how to use the fullname input from the registration form in a function.
Also I wasn’t able to get bp tags working in a plugin, where I had no problem pulling first_name and last_name from wp_usermeta, providing they were available…
This should be a really easy plugin for any php coder, but as Jeff Sayre has pointed out, having a somewhat clean, professional user registration in Buddypress is reserved for those well-versed in the codebase or with deep-enough pockets.
@Mariusooms, I need to finish the site before Labor Day, with a related event on September 22nd. When will bp1.0.3 be released?
I’ll figure it out somehow, with or without the help of WordPress insiders.
August 16, 2009 at 3:58 am #51090Mike Pratt
ParticipantAm I missing something? All I had to do to achieve a solution to this was to create two new fields in basic called FirstName and LastName and make them mandatory on signup. Now I can ref them all I want in code later. What is the point of this huge plugin? Thee is no need to be dependent on users updating their profile since they can join without filling in these fields.
August 15, 2009 at 3:15 pm #51048peterverkooijen
ParticipantI had a good feeling about this attempt, but still nothing in wp_usermeta:
function synchro_wp_usermeta($user_id, $password, $meta) {
global $bp, $wpdb;
$field_ids = $meta['xprofile_field_ids'];
$field_ids = explode( ',', $field_ids );
// Loop through each bit of profile data and save it to profile.
for ( $i = 0; $i < count($field_ids); $i++ ) {
if ( empty( $field_ids[$i] ) ) continue;
$field_value = $meta["field_{$field_ids[$i]}"];
}
$fullname = $field_value['field_1'];
$space = strpos( $fullname, ' ' );
if ( false === $space ) {
$firstname = $fullname;
$lastname = '';
} else {
$firstname = substr( $fullname, 0, $space );
$lastname = trim( substr( $fullname, $space, strlen($fullname) ) );
}
update_usermeta( $bp->loggedin_user->id, 'nickname', $fullname );
update_usermeta( $bp->loggedin_user->id, 'first_name', $firstname );
update_usermeta( $bp->loggedin_user->id, 'last_name', $lastname );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $bp->loggedin_user->id ) );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $bp->loggedin_user->id ), $bp->loggedin_user->id ) );
}
add_action( 'wpmu_activate_user', 'synchro_wp_usermeta', 10, 3);This version messes up registration:
function synchro_wp_usermeta($user_id, $password, $meta) {
global $bp_user_signup_meta, $bp, $wpdb;
$fields = BP_XProfile_Field::get_signup_fields();
$field_ids = $meta['xprofile_field_ids'];
$field_ids = explode( ',', $field_ids );
// Loop through each bit of profile data and save it to profile.
for ( $i = 0; $i < count($field_ids); $i++ ) {
if ( empty( $field_ids[$i] ) ) continue;
$field_value = $meta["field_{$field_ids[$i]}"];
}
$fullname = $field_value['field_1'];
$space = strpos( $fullname, ' ' );
if ( false === $space ) {
$firstname = $fullname;
$lastname = '';
} else {
$firstname = substr( $fullname, 0, $space );
$lastname = trim( substr( $fullname, $space, strlen($fullname) ) );
}
update_usermeta( $bp->loggedin_user->id, 'nickname', $fullname );
update_usermeta( $bp->loggedin_user->id, 'first_name', $firstname );
update_usermeta( $bp->loggedin_user->id, 'last_name', $lastname );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $bp->loggedin_user->id ) );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $bp->loggedin_user->id ), $bp->loggedin_user->id ) );
}
add_action( 'wpmu_activate_user', 'synchro_wp_usermeta', 10, 3);Registration goes through as normal. The user gets one email with the activation link. But the page on the link says ‘Your account has already been activated. You can now log in with the account details that were emailed to you.’ No email arrives.
So the above code hijacks activation without doing anything (probably because $bp_user_signup_meta was added). Still nothing in wp_usermeta either.
My problem is getting the $fullname from $meta. I don’t understand the array stuff. I’m basically just guessing.
If there are any php coders out there that can spot any obvious mistakes or can suggest other things to try, please help me out.
-
AuthorSearch Results