BbCodes & Buttons Manager - Advanced Bb Codes Pack

BbCodes & Buttons Manager - Advanced Bb Codes Pack 3.7.2

No permission to download
@Xon, test this (only this modification - I haven't tested the pre version 3.0.0 neither on update or fresh install). This solution reaches the limit of regex, after I will have to see if it's possible to use some parsers or some kind of validators.
I'm amazed at how much you've gotten out of that Regex for parsing.

Sadly the getSpecialTags changes aren't sufficient to prevent the example post from utterly breaking page formatting.
 
@Xon
In your example, the problem occurs because the list has been closed at the n+2 tag and the patch only replaces it at the n-1 one.
 
  • Like
Reactions: Xon
@Xon
I've added a better solution which has two methods : one is depending on an external class (ref) that do the job nicely, the other one is using the php DOM functions which can be really annoying for utf8 management and some special tags (but with workarounds implemented). If you have time to check which one is the fastest, that would be nice.
See these commits: commit 1 & commit 2
 
Last edited:
  • Like
Reactions: Xon
Is it possible to add skins to bbcodes? I would like to change a bit the [encadre] without removing anything =O
Add a new skin will imply to modify the code. There's already a second skin with this Bb Code. Both skins can be customized in the style properties.
 
Last edited:
I've recently updated this and for some reason bbimg tag's width doesn't work for mobile screens. It seems to just set the width to 100%.

Any idea how to fix this?
 
Nothing to fix here, it's done on purpose. Mobile phones are supposed to have smaller screens than desktops/laptops (at least at the moment...), the resolution is then not the same. When you used fixed width for your elements, it allows you to construct the layout of your page like you want. But this layout can't be the same on smaller resolution screens. So if you have inserted a 600x400 picture on your post, the mobile version will disable the original layout to make an alternative layout that would try to keep the user comfort on smaller screens. That why the image width becomes fluid with a value of 100%.

A very (very) famous French luxury brand has just heard the concept of responsive design and was very interested in it. For their next project, they asked their agency to make them a responsive website that covers all kind of resolutions (even for huge screens). When they discovered at the end that the layout was not the same, they started to complain, which was actually quite funny for professionals, but not for the agency.
 
Nothing to fix here, it's done on purpose. Mobile phones are supposed to have smaller screens than desktops/laptops (at least at the moment...), the resolution is then not the same. When you used fixed width for your elements, it allows you to construct the layout of your page like you want. But this layout can't be the same on smaller resolution screens. So if you have inserted a 600x400 picture on your post, the mobile version will disable the original layout to make an alternative layout that would try to keep the user comfort on smaller screens. That why the image width becomes fluid with a value of 100%.

A very (very) famous French luxury brand has just heard the concept of responsive design and was very interested in it. For their next project, they asked their agency to make them a responsive website that covers all kind of resolutions (even for huge screens). When they discovered at the end that the layout was not the same, they started to complain, which was actually quite funny for professionals, but not for the agency.

How can I disable this? I've already taken account of this issue and my site is completely responsive.

Thing is I don't set any images wider then 280 just so they always work on mobile, but I also have images set at 150 so they only take up half the screen on mobile.
 
Last edited:
How can I disable this? I've already taken account of this issue and my site is completely responsive.

Thing is I don't set any images wider then 280 just so they always work on mobile, but I also have images set at 150 so they only take up half the screen on mobile.
There's no option for this (unless you have disabled the XenForo responsive option), you will have to edit the bimg formatter or the bbm responsive helper.

The bimg formatter is in that file. The code has comments in it, so just disable the responsive management (arround line 250):
PHP:
$useResponsiveMode = false;
 
There's no option for this (unless you have disabled the XenForo responsive option), you will have to edit the bimg formatter or the bbm responsive helper.

The bimg formatter is in that file. The code has comments in it, so just disable the responsive management (arround line 250):
PHP:
$useResponsiveMode = false;

Sweet, thanks! Worked like a charm.
 
@cclaerhout One of my users managed to explode the accordion bbcode again.

This time with the following error:
Code:
ErrorException: Fatal Error: Unsupported operand types - library/Sedo/AdvBBcodeBar/BbCode/Formatter/AdvBbCodes.php:897
Generated By: Xon, 3 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}

In the function parseTagTabs, around the following code:
Code:
                        if(!$parentClass->getTagExtra('tagid'))
                        {
                                $parentClass->addTagExtra('tagid', 1);
                        }
                        else
                        {
                                $newTagid = $parentClass->getTagExtra('tagid') + 1; // this line
                                $parentClass->addTagExtra('tagid', $newTagid);
                        }

Looks like abuse of the JUSTIFY bbcode and the Accordion tag. I've PMed you some more details.
 
Last edited:
Looks like abuse of the JUSTIFY bbcode and the Accordion tag. I've PMed you some more details.
I don't have time this week to look at the problem, but it's strange. If you use chose to clean the html by the dom option (see: $content = self::tidyHTML($content, true)), you will have a better output, but the problem still remains (an empty accordion tag will be displayed above). A workaround is possible to do (with the original method), but what is strange is if you go from the RTE editor to the Bb Code editor, save the message, then everything works fine. This is not very logical since when a message is saved, it is converted to Bb Codes with the same formatter than when the editor is switched.
 
  • Like
Reactions: Xon
@Xon
Here's a fix, but I still don't understand what I've mentioned above. Add the following function to the class "Sedo_TinyQuattro_Html_Renderer_BbCode":
PHP:
  protected function _postRender($text)
   {
     do
     {
       $newText = preg_replace('#\[/(justify)\]([\r\n]*)\[\\1\]#i', '\\2', $text);
       if ($newText === null || $newText == $text)
       {
         break;
       }
       $text = $newText;
     }
     while (true);

     return parent::_postRender($text);     
   }
The message would need to be saved again.
 
  • Like
Reactions: Xon
I've recently updated and bbimg tag's doesn't work for me. :( this screen shot
 

Attachments

  • Screen Shot 2014-11-19 at 11.21.20 AM.webp
    Screen Shot 2014-11-19 at 11.21.20 AM.webp
    7.6 KB · Views: 7
Last edited:
The Button now shows up but why it using the same icon over and over again ?, i have checked one by one it indeed using different icon for different button.

PZRZTbu.png


I am on 1.4.3.
 
Last edited:
@Vohn
These buttons are for which kind of Bb Codes? Did you set an icon for them? If these buttons are only the ones created by these addon, then I don't have set any icon for them with the stock editor, you will have to do it yourself: edit the Bb Code, go to the button management section and add an icon for the XenForo Redactor editor.
 
Last edited:
Hmm, strangely enough if i install tinymce, the icons pre-assigned itself, strange, does for 1.4.3 requires to install tinymce quattro?, if not would you please add automatic pre-assigned icons for the xenforo redactor?, when it was being sold, i don't remember being set an icon at all.
 
Top Bottom