Browser based, mostly text using PHP.

So far I've got the forum running in an IFRAME which I'm not wild about. I'm not too keen on going through every script and changing the db variable though.

www.roguespy.net

I run an online PBBG (Persistent Browser Game) that operates on an entirely custom engine I designed. I am wondering if it is at all possible embed PunBB within the framework of the game. Players like it when forums are right in game, instead of on a seperate page with a seperate login mechanism. I have researched other threads here and I see how easy it is to change the template file of Pun to customize the header and footer, but what I'm looking for is to actually embed Pun into the actual game.

The biggest problem I've run across is the Pun uses the variable $db as it's database connection and so do all scripts within my game.

Any thoughts? Suggestions?