Formatting Posts Using BBCode

phpBB provides a potent and safe HTML substitute, known as BBCode, so users can format their text (bold, italic, underline, and so on) without exposing your board to the possibility of malicious HTML. BBCode is usable in forum posts, private messages, and signatures (small lines of text registered users can optionally attach to every post). The BBCode system is incredibly powerful and easily customized via phpBB's template engine, which I will discuss in Chapter 12.

Table 9-1 outlines the available BBCode in default installations of phpBB 2.0. As Table 9-1 illustrates, BBCode tags are used much like HTML. Note the usage of square brackets versus HTML's angle brackets.

Table 9-1. BBCode Available in phpBB 2.0

BBCode Tag*

Formatting Result

[b]Bold text.[/b]

Creates bold text

[i]Italic text.[/i]

Creates italic text

[u]Underlined text.[/u]

Creates underlined text

[quote]Quoted text[/quote]

Puts text in a smaller font, indented, and set off by a box

[code]Program code[/code]

Sets off text similarly to quoted text, and displays it in

monospace

[list][*]Item in the list[/list]

[list] starts the list; [*] is an item in the list

[list=a][*]Alphabetized

Same as a regular BBCode list, but makes an alphabetically

list[/list]

ordered list

[list=1][*]Numbered list[/list]

Same as a regular BBCode list, but makes a numerically

ordered list

[img]http://path/to/image[/img]

Embeds an image in a forum post

[url]http://path/to/link[/url]

Embeds a link in a post

[url=http://link]Link text[/url]

Links the text between the [url] tags to http://link

[color=colorname]Text[/color]

Changes the text between the [color] tags to whichever

color name (red, blue, and so, on) or hexadecimal code (as

in HTML) you specify

[size=pointsize]Text[/size]

Changes the point size of the text to the number you specify

*Some installations of phpBB across the Internet may contain modifications that add additional BBCode or modify the behavior of existing BBCode. This table lists the base set of BBCode tags.

*Some installations of phpBB across the Internet may contain modifications that add additional BBCode or modify the behavior of existing BBCode. This table lists the base set of BBCode tags.

Users can access BBCode two ways: manually type in the code or use phpBB's formatting toolbar, available in the post form, which looks like Figure 9-1 (clad in the default subSilver style).

Figure 9-1. The BBCode formatting toolbar on the post form

The phpBB formatting toolbar offers lull control over BBCode directly from the form. To get an explanation for each formatting option in the toolbar, simply hover the mouse over its button, and a description will appear in a line above the text box.

Users have the option of disabling BBCode in each of their posts by setting the corresponding option in their profile (as discussed in the "Setting User Preferences" section later in this chapter), or they can turn BBCode off in an individual post by checking the "Disable BBCode in this post" check box located at the bottom of the post form. To see the results of their formatting before making a live post, users can select the Preview button in the post form (before choosing the Submit button). When they are satisfied with their formatting, they can submit their post.

Was this article helpful?

0 0

Post a comment