1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Hide contents of BBcode code, html and php to guest

Discussion in 'Template Modifications [Archive]' started by Allan, Nov 25, 2010.

  1. Allan

    Allan Well-Known Member

    Hide contents of BBcode code, html and php to guest
    ___________________________________

    • In the "bb_code_tag_code" template, find:
    Code:
    <pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
    Replace by:
    Code:
    <xen:if is="!{$visitor.user_id}">
            Sorry you need to <a href="{xen:link register}">register/login</a> to see this BBcode !
            <xen:else />
            <pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
            </xen:if>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • In the "bb_code_tag_html" template, find:
    Code:
    <pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
    Replace by:
    Code:
    <xen:if is="!{$visitor.user_id}">
           Sorry you need to <a href="{xen:link register}">register/login</a> to see this BBcode !
            <xen:else />
            <pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
            </xen:if>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • In the "bb_code_tag_php" template, find:
    Code:
    <div class="code">{xen:raw $content}</div><xen:comment><!-- content is escaped via parser --></xen:comment>
    Replace by:
    Code:
    <xen:if is="!{$visitor.user_id}">
            Sorry you need to <a href="{xen:link register}">register/login</a> to see this BBcode !
            <xen:else />
            <div class="code">{xen:raw $content}</div><xen:comment><!-- content is escaped via parser --></xen:comment>
            </xen:if>
    Before
    avant.png
    After
    after.png
     
  2. Sir nick

    Sir nick Well-Known Member

    Thank you to register for see this BBcode?

    Shouldn't it be "Sorry you need to register to see this."
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Allan is French so English isn't his first language.

    It's simple enough for anyone making this edit to change the text to suit.
     
    laztrix, g0rn and Blandt like this.
  4. Allan

    Allan Well-Known Member

    It's no wrong, expressions edited ;)
     
  5. lms

    lms Well-Known Member

    I'm spanish speaker and understand what it says allan.

    change the text as you want to appear.

    Thanks. works fine.

    Salud2
     
  6. ragtek

    ragtek Guest

    Is it working for you?

    xenforo have no register.php ;)

    YOu could try {xen:link login} or {xen:link register}
    I would change it to

    Sorry you need to register/login to see this BBcode !
     
  7. Allan

    Allan Well-Known Member

    Yes it work:
    http://xenforo.com/community/register
    http://xenforo.com/community/register.php

    But you're right, i add {xen:link register} in url and change expression, it's better ;)

    Thank you Ragtek ;)
     
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

  9. iKODEAK

    iKODEAK Member

    An interesting modification, maybe you create a tag for hiding information? It will be great =)
     
  10. yavuz

    yavuz Well-Known Member

    Allan, is there a way prevent users who didn't confirm their e-mail accounts from viewing links ?
     
  11. ragtek

    ragtek Guest

    i think
    Code:
    <xen:if is="{$user.user_state} == 'email_confirm'">
    
     
  12. yavuz

    yavuz Well-Known Member

    instead of
    <xen:if is="!{$visitor.user_id}"> this ?
     
  13. yavuz

    yavuz Well-Known Member

    I tried this but user can still see the link without confirming account.
     
  14. yavuz

    yavuz Well-Known Member

    Anyone who knows to prevent users to see content until they confirmed their e-mail accounts ?
     
  15. ToDie4

    ToDie4 Well-Known Member

    Simple yet so effective, thank you Allan. :)
     
  16. tianwm

    tianwm Member

    QUOTE:
    bb_code_tag_quote
    find 搜索
    Replaced by
    替换为
    sc 2011-03-13 上午12.28.29.jpg sc 2011-03-13 上午12.28.44.jpg
     
  17. borbole

    borbole Well-Known Member

    Try this condition for that:

    Code:
    <xen:if is="{$isAwaitingEmailConfirmation}">
    You need to activate your account to see the hidden content
            <xen:else />
            <pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
            </xen:if>
    
     
    laztrix likes this.
  18. yavuz

    yavuz Well-Known Member

    Is it enough I only change <xen:if is="{$isAwaitingEmailConfirmation}"> this ?

    Can you make an example for CODE BB code with this modification above.
     
  19. borbole

    borbole Well-Known Member

    I just did. As per the first example posted at the OP, at the bb_code_tag_code template, find the following code:

    Code:
    <pre>{xen:raw $content}</pre><xen:comment><!-- content is escaped via parser --></xen:comment>
    And replace it with the code I posted above.
     
  20. yavuz

    yavuz Well-Known Member

    Ok thank you borbole :) I'll try it now.
     
    borbole likes this.

Share This Page