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

Show text to members only? (Need!)

Discussion in 'Resource and Add-on Requests' started by mikeambrose3, May 31, 2012.

  1. mikeambrose3

    mikeambrose3 Member

    Hi,

    I am looking for a way to hide certain text to members only. I assume there is an add-on to do this, I just can't find it.

    I guess it would be something like this; You put the text inside a tag, such as "[hidden]Member only text[/hidden] and it only shows that text for registered users.

    Here is an example from God*Craft*com:
    [​IMG]

    The text that says "<<You must be .... to View this information>>" is what it says for non-registered users. Any other users can view it if they are a member.


    Thanks,
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    You don't need an add-on for this.

    XenForo has a number of template conditionals.

    To do what you want:

    Code:
    <xen:if is="{$visitor.user_id}">
    This content will show to logged in members
    <xen:else />
    This content will show to guests
    </xen:if>
    Put that code in the desired template.
     
    mikeambrose3 likes this.
  3. DBA

    DBA Well-Known Member

    Where is this text going?

    Here's a simple conditional for templates
    Code:
    <xen:if is="{$visitor.user_id}">
    This content will show to logged in members
    <xen:else />
    This content will show to guests
    </xen:if>

    Edit: Got ninja'd. :p
     
    mikeambrose3 likes this.
  4. mikeambrose3

    mikeambrose3 Member

    Alright, thank you a lot :>
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    We really need some banner that appears when someone else is writing a message.

    Either that, or a proper ninja smiley for when the inevitable happens ninja.png
     
    DBA and mikeambrose3 like this.
  6. Samus4145

    Samus4145 Member

    Is there no way to do this per post basis?
     

Share This Page