• 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

Allan

Well-known member
Hide contents of BBcode code, html and php to guest
___________________________________
These changes in templates allow you to hide the contents of the bbcode code, html and php in yours messages and will encourage visitors to register to see them.
  • 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.webp
After
after.webp
 
Thank you to register for see this BBcode?

Shouldn't it be "Sorry you need to register to see this."
 
I'm spanish speaker and understand what it says allan.

change the text as you want to appear.

Thanks. works fine.

Salud2
 
Is it working for you?

Sorry you need to <a href="register.php">register</a> to see this BBcode !

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 !
 
Allan, is there a way prevent users who didn't confirm their e-mail accounts from viewing links ?
 
Anyone who knows to prevent users to see content until they confirmed their e-mail accounts ?
 
QUOTE:
bb_code_tag_quote
find 搜索
<blockquote>{xen:raw $content}</blockquote>
Replaced by
替换为
<xen:if is="!{$visitor.user_id}">
对不起,请<a href="{xen:link login}">登录</a>论坛后查看完整内容!<br>
Sorry, please <a href="{xen:link login}">login</a> to view the full content!
<xen:else />
<blockquote>{xen:raw $content}</blockquote>
</xen:if>

sc 2011-03-13 上午12.28.29.webp sc 2011-03-13 上午12.28.44.webp
 
Anyone who knows to prevent users to see content until they confirmed their e-mail accounts ?

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>
 
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>

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

Can you make an example for CODE BB code with this modification above.
 
Is it enough I only change <xen:if is="{$isAwaitingEmailConfirmation}"> this ?

Can you make an example for CODE BB code with this modification above.
Is it enough I only change <xen:if is="{$isAwaitingEmailConfirmation}"> this ?

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

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.
 
Top Bottom