@ezbizniz
14 years, 1 month ago
I disabled the default BP function to add all blogs to BP DB table with `add_site_option(‘bp-blogs-first-install’, 1);`
Instead I do my own BP blogs installation for each blog during upgrade:
`function bp_blogs_install_after_multisite_upgrade($blog_id) { echo(‘Blog ID ‘ . $blog_id . ‘:‘); if(!get_blog_option($blog_id, ‘bp-blog-recorded’)) { $users = get_users_of_blog( $blog_id );
if ( $users ) { foreach ( (array)$users as $user ) { $role = unserialize( $user->meta_value );
if ( !isset( $role ) ) bp_blogs_record_blog( $blog_id, $user->user_id, true ); }
add_blog_option($blog_id, ‘bp-blog-recorded’, ‘true’); echo(‘Blog ID ‘ . $blog_id . ‘ added to BuddyPress database.‘); } } else { echo(‘Blog ID ‘ . $blog_id . ‘ already in BuddyPress.‘); } }
add_site_option(‘bp-blogs-first-install’, 1); add_action(‘wpmu_upgrade_site’, ‘bp_blogs_install_after_multisite_upgrade’); `
14 years, 2 months ago
Thanks for your suggestions hnla, I’ll try them.
Any idea what I should set the memory_limit to?
These are my resource limits in php.ini: max_execution_time = 30 max_input_time = 120 memory_limit = 256M