Edit: This is an IPB (Invision Power Board) forum, not PHPBB as originally posted. My humble apologies.
I'm trying to write a widget that displays a sampling of popular topics in our forum. However, parsing bbcode tags is a bit of a pain. We're using the PEAR BBCodeParser, so handling bbcode tags isn't a problem. But the real issue is that IPB seems to partially encode messages from bbcode to html before storing them in the database. I say partially because certain bbcode tags are converted, others are not.
For example, consider this raw bbcode:
OMG I am [b]so[/b] embarrassed :sweat:
Gets encoded into the database (spefically, the bbprefix_posts table) as
OMG I am [b]so[/b] embarassed <img src="http://mysite.com/frown.gif" class="bbc_emoticon">
So my question is, is there any place in our ipb database where this string is totally unencoded? I figure it must be somewhere, because when you reply to a topic, it populates your textarea box with raw bbcode, including smilies, without any conversion to html.