Spoiler's cannot be seen into by unregistered people - Xenforo

Archie

Member
Feb 8, 2016
129
8
53
Hello there,

I've not long set up my second community and we have started using a Xenforo as our forum software but I have no Idea on how to make it so only registered members can read spoilers, is it to do with plugins or it is the group permissions system. I've had a quick search around and haven't found anything yet but I was wondering if you guys could help me out.

Thanks
Archie
 

Supervisor

Administrator
Apr 27, 2015
1,863
2,546
335
I forgot about this thread - sorry.
Here you go :D

Just change your bb_code_tag_spoiler template.
Code:
<xen:require css="bb_code.css" />

<xen:comment><!-- content is escaped via parser --></xen:comment>
<xen:if is="{$visitor.user_id}">
<div class="ToggleTriggerAnchor bbCodeSpoilerContainer">
   <button class="button bbCodeSpoilerButton ToggleTrigger Tooltip JsOnly"
     title="{xen:phrase click_to_reveal_spoiler}"
     data-target="> .SpoilerTarget"><span>{xen:phrase spoiler}{xen:if $titleHtml, ': <span class="SpoilerTitle">{xen:raw $titleHtml}</span>'}</span></button>
   <div class="SpoilerTarget bbCodeSpoilerText">{xen:raw $content}</div>
</div>
<xen:else />
<center><a href="{xen:link register}" class="button"><span><b>You need to register to view spoilers!</b></span></a></center>
</xen:if>
 
Top