Re: PunBB 1.2 development source
Hmm, interesting. I'll investigate. It must have something to do with the message() function.
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 discussion → PunBB 1.2 development source
Hmm, interesting. I'll investigate. It must have something to do with the message() function.
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.
Thanks, that solution is certainly sufficient
PunBB Forums → PunBB 1.2 discussion → PunBB 1.2 development source
Powered by PunBB, supported by Informer Technologies, Inc.