276

Re: PunBB 1.2 development source

Hmm, interesting. I'll investigate. It must have something to do with the message() function.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

277

Re: PunBB 1.2 development source

Found the root of the problem. It was indeed related to the message() function. The problem is that footer.php and thus any files included via pun_include are included in the function message(). Any variables that are then declared are not put in the global scope but in the scope of the function message(). You can solve the problem by putting your objects explicitly in the global scope. E.g:

global $class1, $class2;

$class1 = new Class1();
$class2 = new Class2();

echo $class2->foobar();

or

$GLOBALS['class1'] = new Class1();
$GLOBALS['class2'] = new Class2();

echo $GLOBALS['class2']->foobar();

It's not very pretty, but for now, that'll have to do. I really don't know how to circumvent this problem.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

278

Re: PunBB 1.2 development source

Thanks, that solution is certainly sufficient