Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • `

      <?php while ( bp_members() ) : bp_the_member();
      $exclude_ids = array(1,3); /* member ids to exclude from listing */
      if (!in_array(bp_get_member_user_id(), $exclude_ids)) {
      ?>`

    My solution is to modify members-loop.php (I’m using template pack)

      <?php while ( bp_members() ) : bp_the_member();
      $exclude_ids = array(1,3); /* member ids to exclude from listing */
      if (!in_array(bp_get_member_user_id(), $exclude_ids)) {
      ?>

    My 3 step solution to this problem is as follows:

    1. Install plugin – BuddyPress Pending Activations (https://wordpress.org/extend/plugins/buddypress-pending-activations/)
    2. Make hack to plugin function bp_pending_activations_admin() so that it sends an email when a user is activated:
    $resendusers = $wpdb->get_results( $wpdb->prepare( “SELECT u.ID, u.user_login, u.user_email, m.meta_value FROM ” . CUSTOM_USER_META_TABLE . ” m, “. CUSTOM_USER_TABLE .” u WHERE u.ID = m.user_id AND m.meta_key = ‘activation_key’ AND u.ID IN ({$userids})” ) );

    foreach ( $resendusers as $resend ) {

    /* Activate the signup */
    $user = apply_filters( ‘bp_core_activate_account’, bp_core_activate_signup( $resend->meta_value ) );

    /* If there was errors, add a message and redirect */
    if ( $user->errors ) {
    echo ‘There was an error activating this account, please try again: ‘. $resend->user_login;
    } else {
    $to = $resend->user_email;
    $subject = “Your ?????? Account Has Been Activated!”;
    $message = “Your account has been activated. Go to http://??????/ and sign in with the username and password that you created when you signed up.nnWelcome to ?????!”;
    $admin_email = get_site_option( “admin_email” );
    $from_name = “??????????”;
    $message_headers = “MIME-Version: 1.0n” . “From: “{$from_name}” n” . “Content-Type: text/plain; charset=”” . get_option( ‘blog_charset’ ) . “”n”;
    wp_mail( $to, $subject, $message, $message_headers );
    }
    3. Redirect activation email to admin (to use as a noitification for admin instead of automatically sending activition key to user) by adding this to functions.php:
    function change_activation_email_to($content) {
    return get_site_option( “admin_email” );
    }
    add_filter( ‘bp_core_activation_signup_user_notification_to’, ‘change_activation_email_to’);

    So the when a new user signs up, they do not get any activation email. That goes to the admin instead. You will need to change the wording in your template to let the user know that they have to wait for manual approval. Admin logs in to WP admin and goes to Pending Activitations and activates the user. An email is sent to user to let them know they have been activated.

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar