From XMBdocs
Revision as of 16:03, 26 December 2017 by Miqrogroove (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

BBCode is an abbreviation for Bulletin Board Code. BBCode is essentially a series of tags that can be used to style or format text in posts. Examples of BBCode's uses are centered text, lists, varying font sizes and colors in posts.

The Basics

To use bbcode you first need to know what the effect is you're trying to reach. For example, we want, in the following text:

These few words in this text should be bold, while these should not

to have bold words. Looking at the table below, we can see that the bbcode to make text bold is

[b]bold text[/b]

Thus, having the following text:

[b]These few words in this text should be bold[/b], while these should not

will make the text look like this:

These few words in this text should be bold, while these should not

A few basic rules for all bbcode:

  • all bbcode must be closed, so having [a] means we also need to have [/a] which "closes" it. The only exception to this is when using [*]
  • although some bbcode can be used in a case-insensitive way (ie. you can use both [img][/img] and [IMG][/IMG], this is not guaranteed to work in all cases. To be on the safe side, try using it in lower-case if you can (ie. [b][/b] instead of [B][B]) to minimize processing time required to transform these to HTML.

Text Formatting

Opening Tag Closing Tag Effect Additional Information
[b] [/b] Makes the enclosed text bold
[i] [/i] Makes the enclosed text italic
[u] [/u] Makes the enclosed text underlined
[strike] [/strike] Strikes the enclosed text
[blink] [/blink] Makes the enclosed text blink
[marquee] [/marquee] <marquee>Makes the enclosed text scroll right to left</marquee>
[color=X] [/color] Changes the enclosed text color to X X may be a hexadecimal RGB value (#000000 - #FFFFFF), rgb(0,0,0) - rgb(128,128,128), or any other standard CSS color value (Red, Green, etc).
[size=X] [/size] Changes the size of the enclosed text to X x is an offset form base-font-size. For example: If the forum font was set to 10pt, [size=]text[/size] would show "text" in 15pt font size. Size range is from -10 to 99.
[font=X] [/font] Changes the font of the enclosed text to X X can be any font but it is advised to stick with the standard fonts installed on most computers (Arial, Times New Roman, Verdana, etc.)
[align=X] [/align] Aligns the enclosed text to X X can be any one of the following: left, center, right, or justify.

Text Structure

opening tag closing tag effect remarks
[quote] [/quote]
Quotes this text
When a quote is generated by XMB, the first line usually contains the author of the quoted post: [i]Originally posted by EXAMPLE:[/i]
[code] [/code]
This is code
Text enclosed in [code][/code] bbcode will preserve whitespace and will be shown in monotype font (so all characters have the same width and height). Smilies and other bbcode will not be parsed inside [code][/code] tags (Although it currently is being parsed in XMB 1.9.x, this is actually a bug.)

Block Elements

opening tag closing tag effect remarks
[img] [/img] [content is replaced with the image]
[img=AxB] [/img] [content is replaced with the image, resized to AxB px]
[url] [/url] link to the url provided
[url=?] [/url] the text provided, linking to url url
[email] [/email] link to the email provided
[email=?] [/email] the text provided, linking to email email

[list] Text Here [/list] - This will create a list from the text, in bullet points.
[poem] Text Here [/poem] - This will show the text in poem style. Meaning, italicized and centered.
[vinfo] - This will show the version info for this XMB version.
[list] - Starts a list, list can also take one of the following arguments: - [list=1] - [list=a] - [list=A] [/list] ends the list - End the current list [*] Text - When [*] is placed in a list, it will provide a bullet in front of the text.
[credits] - Shows credits for XMB [buildedition] - Shows the build-id for this XMB-version