• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • 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.
  • 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
#1
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.png
After
after.png
 

lms

Well-known member
#5
I'm spanish speaker and understand what it says allan.

change the text as you want to appear.

Thanks. works fine.

Salud2
 
R

ragtek

Guest
#6
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 !
 
#16
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.jpg sc 2011-03-13 上午12.28.44.jpg
 

borbole

Well-known member
#17
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>
 

yavuz

Well-known member
#18
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.
 

borbole

Well-known member
#19
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.