Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'registration'

Viewing 25 results - 7,201 through 7,225 (of 7,641 total)
  • Author
    Search Results
  • peterverkooijen
    Participant

    Thanks Paul!

    $meta[‘field_1’] definitely looks like something to try, although I still totally don’t “get” serialized PHP arrays.

    I was also wondering if I could just bp_user_fullname() at this point, before activation.

    Trying both now…

    EDIT:

    function synchro_wp_usermeta($user_id, $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( $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' );

    ?>

    Registration process works fine, but I with this error in the screen on activation:

    Warning: Missing argument 2 for synchro_wp_usermeta() in /serverpath/wp-content/mu-plugins/bp-custom.php on line 187

    I had taken $password out. Thought I didn’t need it. Will try again with it added back in….

    EDIT2: Adding $password only gives me a second error:

    Warning: Missing argument 2 for synchro_wp_usermeta() in /serverpath/wp-content/mu-plugins/bp-custom.php on line 187

    Warning: Missing argument 3 for synchro_wp_usermeta() in /serverpath/wp-content/mu-plugins/bp-custom.php on line 187

    Can I just take $user_id out? Is all the information I need already in that wpmu_activate_user action?

    I’ll try that next, after deleting test users. Running out of email addresses…

    #51022
    3635616
    Inactive

    so.. where is code?? where is the file than i have change?

    peterverkooijen
    Participant

    arezki, there is a Users to CSV plugin. Not sure if it also exports data from Buddypress’ xprofile table, but perhaps you could expand it.

    Getting data from the database is relatively simple. You could just write your own SQL queries as well, if you can figure out how and where the data is stored, which is not at all straightforward in the wp-wpmu-bp patchwork.

    My original question was about something else; how does data move from registration form to the database?

    I’m trying to identify what bit of code “picks up” the input from the ‘* Name’ field, id/name = “field_1”. Is it this function?:

    function xprofile_extract_signup_meta( $user_id, $meta ) {
    // Extract signup meta fields to fill out profile
    $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]}"];

    $field = new BP_XProfile_ProfileData();
    $field->user_id = $user_id;
    $field->value = $field_value;
    $field->field_id = $field_ids[$i];
    $field->last_updated = time();

    $field->save();
    }

    update_usermeta( $user_id, 'last_activity', time() );
    }

    For a plugin I need SOMETHING HERE = $fullname. The SOMETHING HERE should be the input value for field_1 from the registration form.

    I get lost in the php in the array stuff. Please help if anyone can give any more clues!

    #51010
    Paul Wong-Gibbs
    Keymaster

    It is not impossible and achieveable with a little code

    arezki
    Participant

    Speaking of which, any idea how to grab the members’ data and export them into a CSV, XLS, or whatever format for data mining? I’d love to be able to do members’ profiling based on their registration. I know WP lists the members by name and email address, but not more than that.

    Cheers

    A

    peterverkooijen
    Participant

    I think the code that actually processes the input from the registration form is in bp_xprofile/bp-xprofile-classes.php, Class BP_XProfile_ProfileData etc.

    Input data is apparently stored with function save() and the input data is a combination of field_id + value for the same $this->id.

    In the html ‘* Name’ is an optional field with the name/id field_1. I guess that’s the field_id?

    Now I need to figure out how to get a definition of $fullname out of that. I’ll look for more examples/tutorials how processing form input in php actually works…

    peterverkooijen
    Participant

    Thanks r-a-y.

    I can’t make much sense of most of that code. Does function bp_core_signup_show_user_form take the input from the form? Or does it only output the form? I guess the latter.

    I think the code that actually processes the input is in bp_xprofile/bp-xprofile-classes.php, Class BP_XProfile_ProfileData etc. Or bp-xprofile-signup.php?

    Back to the other thread to see if it gets me any further…

    r-a-y
    Keymaster

    Check:

    /wp-content/plugins/buddypress/bp-core/bp-core-signup.php

    peterverkooijen
    Participant

    You’re right r-a-y. Tried it. It had no effect on Buddypress’ registration form.

    Back to my previous attempt; I’m stuck at intercepting fullname input from the Buddypress registration form. Do you know how?

    Based on code in another plugin I put together something based on ‘$input_data’:

    function synchro_wp_usermeta($input_data) {
    global $bp, $wpdb;

    $post_data = array();
    foreach ($input_data as $varname => $varvalue) {
    $post_data[$varname] = $varvalue;
    }

    $fullname = $post_data[fullname];
    ...

    But I don’t know if that $input_data is a standard wp tag or something else. Also the structure of the xprofile tables is very different from the structure of the regular wp users tables, so I’m not sure if that ‘$input_data as $varname => $varvalue’ is applicable.

    Where is the code that processes data input from the Buddypress registration form? I’d like to use that as example, but have no clue where it is.

    r-a-y
    Keymaster

    I’m guessing it wouldn’t since WP vs. WPMU are different beasts, especially when it comes to registration.

    peterverkooijen
    Participant

    Here is a plugin that “forces users to provide first and last name upon registration” and stores them in wp_usermeta.

    Would this plugin be compatible with Buddypress? Looking into it now…

    peterverkooijen
    Participant

    Another attempt! What I really need is a variation of the xprofile_sync_wp_profile function that takes $fullname directly from the registration form and can be executed on user_register.

    That shouldn’t be too hard, right?

    function synchro_wp_usermeta() {
    global $bp, $wpdb;

    $fullname = GET FROM THE REGISTRATION FORM INPUT
    $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( 'user_register', 'synchro_wp_usermeta' );

    I have another plugin that also takes data from the registration form. That plugin has this in the code: $input_data. Is that standard wp? There’s nothing about it in the Codex.

    That other plugin has this function, minus irrelevant bits:

    function subscribe($input_data) {

    // $post_data = array();
    foreach ($input_data as $varname => $varvalue) {
    $post_data[$varname] = $varvalue;
    }

    }
    $post_data='action=subscribe&group_ids[]='.$this->lid.'&email_address='.$this->email_id.'&firstname='.$this->name_id;

    So in my case that last line would become something like this?:

    $post_data= 'first_name='.$this->first_name;

    Of course somehow put together in one function. Like this?:

    function synchro_wp_usermeta($input_data) {
    global $bp, $wpdb;

    $post_data = array();
    foreach ($input_data as $varname => $varvalue) {
    $post_data[$varname] = $varvalue;
    }

    $fullname = $post_data[fullname];
    $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( 'user_register', 'synchro_wp_usermeta' );

    Can anyone please help? What should I put here for the “fullname” field?:

    $fullname = $post_data[fullname];

    Or is the entire approach wrong?

    #50983
    peterverkooijen
    Participant

    It’s basically impossible. You have to hack core files.

    #50981
    peterverkooijen
    Participant

    I’m not creating a plugin from scratch or doing any complicated manipulations on the data. I’m only trying to pre-populate fields in the RSVP form in this Event Registration plugin.

    Adding the ‘echo’ didn’t fix the problem. It probably is something stupid like that.

    Which code actually pulls the data from xprofile? I couldn’t make much sense of function bp_user_fullname(). The real magic apparently happens somewhere else.

    Getting regular wp data works fine. If I could figure out how to consistently synchronize firstname and last name between xprofile and wp_usermeta, that would solve the problem as well.

    #50977

    In reply to: Fake IDs?

    A majority of the registration protection you would want to do currently comes from the WordPress side of it; captchya’s and what-not.

    I’ve seen it happen on a few BP sites I’ve done for clients already. Seems to come with the territory unfortunately.

    #50970
    jorrie
    Participant

    Okay thanks,

    I misconfused some terms and therefore in the thought this was complicated but indeed you right, thanks again.

    #50967
    Paul Wong-Gibbs
    Keymaster

    Just disable blog registrations in your Site Admin > Options panel. And please take some time to do a cursory search of Google or the WPMU forums as this is a basic question and nothing to do with Buddypress.

    #50961
    3635616
    Inactive

    ok i’m sorry

    devweb
    Participant

    Having looked in more depth I think this might be achievable by adding a query into the registration.php file that I assume gets executed after hitting the submit button on the signup page.

    Problem is, can’t figure out how to create the appropriate query for checking the meta field.

    Anyone offer some suggestions?

    Thanks

    #50955
    Paul Wong-Gibbs
    Keymaster

    That email is sent as part of WPMU and as such it is best to ask this at their forums. I bet this question comes up lots.

    #50875
    Paul Wong-Gibbs
    Keymaster

    Possibly. There may be something else in the database with regards to the path. I wouldn’t recommend moving an installation, I’d personally always reinstall it.

    Are you using any custom slugs and when you try to register, is there anything in your web server log? Also please see https://buddypress.org/forums/topic/when-asking-for-support

    #50869

    Could this be the issue? … I had originally installed my wordpressmu under /wordpress-mu/ but then moved it to the root later. My config file says:

    /** The Database Collate type. Don’t change this if in doubt. */

    define(‘DB_COLLATE’, ”);

    define(‘VHOST’, ‘yes’);

    $base = ‘/wordpress-mu/’;

    define(‘DOMAIN_CURRENT_SITE’, ‘cjmoloneys.com’ );

    define(‘PATH_CURRENT_SITE’, ‘/’ );

    define(‘SITE_ID_CURRENT_SITE’, 1);

    define(‘BLOGID_CURRENT_SITE’, ‘1’ );

    Is wrong with editing by hand and chaning the $base = ‘/wordpress-mu/’; ?? Everything on my site works fine except registrations. I don’t even know if this is the cause.

    webatease
    Participant

    Any update to this? Seems like someone was on to something – exactly what I need… a way to moderate the list of user registrations before it’s accepted. Any ideas – progress here?

    #50768
    peterverkooijen
    Participant

    BTW, the system lists this thread as ‘3 posts, 1 voice – Latest reply from jorrie’. Nice illustration of how unreliable user management is…

    #50766
    peterverkooijen
    Participant

    Had another look at GigaOm’s form. They have log in with email address and password and somehow managed to get rid of the username.

    Step 2 lists their subscription packages and asks for credit card details etc. Still no username/nickname/blogname.

    I’d like to know how they did it. The source mentions Kissmetrics and there’s a class called “zend_form”. Probably custom code?

Viewing 25 results - 7,201 through 7,225 (of 7,641 total)
Skip to toolbar