Source for file _bbcode.plugin.php
Documentation is available at _bbcode.plugin.php
* This file implements the BBcode plugin for b2evolution
* BB style formatting, like [b]bold[/b]
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
$this->long_desc =
T_('Available tags are: [b] [i] [u] [s] [color=...] [size=...] [font=...] [code] [quote] [list=1] [list=a] [list] [*]');
* Get the default settings of the plugin.
'post_settings_begin' =>
array(
'layout' =>
'begin_fieldset',
'label' =>
$this->T_( 'Settings for posts' ),
'post_search_list' =>
array(
'label' =>
$this->T_( 'Search list'),
'note' =>
$this->T_( 'This is the BBcode search array for posts (one per line) ONLY CHANGE THESE IF YOU KNOW WHAT YOU\'RE DOING' ),
'type' =>
'html_textarea',
'defaultvalue' =>
'#\[b](.+?)\[/b]#is
!\[color=(#?[A-Za-z0-9]+?)](.+?)\[/color]!is
#\[size=([0-9]+?)](.+?)\[/size]#is
#\[font=([A-Za-z0-9 ;\-]+?)](.+?)\[/font]#is
#\[quote](.+?)\[/quote]#is
#\[list=1](.+?)\[/list]#is
#\[list=a](.+?)\[/list]#is
!\[bg=(#?[A-Za-z0-9]+?)](.+?)\[/bg]!is',
'post_replace_list' =>
array(
'label' =>
$this->T_( 'Replace list'),
'note' =>
$this->T_( 'This is the replace array for posts (one per line) it must match the exact order of the search array' ),
'type' =>
'html_textarea',
'defaultvalue' =>
'<strong>$1</strong>
<span style="text-decoration:underline">$1</span>
<span style="text-decoration:line-through">$1</span>
<span style="color:$1">$2</span>
<span style="font-size:$1px">$2</span>
<span style="font-family:$1">$2</span>
« $1 »
<span style="background-color:$1">$2</span>',
'post_settings_end' =>
array(
'layout' =>
'end_fieldset',
'comment_settings_begin' =>
array(
'layout' =>
'begin_fieldset',
'label' =>
$this->T_( 'Settings for comments' ),
'render_comments' =>
array(
'label' =>
$this->T_('Render comments' ),
'note' =>
$this->T_('If enabled the BBcode in comments will be rendered'),
'comment_search_list' =>
array(
'label' =>
$this->T_( 'Search list'),
'note' =>
$this->T_( 'This is the BBcode search array for COMMENTS (one per line) ONLY CHANGE THESE IF YOU KNOW WHAT YOU\'RE DOING' ),
'type' =>
'html_textarea',
'defaultvalue' =>
'#\[b](.+?)\[/b]#is
!\[color=(#?[A-Za-z0-9]+?)](.+?)\[/color]!is
#\[size=([0-9]+?)](.+?)\[/size]#is
#\[font=([A-Za-z0-9 ;\-]+?)](.+?)\[/font]#is
#\[quote](.+?)\[/quote]#is
#\[list=1](.+?)\[/list]#is
#\[list=a](.+?)\[/list]#is
!\[bg=(#?[A-Za-z0-9]+?)](.+?)\[/bg]!is',
'comment_replace_list' =>
array(
'label' =>
$this->T_( 'Replace list'),
'note' =>
$this->T_( 'This is the replace array for COMMENTS (one per line) it must match the exact order of the search array' ),
'type' =>
'html_textarea',
'defaultvalue' =>
'<strong>$1</strong>
<span style="text-decoration:underline">$1</span>
<span style="text-decoration:line-through">$1</span>
<span style="color:$1">$2</span>
<span style="font-size:$1px">$2</span>
<span style="font-family:$1">$2</span>
« $1 »
<span style="background-color:$1">$2</span>',
'comment_settings_end' =>
array(
'layout' =>
'end_fieldset',
* @see Plugin::RenderItemAsHtml()
$content =
& $params['data'];
* Do the same as for HTML.
* @see RenderItemAsHtml()
* Render comments if required
* @see Plugin::FilterCommentContent()
if( $this->Settings->get( 'render_comments' ) )
$content =
& $params['data'];
* $Log: _bbcode.plugin.php,v $
* Revision 1.17.2.3 2006/12/26 03:18:50 fplanque
* assigned a few significant plugin groups
* Revision 1.17.2.2 2006/11/04 19:55:11 fplanque
* Reinjected old Log blocks. Removing them from CVS was a bad idea -- especially since Daniel has decided branch 1.9 was his HEAD...
* Revision 1.17 2006/07/31 16:12:18 yabs
* Modified 'allow_html' to html_input/html_textarea
* Revision 1.16 2006/07/31 07:52:03 yabs
* Moved search and replace arrays to Settings
* Added new Setting to enable rendering of comments
* Added 2 new Settings for comment search and replace arrays
* Revision 1.15 2006/07/10 20:19:30 blueyed
* Fixed PluginInit behaviour. It now gets called on both installed and non-installed Plugins, but with the "is_installed" param appropriately set.
* Revision 1.14 2006/07/07 21:26:49 blueyed
* Revision 1.13 2006/07/06 19:56:29 fplanque
* Revision 1.12 2006/06/16 21:30:57 fplanque
* Started clean numbering of plugin versions (feel free do add dots...)
* Revision 1.11 2006/05/30 19:39:55 fplanque
* Revision 1.10 2006/04/11 21:22:26 fplanque