A return wont work because the exit is in the footer.php.  This will only return to the caller of the page, and it's the callers that continue to execute the code if the exit is not called.  I looked at the return option however there are a few levels of includes, the return just goes back to the caller, an exception will return control to whoever catches it.

Thanks for the help, I found a solution.  Since I'm on php5 I just replace all the exit calls in punbb with a thrown exception.  Then the exception will be caught in my application, allowing the rest of my code to be executed.  It will appear the same to punbb because the stack of the application will be aborted, but not the stack of my application.  In general however, it is really bad form to call exits in any application when the code could silently die.

I thought about this however it's not really an option.  My application already does the templating and the punbb forum is a part of the template.  Also, not every page called has a punbb aspect to it.  I need to maintain a clean seperation between the two apps as well.  I guess I'm just a bit bothered by the poor design of calling an exit numerous times in the application when it would have easily been designed to exit silently and these type of problems could be avoided.

If anyone has any ideas I would very much like to hear them.

I'm currently in the process of integrating punbb with a project I've been working on for a while.  The integration has gone fairly smooth until now.  I'm having a problem with line 161 of footer.php where "exit ($tpl_main);" is called.  Initially I thought I could simply change this to "echo ($tpl_main);" however this is not working.  For most cases this works however there are a few where additional code is called.  You can see an example of this if you change this line of code to echo, then click the "forgot password" link.  You will not see a login box under the "Request Password" box.  There are a number of other cases where additional code is executed however this is the easiest to see.

This would not be an issue however I need to include some of my own content below the punbb pages and the exit does not allow that.  Any help would be appreciated.