This topic has 16 replies, 3 voices, and was last updated 9 years by mlennox10.

  • Author
  • #33145
     wielandsmith
    Participant

    Is there a way that when someone registers for buddypress, the site asks them to subscribe? What is the best way to set something like this up?

    #33168
     wielandsmith
    Participant

    or what I mean is… someone signs up via facebook… and they’re automatically subscribed to a specific membership level (the free one) as well as registered on the forums? I just want everything tied together.

    Also, the facebook login still isn’t working..

    Thank you,
    Monica

    #33169
     wielandsmith
    Participant
    This reply has been set as private.
    #33597
     Abe
    Keymaster

    Hello, right now users need to register first and then apply for a membership. We will try to optimize the process in the future. You can assign a level at registration like this :

    This is the function you need to add in order to assign a specific membership level to a newly registered user. Add it into your sweetdate-child/functions.php

    COPY CODE
    
    
    add_action('user_register', 'kleo_pmpro_default_level');
    function kleo_pmpro_default_level($user_id) {
    	pmpro_changeMembershipLevel(1,$user_id);
    }
    

    This one assigns level with ID 1

    Also this code checks for a specific profile value and add only those users to the membership level. Does not apply with Facebook registration

    COPY CODE
    
    
    
    /**
    * When registering, add the member to a specific membership level
    * based on the field value he has selected
    *
    * @global object $wpdb
    * @global object $bp
    * @param integer $user_id
    */
    function kleo_pmpro_default_level($user_id) {
        global $wpdb, $bp;
     
        //Change this with your field name
        $field_name= "I am a";
     
        //Change the field value
        $value_to_match = "Woman";
     
        //Membership level id
        $membership_level = 1;
     
        //Done editing
        $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) );
        if ($_POST['field_'.$field_id] == $value_to_match) {
                pmpro_changeMembershipLevel($membership_level, $user_id);
        }
    }
     
    function kleo_mu_pmpro_default_level($user_id, $password, $meta) {
        global $bp, $wpdb;
     
        //Change this with your field name
        $field_name= "I am a";
     
        //Change the field value
        $value_to_match = "Woman";
     
        //Membership level id
        $membership_level = 1;
     
        
        //Done editing
        $field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", $field_name ) );
        $field_value = $meta['field_'.$field_id];
        if ( $field_value == $value_to_match ) {
            pmpro_changeMembershipLevel($membership_level, $user_id);
        }
    }
     
    if (is_multisite()) {
        add_action( 'wpmu_activate_user', 'kleo_mu_pmpro_default_level', 10, 3);
    } else {
        add_action('user_register', 'kleo_pmpro_default_level');
    }
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #34264
     wielandsmith
    Participant

    I’d like to try it – but for some reason, everything disappears when I activate the kleo child theme. it’s strange. I’ll keep playing with it.

    #34270
     wielandsmith
    Participant

    hmmm. So do I add both codes?

    #34903
     Abe
    Keymaster

    @wielandsmith you should read what they do and add whichever suits your needs

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #34906
     wielandsmith
    Participant

    oh – silly me. I get it. Thank you.

    #34938
     wielandsmith
    Participant
    This reply has been set as private.
    #35192
     Abe
    Keymaster

    your child theme must be active for that to work and your level id should be changed from 1 to match yours

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #35271
     wielandsmith
    Participant

    I did that.

    #37010
     wielandsmith
    Participant
    This reply has been set as private.
    #37458
     Abe
    Keymaster

    Are you registering via Facebook?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #37500
     wielandsmith
    Participant

    I’ve registered using both techniques.

    #37501
     wielandsmith
    Participant

    Honestly, I might as well just cut out the basic level since it’s free and switch it to “logged in” … that way I don’t have to worry about a default membership.

    #37522
     Abe
    Keymaster

    yes there is no point of having a free level

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #42556
     mlennox10
    Participant

    @abe and wielandsmith

    I too have a free level of membership, can you restrict content with a ‘logged in’ setting? If so, where is that setting please?

    Also, I’ve activated the child theme however I’m working from the main theme in terms of dashboard etc. Is that the right way?

    All help and advice appreciated.

Viewing 17 posts - 1 through 17 (of 17 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?