Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 3,276 through 3,300 (of 3,585 total)
  • Author
    Search Results
  • #51877
    Jeff Sayre
    Participant

    What you need to do depends on what name is in question. Is it the member’s first, last, or nick name? Is it their full name which is displayed in the profile pane of BuddyPress? The data for those names are stored in two different places.

    Also I editted his name from admin dashboard, but the name does not change? Is this a bug?

    Since usernames (login names) cannot be changed, you must have tried changing either the first, last, or nick name. Did the questionable name even appear in any of those fields? Did you also select the newly-changed name in the “Display name publicly as” drop down list?

    But, based on what you are saying here, I assume that the questionable name is the member’s BuddyPress full name. This can only be changed in the profile pane by the user. Currently the only recourse a Site Admin has is to go into MySQL’s backend and find the questionable field in the wp_bp_xprofile_data table.

    Make sure that whatever changes you made to the user’s name in WPMU’s backend, you make in this table as well.

    Just to give you a little more background into what is happening:

    • When a user updates (changes) their name in the Full Name field in the BuddyPress profile pane, the changes do propagate throughout the MySQL DB. The datum in the following tables are properly updated: wp_bp_xprofile_data, wp_users, and wp_usermeta
    • But, if you make changes to a user’s nickname field in WPMU’s backend, the changes are written to wp_usermeta only for that field. The changes are not written to the wp_bp_xprofile_data or wp_users table. You can have the changes written to the wp_users table if you select the proper value from the “Display name publicly as” drop down list. But, they are never written to the corresponding BuddyPress table.
    • Finally, and this is even more confusing, changes to the nickname field are not written to the first name or last name meta values in the wp_usermeta table. Conversly, if you change the first name and/or last name fields, they are not combined and also written to the nickname field in wp_usermeta

    So, there could be improvements in the way WPMU handles user name changes. But, it is a WPMU issue since changes at the Site Admin level in the backend are controlled by WPMU and not BuddyPress.

    #51863
    Jeff Sayre
    Participant

    r-a-y

    There are a number of new hooks and an array object that need to be available for the privacy component to function. Although the alpha versions may work with v1.1, the full-blown version is really targeted for v1.2 and will require that as a minimum.

    Concerning your wire post, for some reason, I believe that I never received that email. Strange, since I do have all my email notifications set to “Yes”.

    But, to answer that specific question, your direct calls to xprofile fields should still function properly. Since you are pulling your data directly from the table and not from a templatetag function, you should be fine. Now, if you want your direct calls to be subjected to privacy control, then that is a different matter. You would then need to pull your data after the fields array has been filtered.

    There is a separate table that gets installed that handles all privacy object settings. The privacy component filters the fields array that populates the profile page, removing any field-level elements that a given user chooses to hide from a given viewer category.

    #51844
    Andy Peatling
    Keymaster

    This used to be possible with CSV files, but the code was old and not that great so I’ve removed it for now.

    #51838
    takuya
    Participant

    There’s plugin that helps users to join certain groups on signup. But not based on profile fields.

    #51793
    3612275
    Inactive

    Ok, thanks for the reply.

    #51790

    phpMyAdmin 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.

    #51707
    Lriggle
    Participant

    Thanks guys, I’ll take a look!

    #51700
    peterverkooijen
    Participant

    I 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…

    #51470

    In reply to: Import existing user

    peterverkooijen
    Participant

    Apparently 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… :-(

    #51449

    In reply to: Show xprofile data?

    Treblamah
    Participant

    This should help:

    https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-profile-data-loop-bp_has_profile/

    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.

    r-a-y
    Keymaster

    Ditto!

    peterverkooijen
    Participant

    I’d like to test this plugin as well.

    #51392
    Nightlyfe
    Participant

    can 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?

    Nightlyfe
    Participant

    Did this get released?

    #51279
    peterverkooijen
    Participant

    The 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

    #51271
    peterverkooijen
    Participant

    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?

    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.

    #51270
    peterverkooijen
    Participant

    Temporary 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.

    #51269
    r-a-y
    Keymaster

    Oh 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.

    #51259
    peterverkooijen
    Participant

    This 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?

    #51213
    peterverkooijen
    Participant

    BTW, 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.

    peterverkooijen
    Participant

    When 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…

    #51172
    gerikg
    Participant

    Sorry 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?

    #51107
    omgitsrfb
    Participant

    I 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.

    peterverkooijen
    Participant

    The 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.

    peterverkooijen
    Participant

    Mike 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.

Viewing 25 results - 3,276 through 3,300 (of 3,585 total)
Skip to toolbar