https://www.icyphoenix.com/viewtopic.php?f=4&t=2245&p=16312#p16312
-----------------------------------
Mighty Gorgon
Sun 10 Jun, 2007 04:45

Re: [BBcodes]How to use the Bicet / MG customised bbcode.php
-----------------------------------
You have some examples on top of bbcode.php:

[codeblock]/*

=================
Includes
=================

include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

=================
Globals
=================

global $bbcode;

=================
BBCode Parsing
=================

$text = $bbcode->parse($text, $bbcode_uid);

=================
BBCode Conditions
=================

$bbcode->allow_html = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? true : false;
$bbcode->allow_bbcode = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? true : false;
$bbcode->allow_smilies = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? true : false;

=================

$html_on = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? 1 : 0 ;
$bbcode_on = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? 1 : 0 ;
$smilies_on = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? 1 : 0 ;

$bbcode->allow_html = $html_on;
$bbcode->allow_bbcode = $bbcode_on;
$bbcode->allow_smilies = $smilies_on;

=================

$bbcode->allow_html = ( $board_config['allow_html'] ? $board_config['allow_html'] : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] ? $board_config['allow_bbcode'] : false );
$bbcode->allow_smilies = ( $board_config['allow_smilies'] ? $board_config['allow_smilies'] : false );

=================

$bbcode->allow_html = $board_config['allow_html'];
$bbcode->allow_bbcode = $board_config['allow_bbcode'];
$bbcode->allow_smilies = $board_config['allow_smilies'];

=================

$bbcode->allow_html = ( ($board_config['allow_html'] && $row['enable_bbcode']) ? true : false );
$bbcode->allow_bbcode = ( ($board_config['allow_bbcode'] && $row['enable_bbcode']) ? true : false );
$bbcode->allow_smilies = ( ($board_config['allow_smilies'] && $row['enable_smilies']) ? true : false );

=================

$bbcode->allow_html = ( $board_config['allow_html'] && $postrow[$i]['enable_bbcode'] ? true : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] && $postrow[$i]['enable_bbcode'] ? true : false );
$bbcode->allow_smilies = ( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] ? true : false );

=================

$bbcode->allow_smilies = ( $board_config['allow_smilies'] ? $board_config['allow_smilies'] : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] ? $board_config['allow_bbcode'] : false );
//$bbcode->allow_bbcode = ( $bbcode_uid != '' ? $board_config['allow_bbcode'] : false );
=================

=================================
Acronyms, Autolinks, Word Wrap
=================================

$orig_autolink = array();
$replacement_autolink = array();
obtain_autolink_list($orig_autolink, $replacement_autolink, 99999999);
if( function_exists( 'acronym_pass' ) )
{
	$text = acronym_pass( $text );
}
if( count($orig_autolink) )
{
	$text = autolink_transform($text, $orig_autolink, $replacement_autolink);
}
$text = kb_word_wrap_pass ($text);
====================


*/[/codeblock]

You can eventually try to guess the correct way to use it by inspecting some files where it is used... viewtopic, blocks, shoutbox, news...

Finally a small correction.

The original code was developed by CyberAlien, and then ported by me into XS.

Here are a small adaptation on how to use a basic BBCode parsing function into any php file:

http://www.mightygorgon.com/viewtopic.php?t=2778


