function xprofile_handle_signup_avatar($user_id, $meta)
{
    $resized = $meta['avatar_image_resized'];
    $original = $meta['avatar_image_original'];
    if (!empty($resized) && !empty($original)) {
        // Create and set up the upload dir first.
        $upload_dir = bp_core_avatar_upload_dir(false, $user_id);
        $resized_strip_path = explode('/', $resized);
        $original_strip_path = explode('/', $original);
        $resized_filename = $resized_strip_path[count($resized_strip_path) - 1];
        $original_filename = $original_strip_path[count($original_strip_path) - 1];
        $resized_new = $upload_dir['path'] . '/' . $resized_filename;
        $original_new = $upload_dir['path'] . '/' . $original_filename;
        @copy($resized, $resized_new);
        @copy($original, $original_new);
        @unlink($resized);
        @unlink($original);
        $resized = $resized_new;
        $original = $original_new;
        // Render the cropper UI
        $action = bp_activation_page(false) . '?key=' . $_GET['key'] . '&cropped=true';
        bp_core_render_avatar_cropper($original, $resized, $action, $user_id);
    }
}
function bp_core_activation_signup_user_notification($user, $user_email, $key, $meta)
{
    global $current_site;
    // Send email with activation link.
    $admin_email = get_site_option("admin_email");
    if (empty($admin_email)) {
        $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    }
    $from_name = '' == get_site_option("site_name") ? 'WordPress' : wp_specialchars(get_site_option("site_name"));
    $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    $message = apply_filters('wpmu_signup_user_notification_email', sprintf(__("To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n", 'buddypress'), clean_url(bp_activation_page(false) . "?key={$key}")));
    $subject = apply_filters('wpmu_signup_user_notification_subject', sprintf(__('Activate %s', 'buddypress'), $user));
    wp_mail($user_email, $subject, $message, $message_headers);
    // Return false to stop the original WPMU function from continuing
    return false;
}