HOMER_1, Как то так по ходу
<?
function text_msg($msg){
$bbcode=array();
$bbcode['/n/isU']='<br>';
global $ank;
if ($_SERVER['PHP_SELF'] != '/cforum.php')
{
if($ank['access'] >= 1){
$bbcode['/
(.+)/isU'] = '<center>$1</center>';
$bbcode['/
(.+)/isU'] = '<b>$1</b>';
$bbcode['/
(.+)/isU'] = '<i>$1</i>';
$bbcode['/
(.+)/isU'] = "<a href='$1'>$2</a>";
$bbcode['/[img=(.*?)]/isU'] = "<img src='$1'>$2</a>";
$bbcode['/[a](.+)[/a]/isU'] = "<a>$1</a>";
$bbcode['/[color=(.+)](.+)[/color]/isU'] = "<font color='$1'>$2</font>";
}
}
else
{
if($ank['access'] >= 0){
$bbcode['/
(.+)/isU'] = '<center>$1</center>';
$bbcode['/
(.+)/isU'] = '<b>$1</b>';
$bbcode['/
(.+)/isU'] = '<i>$1</i>';
$bbcode['/
(.+)/isU'] = "<a href='$1'>$2</a>";
$bbcode['/[img=(.*?)]/isU'] = "<img src='$1'>$2</a>";
$bbcode['/[a](.+)[/a]/isU'] = "<a>$1</a>";
$bbcode['/[color=(.+)](.+)[/color]/isU'] = "<font color='$1'>$2</font>";
}
}
?>