Tags:
editing1Add my vote for this tag create new tag
, view all tags

BBCodePlugin

Allows users to use BBCode. (BETA)

Syntax Rules

Standard BBCode. See http://www.phpbb.com/community/faq.php?mode=bbcode.

In addition to standard BBCode the [BR] tag is available, which renders as a linebreak (<BR />).

Examples

Tag Example Renders as (if installed) Preview (simulated)
B
[b]bolded text[/b]
[b]bolded text[/b] bolded text
I
[i]italicized text[/i]
[i]italicized text[/i] italicized text
U
[u]underlined text[/u]
[u]underlined text[/u] underlined text
URL
[url]http://twiki.org[/url]
[url]http://twiki.org[/url] http://twiki.org
URL
[url=http://twiki.org]TWiki Home[/url]
[url=http://twiki.org]TWiki Home[/url] TWiki Home
EMAIL
[email]no.one@domain.adr[/email]
[email]no.one@domain.adr[/email] no.one@domain.adr
IMG
[img]http://twiki.org/p/pub/TWiki04/TWikiLogos/T-logo-158x45-t.gif[/img]
[img]http://twiki.org/p/pub/TWiki04/TWikiLogos/T-logo-158x45-t.gif[/img]
QUOTE
[quote=Author]quoted text[/quote]
[quote=Author]quoted text[/quote]
Author wrote:
quoted text
CODE
[code]monospaced text[/code]
[code]monospaced text[/code]
Code:
monospaced text
SIZE
[size=15]Large Text[/size]
[size=15]Large Text[/size] Large Text
COLOR
[color=red]Red Text[/color]
[color=red]Red Text[/color] Red Text
LIST
[list] 
[*]Red
[*]Blue
[*]Yellow
[/list]
[list]
[*]Red
[*]Blue
[*]Yellow
[/list]

  • Red
  • Blue
  • Yellow
LIST
[list=1] 
[*]Go to the shops
[*]Buy a new computer
[*]Swear at computer when it crashes
[/list]
[list=1]
[*]Go to the shops
[*]Buy a new computer
[*]Swear at computer when it crashes
[/list]

  1. Go to the shops
  2. Buy a new computer
  3. Swear at computer when it crashes
BR
line1[br]line2[br]line3
line1[br]line2[br]line3 line1
line2
line3

Plugin Settings

Plugin settings are stored as preferences variables. To reference a plugin setting write %<plugin>_<setting>%, i.e. %BBCODEPLUGIN_SHORTDESCRIPTION%

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Allows the use of standard bbcode in topics. (BETA)

  • Set the bbcode tags which are allowed. Only these tags will be rendered in topics. The available tags are: B, I, U, IMG, URL, EMAIL, LIST, CODE, QUOTE, COLOR, SIZE and BR. See the examples above for the tag names. Seperate them by commas (see example). Leave empty to allow all tags
    Example: Set TAGS = I, B, U
    • Set TAGS =

  • Set On to allow Javascript URLS. This allows users to execute javascript using [url]-tags. When non-trusted users have access to your TWiki it is better to leave this setting Off.
    • Set ALLOW_JAVASCRIPT = Off

  • When set to On you can use <bbcode> tags to create blocks of bbcode. See bbcode blocks below.
    • Set ALLOW_BLOCKS = On

  • Set the background color of bbcode blocks. Default is #eaeaea.
    • Set BACKGROUND =

  • Allow bbcode outside bbcode blocks. When set to Off you can only use bbcode inside blocks.
    • Set ALLOW_FREESTYLE = On

  • When set to On all HTML in bbcode blocks is disabled and shown verbatim. This allows for an easy way to post snippets of HTML code.
    • Set NOHTML = On

NOTE: By setting both %ALLOW_BLOCKS% and %ALLOW_FREESTYLE% to Off you are effectively disabling this plugin.

Freestyle bbcode and blocks

This plugin allows for two ways to use bbcode in your topics. When using freestyle bbcode you just put bbcode where you want. You can also use bbcode blocks. BBCode blocks are delimited by <bbcode> tags.

There are three advantages of using blocks over free bbcode:

  • By turning off %ALLOW_FREESTYLE% you force users to make it explicit they are using bbcode. This can lead to less errors and confusion, but it is more typing.
  • When %NOHTML% is turned on all HTML in bbcode blocks is disabled and shown verbatim. This is an easy way to include HTML in topics without rendering it (similar to <verbatim>).
  • Newlines are preserved in bbcode blocks. This makes BBCode blocks particularly useful to copy/paste pieces of bbcode from other sites in your topic.

BBCode block example

Source

[quote=JohnDoe]
Does anybody now why  my supersize perl application is broken? The only change I made was adding this line:
    
   [code]
      $| = 3;
   [/code]
[/quote]
    
I have [b]no[/b] idea. 
I will consult some real l33t perl experts for you.
    

Rendering

[quote=JohnDoe] Does anybody now why my supersize perl application is broken? The only change I made was adding this line:

[code] $| = 3; [/code] [/quote]

I have [b]no[/b] idea. I will consult some real l33t perl experts for you.

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip BBCodePlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/BBCodePlugin.txt Plugin topic
    data/TWiki/BBCodePlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/BBCodePlugin.pm Plugin Perl module
    lib/TWiki/Plugins/BBCodePlugin/BBCode.pm Plugin Perl module
  • Configure the Plugin:
    • TWiki 4.0 and up: Run the configure script to enable the Plugin
    • Change the Plugin settings as needed
  • Test if the installation was successful:

Plugin Info

Plugin Author: TWiki:Main.JosKunnekes
Copyright: © 2007, TWiki:Main.JosKunnekes
License: GPL (GNU General Public License)
Plugin Version: V0.99 (BETA)
Change History:  
27 Jun 2007: Fixed a weird bug, which broke the plugin under Linux
09 Jun 2007: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Benchmarks: GoodStyle 99%, FormattedSearch 99%, BBCodePlugin 99%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/BBCodePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/BBCodePluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/BBCodePluginAppraisal

-- TWiki:Main.JosKunnekes - 09 Jun 2007


Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip BBCodePlugin.zip r2 r1 manage 13.7 K 2007-06-27 - 15:37 JosKunnekes  
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-06-27 - JosKunnekes
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.