Topic: message() function breaks header when using includes in template
I think I've pin-pointed this scenario where I have problems - hopefully I can explain it.
If I use user templates in my main.tpl such as this:
<pun_include "mybody.php">
and mybody.php has includes like this:
<?php include SITE_ROOT."includes/mainbody.php"; ?>
Then whenever the message function in functions.php is run it does not correctly load the header correctly:
i.e. this line
if (!defined('PUN_HEADER'))
{
global $pun_user;
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Info'];
require PUN_ROOT.'header.php';
// THE LINE ABOVE IS NOT LOADING THE HEADER CORRECTLY IN HEADER.PHP WHEN I HAVE THE TEMPLATE STRUCTURE ABOVE. WHEN I MAKE THE USER INCLUDES NOT HAVE INCLUDES IN THEMSELVES IT WORKS FINE
}
Let me also add that this error only occurs when the message function is sent without a TRUE parameter (when it does not trigger a redirect). An example of the user behavior is to change your password and enter a mismatched password which triggers the message function without the redirect.