1

When using PHP's BBCode extension, does anyone know what BBCODE_TYPE_ROOT means exactly? It doesn't seem necessary, at least with this example, however, it is used in most of the examples in the documentation.

The documentation is pretty vague about this element:

BBCODE_TYPE_ROOT (integer)

This BBCode tag is the special tag root (nesting level 0).

Thank you in advance.

Dragontamer5788
  • 1,957
  • 1
  • 12
  • 20
  • Here's what I think about BBCode: http://stackoverflow.com/questions/3788959/regex-to-split-bbcode-into-pieces/3792262#3792262 – NullUserException Oct 06 '10 at 03:41
  • The community I plan on building is based off of forums. I practically expect everyone on the site to come from a PHPBB-based community or VBulletin. Forcing them to learn yet another markup language because I think its easier is just arrogant. BBCode is standard to my audience, and they've already demonstrated their comfort with it. – Dragontamer5788 Oct 06 '10 at 14:16

1 Answers1

1

Okay, I kept experimenting and looking at examples, and I figured it out.

The key example is on this page. Notice, the [i]Italic Text[/i] example does not get translated into HTML. This is because !i was specified under the root element. Basically, this BBCode interpreter understands the "tree" that BBCode creates. Using parents and children, you can create [ul] and [li] items respectively. Perhaps, you'd like to add properties to the "highest level" element. The !i example prevents italic text from being used when no tags have been used yet, ie: under the root element.

So if you keep the tree structure of BBCode in mind, then the BBCODE_TYPE_ROOT element is the root element. Kinda like the < HTML> element in HTML pages, except its invisible in BBCode.

Dragontamer5788
  • 1,957
  • 1
  • 12
  • 20