Code to only show if Affiliate?

Discussion in 'Customization & add-ons' started by DigitalMirrors, Nov 9, 2009.

  1. DigitalMirrors

    DigitalMirrors New Member

    Joined:
    Jul 12, 2005
    Messages:
    3
    Is there a session variable to that will tell if a member is an affiliate? I would like to be able to add some stuff to the member page that will only show if a user is an affiliate.
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    $_SESSION['amember_user']['is_affiliate'] - 1 or 2 means that user is an affiliate.
  3. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Are you looking to show content on the amember template pages (eg member.php) or an outside php page?

    David
  4. DigitalMirrors

    DigitalMirrors New Member

    Joined:
    Jul 12, 2005
    Messages:
    3
    I would like to show the content within one of the amember template pages so I guess I need to do this with the smarty code. I'm really not good with that can you tell me how I would do a "if this user is an affiliate" in smarty code?



    BTW - Thank you very much for the session variable Alexander I'm sure I'll find that useful later one. :)
  5. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    is it a 1 or a 2 for an affiliate or either?

    Probably
    {if $smarty.session._amember_user.is_affiliate = 1}
    content
    {/if}

    or
    {if $smarty.session._amember_user.is_affiliate > 0}

    David

Share This Page