BB Code Manager: BB Code XML Repository

ohh ohh, how would I change that?

Do you have any bbcodes with multiple options that work? I would like to look and see how it is done...I was making someone a bbcode and now I forgot how to properly use multiple options (maybe the , was messing with mine too, but I don't know.)
 
library\KingK\BbCodeManager\Model\CustomBbCode.php
Find:
Code:
 $active[$tag['tag']]['theOptions'] .= ', ';

Replace with:
Code:
$active[$tag['tag']]['theOptions'] .= '| ';


library\KingK\BbCodeManager\BbCode\Formatter\Base.php
Find:
Code:
 public function parseMultipleOptions($tag)
 {
  $attributes = explode(', ', $tag);
  return $attributes;
 }

Replace with:
Code:
 public function parseMultipleOptions($tag)
 {
  $attributes = explode('| ', $tag);
  return $attributes;
 }


I don't have any multiple attribute BB Codes created now but during my initial testing it all worked fine.
You would enter it for example like this: [image_size=50 | 100]embedded_image[/image_size]
 
Thanks I will try that if my next trial fails using the , with a space before and after
I don't have any multiple attribute BB Codes created now but during my initial testing it all worked fine.
You would enter it for example like this: [image_size=50 | 100]embedded_image[/size]
DAMN... all I needed was another space:mad:. I deleted the code and started over lol.

-*-*-*-*-*-*-*-*-

update: Brogan is the man again..surprise surprise...

I didn't change the , to | yet but instantly using the space my previous code did work...I just didn't know what I was doing :)

Tweaking the bbcode now :)
 
Here's a small selection of bbcodes that I have installed on my own site, there's a couple missing as stopping the bbcodes from parsing urls is causing problems, EQnoble is trying to figure that out, when he get's a fix I'll add the other bbcodes too. :)

You can see demo's for these BBCodes here: http://www.acockimplex.com/aegis/index.php?forums/small-modifications.23/

These are great! Dont really need to use any of them at the moment but keep going lol, I know one will definatley come in handy, well done!
 
I've seen a few requests for a Google Map BB Code so here it is.

You need the co-ordinates to use it.
London for example would be: [gmap=51.502759, -0.11673, 0.714651, 2.113495][/gmap]

The original embed code for London is this:
Code:
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=London&amp;aq=&amp;sll=51.502759,-0.11673&amp;sspn=0.714651,2.113495&amp;ie=UTF8&amp;hq=&amp;hnear=Westminster,+London,+United+Kingdom&amp;ll=51.502759,-0.11673&amp;spn=0.714691,2.113495&amp;t=h&amp;z=10&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=London&amp;aq=&amp;sll=51.502759,-0.11673&amp;sspn=0.714651,2.113495&amp;ie=UTF8&amp;hq=&amp;hnear=Westminster,+London,+United+Kingdom&amp;ll=51.502759,-0.11673&amp;spn=0.714691,2.113495&amp;t=h&amp;z=10" style="color:#0000FF;text-align:left">View Larger Map</a></small>

So it's not exactly user friendly, but if you can pull the 4 co-ordinates from the code then it will work.
You need to use the 4 sets of data after sll= and sspn=, so in the case of the above code, they would 51.502759,-0.11673, 0.714651, 2.113495

The size is fixed at 800x600 but that can be edited, or I can turn those into variables, it will just mean entering 6 lots of values for each embed.

I've also set the embed code as the basic map, the parameters can be edited to change the map type, zoom level, etc.

If anybody wants a specific code creating, link me to the original Google Map page with the exact view you want, or paste the code here, and I should be able to get it done for you.
 

Attachments

To install the normal BB Codes you just import the XML files from the BB Code Manager page.

For the spoiler code, I had to manually edit the php files.

To just change the styling, open the library\KingK\BbCodeManager\BbCode\Formatter\Default.php file

Find this:
Code:
  $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;

Replace with this:
Code:
  $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;">' . $content . '</div>
      </div>
    </div>';
        return $output;

The other changes I made to the code were to allow the use of | instead of , as the multiple paramameter, to stop it conflicting with commas in the spoiler code button titles.

Those edits are a few posts up.
 
That's just an iframe embedded in the page, extremely easy to do but it opens your site up to exploits and is potentially dangerous.
 
Here you go.
With this BB Code, anyone can embed any web page in your site. Use it at your own risk.
Don't say I didn't warn you...

Use it like this: [web=google.com][/web]

Adjust the parameters to suit: width, height, etc.
 

Attachments

Here's a small selection of bbcodes that I have installed on my own site, there's a couple missing as stopping the bbcodes from parsing urls is causing problems, EQnoble is trying to figure that out, when he get's a fix I'll add the other bbcodes too.

Yeah, I had tried out a few really nice custom ones but it was always auto-adding URL tags inside the custom bbcode tags regardless of the setting not to parse bbcodes so.. I hope I can release those too once this is fixed up.
 
Top Bottom