BbCodes & Buttons Manager

BbCodes & Buttons Manager 3.3.5

No permission to download
@XxUnkn0wnxX
To be honest, I didn't know this tag, but yes, making a Bb Code for it is not a problem: there's the main text, there are some options, that's a classic Bb Code. No need any wysiwyg feature for it. I don't need it personally, so try first to do it by yourself. There's an example of an "hightlight" Bb Code provided with the Bbm (tag: HL), just try to see how it works and if you have any question, just ask.
 
i not even sure where to begin template coding not my thing...

i know the tag works where HTML is accepted like a page but when i place it in a normal thread or post it doesn't work does accept html
 
https://xenforo.com/community/resources/advanced-bb-code-by-chrome.2946/ - has the tag and works fine but how would i add to bbm from them...

ecBQh.png


to BBM i not sure how...

EDIT: i made an orphan button out of it but there has to be a cleaner way of doing it...

seems Font-Ausome buttons don't work for me they give me blank image in the editor...
 
Last edited:
i not even sure where to begin template coding not my thing...
Did you look how was working the HL (highlight) tag?
=> create a template (here: "bbm_bbcode_highlighter")
=> set this template name in the Bb Code options
Your Bb Code is ready to use.

For the FA problems, you need to be sure, it has been enabled in your system. Check your "[Bb Codes & Buttons Manager] Buttons Manager" options.
 
Are you using a custom style? If yes, check with the default theme. If it's working with your default theme, but not customized one, contact its author. Check post #277.
not working on default style either give's weird image like it try to get image but i no where to be found so it give me bad image

default theme i get this:
ed0WX.png
instead of blank
 
not working on default style either give's weird image like it try to get image but i no where to be found so it give me bad image

default theme i get this:
ed0WX.png
instead of blank
Give the url so I can check if it's a browser problem. I occurs sometimes with FA.
 
http://portalcentric.net/testboard/threads/test.1/
& i looked over the template for the hl

Code:
<xen:require css="bbm_bbcode_highlighter.css" />

<xen:set var="$color_class">
    <xen:if is="{$options.1} == 'orange'">
        bbm_hl_orange
    <xen:elseif is="{$options.1} == 'blue'" />
        bbm_hl_blue
    <xen:elseif is="{$options.1} == 'green'" />
        bbm_hl_green
    <xen:else />
        bbm_hl_yellow
    </xen:if>
</xen:set>

<span class="bbm_hl {$color_class}">{xen:raw $content}</span>

<xen:comment>
    Here is a command to get all information available in the $rendererStates variable:
    {xen:helper dump, $rendererStates}
</xen:comment>

still to complicated for me... i can do basic CSS but i not familiar with the xenforo Dev code
 
Last edited:
New registration are not allowed - I can't access.

still to complicated for me
It's a nice opportunity to learn isn't it?

  • <xen:set var="$abc">Hello world!</xen:set> creates the variable $abc and give it the value "Hello world!".
  • <xen:if is=""></xen:if> checks for a condition ; you just need to learn the "if, then, else" logic.
  • {$options} is an array of your Bb Code options. {$optons.1} will be the first option of your tag: [marquee=option1|option2]Content[/marquee]
  • {$content} is the content your Bb Code
    The "raw" command allows to display full html {xen:raw $content}. For example your content is in bold and the raw prefix is not there, you will see the text wrapped between <b> html tag. If there's the raw prefix, the html will be parsed.
That all you need to know at the moment ; you want to make a maquee Bb Code with the marquee html tag. As you can see here, it can have many options. Let's say you only want to make the text direction as an option (otherwise a callback you will be better to check options using php). Here are the text direction characteristics:
direction: Sets the direction of the scrolling within the marquee. Possible values are left, right, up and down. If no value is specified, the default value is left.

So let's code this simple code:
Code:
<xen:set var="$direction">
   <xen:if is="in_array({$options.1}, array('left', 'right', 'up', 'down'))">
     {$options.1}
   <xen:else />
     left
   </xen:if>
</xen:set>

<div class="bbm_marquee"><marquee direction="{xen:string trim, $direction}">{xen:raw $content}</marquee></div>
I think it's pretty easy to understand, if it's not, just ask a specific question.

If you need to include a css template, just use the syntax:
Code:
<xen:require css="your_css_template_name.css" />

Edit: code updated with the trim helper (allows to delete blank characters at the start and end of a string) => required for the text direction option.
 
Last edited:
ed869.png


for guests.. but i turned off now as i has to go.. but will be back later on

thx for advice.. il look into it once i well rested..
 
@XxUnkn0wnxX
Thanks for your pm. Just add this in your extra template:
Code:
.mce-tinymce .fa {
font-family: FontAwesome;
}
This should be enough to override the default TinyMce font. I'm not sure why it's working on my config and not on yours. Anyway, this simple fix will work.

Edit: it's not working because of the direct MCE skin. I will add the above css when a new TinyMCE version will be released.
 
is this correct - want add more options not just directions


Code:
<xen:set var="$direction">
<xen:set var="$behavior">
   <xen:if is="in_array({$options.1}, array('left', 'right', 'up', 'down'))">
  <xen:if is="in_array({$options.1}, array('alternate', 'slide', 'up'))">
     {$options.1}
   <xen:else />
     left
   </xen:if>
</xen:set>

<div class="bbm_marquee"><marquee direction="{xen:string trim, $direction}">{xen:raw $content}</marquee></div>
<div class="bbm_marquee"><marquee behavior="{xen:string trim, $behavior}">{xen:raw $content}</marquee></div>

i think it wrong... + needs to be able to be used in combination with direction EG:

<marquee behavior="scroll" direction="up">Your upward scrolling text goes here</marquee>

i'm still confused on this... i tried analyzing other bb codes they all different no where near simple
 
Hello, I think that there is a bug.

Now, in every private message, all the links appear as "protected"

Do you know a way to fix it?

Thanks! =)

Schermata 2015-01-09 alle 09.22.02.webp
 
@XxUnkn0wnxX
The more options, you will add, the more complex your Bb Code code will be. When there are several options, I prefer to use php to manage options, but I will show you how to do it in templates. Since the XenForo commands you are using are based on php, if you understand the XenForo code, you should understand the same code in php.

New: the following text has been written after the below one. It seems the other behaviors require a width and height for a better display and the slide & alternate ones can support nested marquee tags ; which requires more code and manipulation on the Bb Code content. My advice is you try the below explanations but you shouldn't spend too much time on it. This marquee tag is said to be not standard (ref) and any animated text can annoy readers.

A few comments on what you did:
  • The way variable you set variable is not correct. You need to set them one by one. Let's create 3 variables $a, $b and $c. Their value will be for each 1, 2 and 3.
    Code:
    <xen:set var="$a">1</xen:set>
    <xen:set var="$b">2</xen:set>
    <xen:set var="$c">3</xen:set>
    As you see, it's like a Bb Code: there's an opening tag and there's a closing tag. Your code is missing that. Please note that when you will want to use $a, $b or $c in your templates (after they have been set), you will have to put the variable between brackets: {$a}, {$b}, {$c}. When XenForo is using the template to display it, that will tell it, it's a variable. Example:
    Code:
    <xen:set var="$a">1</xen:set>
    <xen:set var="$b">2</xen:set>
    <xen:set var="$c">3</xen:set>
    The value of variable $a is {$a}.
    The value of variable $b is {$b}.
    The value of variable $c is {$c}.
  • The new option you're adding "behavior" can work with the option "direction". So there are not in competition: both can be used at the same time.
    Example:
    • [marquee=left|slide]Text[/marquee] => should be able to work
    • [marquee=slide|left]Text[/marquee] => should also be able to work ; that would be better for your users
    If you want only want to make the first option the "direction" option and the second option the "behavior" option, it's easy:
    Code:
    <xen:set var="$direction">
       <xen:if is="in_array({$options.1}, array('left', 'right', 'up', 'down'))">
         {$options.1}
       <xen:else />
         left
       </xen:if>
    </xen:set>
    
    <xen:set var="$behavior">
       <xen:if is="in_array({$options.2}, array('alternate', 'slide', 'up'))">
         {$options.2}
       <xen:else />
         scroll
       </xen:if>
    </xen:set>

    I don't know if you understand the "in_array" function. If you don't, you need to know what an array is. A variable can have a direct and simple value (ie: 1 or 2 or 3 or "Welcome world"), or can have an array. An array is like a table with several values in it ; it's like the battleship game. The example below will use php (it's easier to set array in php than in XenForo templates):
    PHP:
    $myVariable = array("a", 2, 3, "Hello world !");
    
    /***
    *   Here's how is structured your array:
    *   0: "a"
    *   1: 2
    *   2: 3
    *   3: "Hello world !"
    *   
    *   As you see the index is starting at 0, so the index for the fourth element is 3
    ***/
    
    //To get the value "Hellow world !"
    $value = $myVariable[3];
    //To get the value "a"
    $value = $myVariable[0];
    So the "in_array" function is going to check if the first argument (the needle) is inside the second argument: the array.
    Code:
    in_array(argument_1, argument_2)
    Code:
    in_array({$needle}, {$array})
    Code:
    in_array({$options.1}, array('left', 'right', 'up', 'down'))


  • You add two elements in your code whereas it should only have one:
    Code:
    <div class="bbm_marquee"><marquee direction="{xen:string trim, $direction}">{xen:raw $content}</marquee></div>
    <div class="bbm_marquee"><marquee behavior="{xen:string trim, $behavior}">{xen:raw $content}</marquee></div>
    Should be instead:
    Code:
    <div class="bbm_marquee">
       <marquee direction="{xen:string trim, $direction}" behavior="{xen:string trim, $behavior}">{xen:raw $content}</marquee>
    </div>

So here's a possible code that is NOT user friendly for your users (the first option need to be the direction and the second the behavior):
Code:
<xen:set var="$direction">
   <xen:if is="in_array({$options.1}, array('left', 'right', 'up', 'down'))">
     {$options.1}
   <xen:else />
     left
   </xen:if>
</xen:set>

<xen:set var="$behavior">
   <xen:if is="in_array({$options.2}, array('alternate', 'slide', 'up'))">
     {$options.2}
   <xen:else />
     scroll
   </xen:if>
</xen:set>

<div class="bbm_marquee">
   <marquee direction="{xen:string trim, $direction}" behavior="{xen:string trim, $behavior}">{xen:raw $content}</marquee>
</div>

Here's another one that is user friendly:
Code:
<xen:comment>Let's set the default value</xen:comment>
<xen:set var="$behavior">scroll</xen:set>
<xen:set var="$direction">left</xen:set>

<xen:comment>Let's check all Bb Code options in a loop</xen:comment>
<xen:foreach loop="$options" value="$value">
   <xen:if is="in_array({$value}, array('left', 'right', 'up', 'down'))">
     <xen:set var="$direction">{$value}</xen:set>
   <xen:elseif is="in_array({$value}, array('alternate', 'slide', 'scroll'))" />
     <xen:set var="$behavior">{$value}</xen:set>
   <xen:else />
     Do nothing
   </xen:if>
</xen:foreach>

<div class="bbm_marquee">
   <marquee behavior="{xen:string trim, $behavior}" direction="{xen:string trim, $direction}">{xen:raw $content}</marquee>
</div>
 
Last edited:
Hi,

I just maybe found a bug.

1. Created a post with links (With Bb Codes & Buttons Manager Off)
post with links created - bb off.webp
2. Enabled Bb Codes & Buttons Manager and edited the post, just to verify everything works with Bb Codes & Buttons Manager enabled
post with links created - bb on - post edited.webp
3. Moved the thread (With Bb Codes & Buttons Manager Off), everything looks fine
post with links created - bb off - post moved.webp
4. After the move I enable Bb Codes & Buttons Manager again
post with links created - bb on - after moved.webp

5. Now the first URL always fails to work.
Even if I add a new different URL its always the first one that is broken.
upload_2015-1-9_12-15-31.webp

6. If I disable the Bb Codes & Buttons Manager the url's show up as normal again.
upload_2015-1-9_12-17-4.webp

Can anyone verify this, or is it only for me it happens?
 
Top Bottom