Using HTML and BBCode together

The script I’m using allows you to use BBCode in messages. The code looks like this:

$body = nl2br( htmlentities2utf8($obj[‘body’], ( $PREFS->conf[‘enable_bbcode’] && $PREFS->conf[‘bbcode_pms’] ) ) );

I modified the code so the admin could use HTML in messages as well. The admin has the ID=1 on the site. Here is the code I came up with:

$body = ( $quickmsg OR $obj[‘group_id’] == 1 ) ? nl2br($obj[‘body’]) : nl2br( htmlentities2utf8($obj[‘body’], ( $PREFS->conf[‘enable_bbcode’] && $PREFS->conf[‘bbcode_pms’] ) ) );


With the above code it works like this: admin can use html but can’t use BBcode (I want admin to use both). Members can NOT use html but can use bbcode (this is ok and what I want).

So my problem is getting the correct code so the admin can use both html and BBcode and members can only use BBCode.

It is probably something basic or easy for some, but this is my first attempt at doing something like this so I’m really struggling. Any help would be appreciated.

Thanks for any help in advance.