Echo user ID or Affiliate link

Discussion in 'Customization & add-ons' started by baduist, Apr 23, 2012.

  1. baduist

    baduist Member

    Joined:
    Apr 13, 2012
    Messages:
    33
    How can I echo a user's affiliate link in my protected pages? (or perhaps jsut the user id so I can manually build the affiliate link)?
  2. baduist

    baduist Member

    Joined:
    Apr 13, 2012
    Messages:
    33
    Answer is:

    <?php

    $uid4aff = Am_Lite::getInstance()->getUser(); // get user info
    $affid = $uid4aff['user_id']; // get user id
    $afflink = 'http://yourdomain.com/amember/aff/go?r='.$affid.'&i=1'; // build the aff link

    echo $afflink;

    ?>

    Notes:
    1. Replace your domain of course
    2. "i=1" the "1" must reflect an existing affilaite link/ banner id that you created through the admin
    3. Make sure all your members are also affiliates before using this.

Share This Page