• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[Answered] Xenforo Spoiler Permission Edit Needed

#1
Hello guys, I nerver for once have regret to have stumble upon this site because of their great work being done here. And also thanks to the admin of this wonderful site.

Please I really need your help in setting up my xenforo spoiler although it is working need some changes which I want to make.
My spoiler is only meant for registered members in my forum and restricted to the visitor which they would have to sign up for it. So I want it my xenforo spoiler code to work for some set of my members let's say with title rank instead for all members.
So what I am saying, in essence, is that I want it to only work my users with a title rank e.g Guru so how can I set it up please help is needed here.
Code:
<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 />
<a href="{xen:link register}" class="button"><span>You need to be a guru member!</span></a>
</xen:if>
And also have already install the addon before, so what I am saying is that how can I edit the spoiler to only works for a specific user group e.g users with title rank (Guru) . So this will not work for all registered user but instead the spoiler will only work for user with user group (Guru). And I have seen such in a forum before. Please would very appreciate if you can help me out though I have installed the addon and it is working fine for all registered users but what I want is to work for a specific user group.
 

Similar threads

XenForo Rocks

Team Member
Administrator
Moderator
+Lifetime VIP+
Contributor
ViP
True Member
Suppliers
Registered
#3
Hello guys, I nerver for once have regret to have stumble upon this site because of their great work being done here. And also thanks to the admin of this wonderful site.

Please I really need your help in setting up my xenforo spoiler although it is working need some changes which I want to make.
My spoiler is only meant for registered members in my forum and restricted to the visitor which they would have to sign up for it. So I want it my xenforo spoiler code to work for some set of my members let's say with title rank instead for all members.
So what I am saying, in essence, is that I want it to only work my users with a title rank e.g Guru so how can I set it up please help is needed here.
Code:
<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 />
<a href="{xen:link register}" class="button"><span>You need to be a guru member!</span></a>
</xen:if>
And also have already install the addon before, so what I am saying is that how can I edit the spoiler to only works for a specific user group e.g users with title rank (Guru) . So this will not work for all registered user but instead the spoiler will only work for user with user group (Guru). And I have seen such in a forum before. Please would very appreciate if you can help me out though I have installed the addon and it is working fine for all registered users but what I want is to work for a specific user group.
Simply use this template conditional
Code:
<xen:if is="{xen:helper ismemberof, $visitor, 2, 3, 4}">
stuff to display for usergroups 2, 3 and 4.
</xen:if>
 
#5
Sorry for the inconvenience sir, but seem it is not yet working for me sir. Though I have replace all the code in the previous template I sent with the one you provided me with.
 
#6
And after doing this, I even added it in the existing template like this
Code:
<xen:require css="bb_code.css" />
<xen:if is="{xen:helper ismemberof, $visitor, 2, 3, 4}">
stuff to display for usergroups 2, 3 and 4.
<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 />
<a href="{xen:link register}" class="button"><span>You need to register to view the contents!</span></a>
</xen:if>
But still not working for me yet sir. Would very much appreciate if you can help me out with this.
 

Similar threads