1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Hiding Hook From Unregistered

Discussion in 'Styling and Customization Questions' started by Zachary Ball, Feb 12, 2016.

  1. Zachary Ball

    Zachary Ball Member

    How would I go about hiding a hook from the "unregistered" users.

    http://sxsnation.com/forum/forums/ball-equipment.7/

    The hook on this page is right below the description and pertains a "code" that you need to be registered to see.

    If this isn't possible, how else could I go about hiding this code? Should I create a hidden page that links to the code?
     
  2. wang

    wang Well-Known Member

  3. Zachary Ball

    Zachary Ball Member

    wang, that didn't seem to work. I replaced "code" with the code in my hook and it still shows when not signed in.
     
  4. wang

    wang Well-Known Member

    When you say hook, what exactly do you mean? The code I posted, will hide content from guests and it will show only to registered users.

    Can you please post some more details, like your whole code and in what template are you addding it for eg?
     
  5. Zachary Ball

    Zachary Ball Member

    hook:ad_above_content

    That bar you see here: http://sxsnation.com/forum/forums/ball-equipment.7/

    The content in that bar is :

    Code:
    <xen:if is="{$visitor.user_id}"><b>Forum Discount Code [ <font color="red">BEQUIP</font> ] - 5% OFF In Store Sales Only<b></xen:if>
    That gray bar above the content needs to be hidden when not logged in.
     
  6. wang

    wang Well-Known Member

    It seems strange that it is not working for you. I tested it out at my developer forum, for just in case, and it worked fine for me.
     
  7. RoldanLT

    RoldanLT Well-Known Member

    On expression box:
    PHP:
    $visitor['user_id'] != 0
     

Share This Page