Kh99 has already answered but this is another way!
NON-VB
Add it to the top of the template where it shows/pastes
PHP Code:
Just include the string
<?php include 'bb2html.php';?>
And to call it simply write
<?php $htmltext = bb2html($bbtext);?>
[/code]
Then upload this file:
Call it: bb2html.php
[code]
<?php
// A simple FAST parser to convert BBCode to HTML
// Trade-in more restrictive grammar for speed and simplicty
//
// Syntax Sample:
// --------------
// [img]http://pvhax.com/images/star.gif[/img]
// [url="http://pvhax.com"]PvHax[/url]
// [mail="webmaster@pvhax.com"]Webmaster[/mail]
// [size="25"]HUGE[/size]
// [color="red"]RED[/color]
// [b]bold[/b]
// [i]italic[/i]
// [u]underline[/u]
//[list][*]item[*]item[*]item[/list]// [code]value="123";[/code]
// [quote]John said yadda yadda yadda[/quote]
//
// Usage:
// ------
// <?php include 'bb2html.php'; ?>
// <?php $htmltext = bb2html($bbtext); ?>
function bb2html($text)
{
$bbcode = array("<", ">",
"[list]", "[*]", "[/list]",
"[img]", "[/img]",
"[b]", "[/b]",
"[u]", "[/u]",
"[i]", "[/i]",
'[color="', "[/color]",
"[size=\"", "[/size]",
'[url="', "[/url]",
"[mail=\"", "[/mail]",
"[code]", "[/code]",
"[quote]", "[/quote]",
'"]');
$htmlcode = array("<", ">",
"<ul>", "<li>", "</ul>",
"<img src=\"", "\">",
"<b>", "</b>",
"<u>", "</u>",
"<i>", "</i>",
"<span style=\"color:", "</span>",
"<span style=\"font-size:", "</span>",
'<a href="', "</a>",
"<a href=\"mailto:", "</a>",
"<code>", "</code>",
"<table width=100% bgcolor=lightgray><tr><td bgcolor=white>", "</td></tr></table>",
'">');
$newtext = str_replace($bbcode, $htmlcode, $text);
$newtext = nl2br($newtext);//second pass
return $newtext;
}
?>