PDA

View Full Version : BB-Code that shows content for specific Usergroups?


Hendrizius
07-19-2009, 12:26 PM
You guys probably know the Spoiler BB-Code which expands and then shows some hidden text. I want to do the same but want to hide the contents for guests.

My idea is the following:
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px; width:852; height:26"><right><font color="red"><b>&nbsp;</b></font></right>
<input type="button" value="Spoiler about {option}" style="font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName(' div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = '{option}'; }">
</div>
<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">
<div style="display: none;">
<if condition="$show['member']">
{param}
</if>
<else />
Sorry, you need to register in order to view the contents.
</if>
</div>
</div>
</div>

This however does not work as vBulletin does not allow template conditionals in BB-Codes. How would I do something similar?

Thanks for your help :).

Defkalion
07-19-2009, 02:50 PM
There's a ready module for that: https://vborg.vbsupport.ru/showthread.php?t=203010

:)

Hendrizius
07-20-2009, 02:40 AM
There's a ready module for that: https://vborg.vbsupport.ru/showthread.php?t=203010

:)

Thank you :).