$output = '<div class="bbCodeBlock bbCodeQuote">
<div class="attribution type">
<input id="spoiler_' . $tagId . '" class="button" type="button" value="' . $buttonText . '" onclick="
if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\')
{
this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\';
this.innerText = \'\'; this.value = \'' . addslashes($hideText) . '\';
}
else
{
this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\';
this.innerText = \'\'; this.value = \'' . addslashes($buttonText) . '\';
}" />
</div>
<div class="quotecontent">
<div style="display:none;"><blockquote>' . $content . '</blockquote></div>
</div>
</div>';
return $output;
$output = '<div>
<div>
<input id="spoiler_' . $tagId . '" class="button" type="button" value="' . $buttonText . '" onclick="
if (this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display != \'\')
{
this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'\';
this.innerText = \'\'; this.value = \'' . addslashes($hideText) . '\';
}
else
{
this.parentNode.parentNode.getElementsByTagName(\'div\')[1].getElementsByTagName(\'div\')[0].style.display = \'none\';
this.innerText = \'\'; this.value = \'' . addslashes($buttonText) . '\';
}" />
</div>
<div>
<div style="display:none;"><div class="messageText ugc baseHtml">' . $content . '</div></div>
</div>
</div>';
return $output;
If anyone wants to change the styling of the spoiler button to make it look like a basic button instead of a quote block, open library\KingK\BbCodeManager\BbCode\Formatter.php
Whoops! It should be Default.php.
I've updated the post.
Hmmm, maybe I need to add some code back in then.
I'll look at it again.
Edit: Fixed, I removed a div I shouldn't have.
I've just reported the comma truncation in the post above yours.
That's an issue with the original code and not the changes I made to remove the styling.
One other small issue KK, you can't have a comma in the button text; it just truncates the title after the comma.
I can with my original code so I'm not sure if something was lost in the translation.
Almost
A long sentence with the spoiler gets cut:
Original:
text
to
text
and when you click on the spoiler the rest appears:
text
no hide button of course, it acts like one
Ah, that's a shame as a lot of my existing quizzes use commas so I'll have to go through and edit all those.
Is there no way of using an alternative character, one which wouldn't normally be used, e.g. ¦ or | ?
I appreciate though this may cause problems when setting up the BB Codes but that only has to be done once and even then not every BB Code will have multiple parameters.
I'll just leave a note saying use at your own risk.Much appreciated.
That would be great if you could as it would solve a problem I'll have otherwise
Send via PC if you don't want to post here and potentially cause problems with others implementing it and then causing problems with future upgrades.
$attributes = explode(', ', $tag);
Check the help page. You MAY need to modify that.Nice one, it worked perfectly![]()
We use essential cookies to make this site work, and optional cookies to enhance your experience.