• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

BB Code Manager

Status
Not open for further replies.
The varchar error was due to entering too much text in the Example field when creating the BB Code.
varchar.webp
 
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\Default.php and change this:
PHP:
		$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;


For this:
PHP:
		$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;

There are probably a couple of extra div's I can prune out of that too :D
 
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

library\KingK\BbCodeManager\BbCode\ there is no Formatter.php in this directory were you rather meaning library\KingK\BbCodeManager\BbCode\Formatter\default.php ?
 
Whoops! It should be Default.php.
I've updated the post.

Have tried using spoiler group brogan ?

text
text
text


Spoilers behaves stragely, the hid e button shifts and some of the spoilers won't work :(
 
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.
 
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.
 
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.

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

6WTgq.png


A0VqO.png
 
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.
 
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.

Sorry Brogan, you answered to quickly while I was writing the issue which I had in the original version already.
 
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

You both have stumbled upon the As Designed issue within this! As per the first post and the release of v1.2, I created a uniform way to allow multiple options and parameters via a simple interface ({1}, {2}, etc...) for the ACP and a PHP version for things such as spoiler. The choice of separator (as it was used already in the flash code) was ", ". Which in turn means you can't use a comma in your spoiler. You MAY be able to use &comma; or whatever the HTML entity is, but I'm not exactly sure what it is or if it'd work. I'm honestly sorry if it causes any issues.
 
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.
 
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.

Well, if you'd like to do this, I can give you instructions. However, I don't plan on changing it up in default because of backwards compatibility.
 
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.
 
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.
I'll just leave a note saying use at your own risk. ;) Mostly its opening KingK/BbCodeManager/BbCode/Base.php and finding correct code and modifying a line... Specificially:
PHP:
		$attributes = explode(', ', $tag);

And modifying the ', ' line to be something like '|'.
 
Status
Not open for further replies.
Back
Top Bottom