Bbcode

Summary: BBcode for PmWiki
Version: 080326
Prerequisites: -
Status: Release candidate
Maintainer: Jantah
Discussion: Bbcode-Talk
Categories: Markup

Questions answered by this recipe

  1. How do I use BBcode tags in pmWiki pages?

Description

This recipe adds BBcode formatting to the pmWiki markup. Most BBcode tags are translated to their pmWiki equivalent and than passed through the standard PmWiki engine.

The tags that seem to be shared by most forum systems are supported.

Installation

  1. Download the following file: bbcode.phpΔ and save in your cookbook directory.
  2. Add the following line into your local/config.php script:
    require_once ("cookbook/bbcode.php");

Features

The following BBcode tags can now be used in pmWiki pages:

BBcode pmWiki equivalent Description
[b]text[/b] '''text''' Bold text
[i]text[/i] ''text'' Italics text
[u]text[/u] {+text+} Underlined text
[size=##]text[/size] n/a Resize text to "##" points
[color=ccc]text[/color] %color=ccc%text%color%] Dispay text in color "ccc".
[url]weblink[/url] [[weblink]] Link to "weblink".
[url=weblink]text[/url] [[weblink | text]] Link "text" to "weblink".
[email]address[/email] [[mailto:address | address]] Link "address" to "mailto:address".
[img]imgurl[/img] imgurl Display the image found at "imgurl".
[code]snippet[/code] n/a Display "snippet" in a code block
[quote]Text[/quote] n/a Display "Text" as a quote
[quote="author"]Text[/quote] n/a Display "Text" as a quote from "author"

The format of a quote can be altered by setting the $BbCodeQuoteFmt variable in your local/config.php.

The format of the code block can be altered by setting the $BbCodeCodeFmt variable in your local/config.php.

Known issues

  • If [code] tags are enclosed by pmWiki code tags ("[@" and "@]"), they are still translated. This is because the BBCode [code] tags are processed before the PmWiki tags "[@" and "@]"
  • Quotes can not be nested.
  • Only image types supported by PmWiki will be displayed: gif, jpg, jpeg, png, bmp, ico and wbmp

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

  • March 26th 2008 - version 080326
    • Added [quote] tag.
    • Code between [code] tags is now displayed in a block.
  • March 15th 2008 - version 080315
    • Initial release

See Also

Contributors

Jantah

Comments

See discussion at Bbcode-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.