Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I had made a community with a different plugin (I think it was mingle. I recently installed buddypress, removed mingle and changed the site to suite. Now the problem is the existing users are not listed as members in the members page, only me, the admin. I have looked for, but not found, a solution. i am know how to use Wordpress but this one has stumped me. This may be an easy question for all those experienced buddypress users out there, but I am just starting, so keep that in mind before you say how completely dumb I am :)

Thanks for taking the time to read this.

share|improve this question
    
This is not really going to be answerable without knowing how that "different plugin" managed users. It seems to have had its own internal system, but that is just a guess. Can you come up with more detail? –  s_ha_dum Feb 19 '13 at 15:20

1 Answer 1

up vote 0 down vote accepted

The following plugin will make all WordPress users to appear on BuddyPress members directory. It doesn't provide full migration of users, but it will update the last_activity user meta field that is used by BP to display users.

This is a plugin code, so you need to create a new php file (eg. bp-add-users.php) and upload it to plugins directory of your WP installation wp-content/plugins. When you activate the plugin it will update all users, after that you can deactivate and delete:

/*
Plugin Name:  BP User Updater
Description:  Update `last_activity` user meta for all users.
Author:       Ahmad M
 */

register_activation_hook(__FILE__, 'add_users_to_bp');

function add_users_to_bp() {

    $users = get_users();

    foreach ($users as $user) {
        update_user_meta($user->ID, 'last_activity', date("Y-m-d H:i:s"));
    }
}
share|improve this answer
    
Did what you said, added the plugin. Did not work! broke the website, had to deactivate, users still the same! Is this code you gave me wrong? –  Stonydallas Feb 21 '13 at 6:45
1  
How exactly it broke the website? What messages/debug information it shows you? This code simply will get all your WP users, loop through them to update each last_activity field to the current date, and I have tested it with no issues. You also can hook add_users_to_bp() function above to init action in functions.php and visit your website once to trigger this update and after that delete the code from functions.php so it wont be triggered on each request (add_action('init', 'add_users_to_bp');). –  Ahmad M Feb 21 '13 at 7:38
    
First there's this at the top of the admin "The plugin generated 364 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin." –  Stonydallas Feb 24 '13 at 1:32
    
Also this every page "/* Plugin Name: BP User Updater Description: Update last_activity user meta for all users. Author: Ahmad M */ register_activation_hook(FILE, 'add_users_to_bp'); function add_users_to_bp() { $users = get_users(); foreach ($users as $user) { update_user_meta($user->ID, 'last_activity', date("Y-m-d H:i:s")); } } Warning: Cannot modify header information - headers already sent by (output started at /home/dallas88/public_html/Apps4You/wp-content/plugins/bp-add-user/bp-add-users.‌​php:16) in /home/dallas88/public_html/Apps4You/wp-includes/pluggable.php on line 876" –  Stonydallas Feb 24 '13 at 1:33
    
I did nothing to the function.php, I only added the plugin. Sorry for 3 comments, I cant fit all that code in a single comment. –  Stonydallas Feb 24 '13 at 1:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.