XenForo Hide [Code] content from visitors !

Marks-Man

Loyal Member
Template:
bb_code_tag_code
UPDATE:
Nicely Done :cool:
Hide CODE from Visitors on NODE 2 and 6
<xf:if is="in_array({$xf.reply.containerKey}, ['node-2', 'node-6']) AND $xf.visitor.isMemberOf([1])">

<xf:macro template="prism_macros" name="setup" />

<div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code">
<div class="bbCodeBlock-title">
{{ $config.phrase ?: phrase('code') }}{$xf.language.label_separator}
</div>
<div class="bbCodeBlock-content" dir="ltr">

<xf:if is="$xf.visitor.isMemberOf([1])">
<code>
<b><a href="{{ link('login') }}" data-xf-click="overlay" data-follow-redirects="on"><i class="fas fa-sign-in-alt"></i> {{ phrase('log_in') }}</a></b>
or
<a href="{{ link('register') }}" data-xf-click="overlay" data-follow-redirects="on"><i class="fas fa-plus-square"></i> {{ phrase('register') }}</a>
</code>
<b>in order to view content</b>
<xf:else />
<pre class="bbCodeCode" dir="ltr" data-xf-init="code-block" data-lang="{{ $language ?: '' }}"><code>{$content}</code></pre>
</xf:if>
</div>
</div>

Note: it can be done with BBCODES templates, unfortunately node forum numbers or pages are not working $page.node_id & in_array($__globals.forum.node_id, [42,43,58])


Capture.png




----------------------------------------------


UPDATE

On XenForo 2.2.4
<xf:if is="$xf.reply.containerKey == 'node-6'">
Multiple Nodes
<xf:if is="in_array({$xf.reply.containerKey}, ['node-2', 'node-6'])">

In Resource Manager
$xf.reply.containerKey == 'xfrmCategory-3'
 
Last edited:

Marks-Man

Loyal Member
<xf:if is="{$forum.node_id} = 2">
<xf:if is="in_array({$forum.node_id}, [1,2,3])">
<xf:if is="{$__globals.forum.node_id} == 2">
<xf:if is="$thread.Node.node_id == 2">
<xf:if is="$thread.node_id == 2">
<xf:if is="$thread.Forum.Node.node_id == 2">
<xf:if is="in_array({$thread.node_id}, [2,3,4,8])">
<xf:if is="$forum.parent_node_id == 2">
<xf:if is="$__globals.forum.node_id == 2">
<xf:if is="$forum.node_id.containerKey == 'node-2'">


All not working at bb_code_tag_code that's weird
 

alodda

Loyal Member
Registered
I post on my mobile sorry but try this, I will check later
for node id you can try this :confused:

Code:
<xf:if is="$xf.visitor.user_id and in_array($__globals.forum.node_id, [42,43,58])">
nothing for guest... Exit this...
<else if>
Do this for other
</xf:if>
 

Marks-Man

Loyal Member
I post on my mobile sorry but try this, I will check later
for node id you can try this :confused:

Code:
<xf:if is="$xf.visitor.user_id and in_array($__globals.forum.node_id, [42,43,58])">
nothing for guest... Exit this...
<else if>
Do this for other
</xf:if>
First command to check if Guest is working :)
but problem with matching forum node id not working , already tried that.
I am trying to hide links from specific nodes but if statement not matching (Simple test)
 
  • Tags
    hide [code] content from visitors tips hide [code] content from visitors xenforo hide [code] content from visitors xnforo.ir
  • Back
    Top Bottom