• HI there,
    what a great plugin this is!
    I need a little help to fit my needs completely.
    Im giving my members invite codes that can be used 1-3 times.
    After its generated, the invite code is stored in usersmeta table, and i need some code that will check if the invite is used or not.
    Something like if the invite that is assigned to the current user is still active show how many uses are left.
    Can you assist me on this?
    Thanks in advance!

    https://www.ads-software.com/plugins/baw-invitation-codes/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Julio Potier

    (@juliobox)

    Hello

    I did not set anything in the usermeta table, i did it in options.

    you can do this for example :

    // Return how many usage left.
    function is_code_valid( $code )
      $baweic_options= get_option( '' );
      $codes = $baweic_options['codes'];
      if( isset( $codes[ $code ] ) ) {
        return $codes[ $code ]['leftcount'];
      }
      return false;
    }

    Hey,
    I would like give every registered user automatically 4 codes to invite new friends.
    The new user register, and get also 4 new codes to can invite 4 friends aswell.

    Is that possible?

    I hope you understand my question?!

    Excuse my bad english!

    greetings from Germany

    For anyone happening upon this as I did, Julio made a mistake in his post code:

    This:
    $baweic_options= get_option( '' );

    Should be this:
    $baweic_options = get_option( 'baweic_options' );

    Doing it that way will pull a blank data set.

    @thecatcher1984, did you ever figure that out? All you have to do is find an appropriate hook or filter to grab onto during the registration process and then add the code to the $baweic_options and include the code in the email.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show invite code inside template file’ is closed to new replies.