Search Results for 'registration'
-
AuthorSearch Results
-
August 14, 2009 at 7:35 pm #51024
peterverkooijen
ParticipantThanks 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…
August 14, 2009 at 6:55 pm #51022In reply to: Modified mail message registration
3635616
Inactiveso.. where is code?? where is the file than i have change?
August 14, 2009 at 6:02 pm #51021peterverkooijen
Participantarezki, 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!
August 14, 2009 at 7:13 am #51010In reply to: Modified mail message registration
Paul Wong-Gibbs
KeymasterIt is not impossible and achieveable with a little code
August 14, 2009 at 6:07 am #51003arezki
ParticipantSpeaking 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
August 14, 2009 at 2:55 am #50997peterverkooijen
ParticipantI 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…
August 14, 2009 at 2:52 am #50996peterverkooijen
ParticipantThanks 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…
August 14, 2009 at 12:55 am #50995r-a-y
KeymasterCheck:
/wp-content/plugins/buddypress/bp-core/bp-core-signup.php
August 14, 2009 at 12:17 am #50993peterverkooijen
ParticipantYou’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.
August 14, 2009 at 12:13 am #50992r-a-y
KeymasterI’m guessing it wouldn’t since WP vs. WPMU are different beasts, especially when it comes to registration.
August 14, 2009 at 12:01 am #50990peterverkooijen
ParticipantHere 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…
August 13, 2009 at 10:40 pm #50989peterverkooijen
ParticipantAnother 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?
August 13, 2009 at 7:34 pm #50983In reply to: Modified mail message registration
peterverkooijen
ParticipantIt’s basically impossible. You have to hack core files.
August 13, 2009 at 7:26 pm #50981In reply to: bp tags not working in plugins?
peterverkooijen
ParticipantI’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.
John James Jacoby
KeymasterA 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.
August 13, 2009 at 4:21 pm #50970jorrie
ParticipantOkay thanks,
I misconfused some terms and therefore in the thought this was complicated but indeed you right, thanks again.
August 13, 2009 at 3:44 pm #50967Paul Wong-Gibbs
KeymasterJust 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.
August 13, 2009 at 1:43 pm #50961In reply to: Modified mail message registration
3635616
Inactiveok i’m sorry
August 13, 2009 at 1:31 pm #50960devweb
ParticipantHaving 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
August 13, 2009 at 12:33 pm #50955In reply to: Modified mail message registration
Paul Wong-Gibbs
KeymasterThat 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.
August 11, 2009 at 6:16 am #50875In reply to: New registrations not working
Paul Wong-Gibbs
KeymasterPossibly. 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
August 11, 2009 at 12:55 am #50869In reply to: New registrations not working
Sarah Gooding
MemberCould 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.
August 10, 2009 at 8:40 pm #50859webatease
ParticipantAny 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?
August 8, 2009 at 2:34 pm #50768In reply to: Clean professional user registration?
peterverkooijen
ParticipantBTW, the system lists this thread as ‘3 posts, 1 voice – Latest reply from jorrie’. Nice illustration of how unreliable user management is…
August 8, 2009 at 2:31 pm #50766In reply to: Clean professional user registration?
peterverkooijen
ParticipantHad 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?
-
AuthorSearch Results