Hi all,
I've got a simple bulletin board type of code in part of my application, and I want to implement phpbb-like tags for users to add to posts. I strip HTML out of the posts, of course. I can handle things like [b] => <b> with a simple gsub, but there's one that is throwing me for a loop. I want users to be able to quote other users, and have the quoted text show up with an "originally posted by username" and some CSS code. I can gsub the [/QUOTE] into a </div> but how do I change [QUOTE=username] into:
<div class="quote"><p><em>Originally posted by username</em></p>
Yes, I can do most of it with a gsub, but how do I pull "username" out of the original text and put it where it belongs in the substituted text?
Or is there a better way to do this all together?
Thanks!