https://www.icyphoenix.com/viewtopic.php?f=4&t=4403&p=30469#p30469
-----------------------------------
Mighty Gorgon
Mon 11 Aug, 2008 02:25

Re: How To Add Icy Phoenix BBCode Parsing To MODS Or Other P
-----------------------------------
That is correct... but remember you should make sure that bbcode.php has been correctly included and $bbcode defined as global if using that code within functions or classes.

This is the code that may be used:
[list][*]For inclusion:
[codeblock]@include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);[/codeblock]
[*]To declare var as global where needed:
[codeblock]global $bbcode;[/codeblock][/list]

Plus you may want to decide what to parse or not...
[codeblock]$bbcode->allow_html = false;
$bbcode->allow_bbcode = true;
$bbcode->allow_smilies = true;[/codeblock]

Other 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]


