PDA

View Full Version : RC2 Accessing $output


MyChemicalSelf
15 Dec 2009, 15:33
Hey guys, in Beta 5 and lower i could call $output from global_complete and edit data etc, but for soem reason (After upgrading to rc2) this is no longer possible. Can anyone shed some light on this?

Lynne
15 Dec 2009, 16:04
Perhaps post your code. I am using global_complete to add addition css to my pages though the use of str_replace to the $output and it is working just fine for me in RC2.

MyChemicalSelf
15 Dec 2009, 16:09
Thanks Lynne i have this is in global_complete, oddly this was working in beta 5 and has stopped since the upgrade.
$gperm = convert_bits_to_array($vbulletin->userinfo['permissions']['gcbos_permissions'], $vbulletin->bf_ugp_gcbos_permissions);

if ($gperm['can_view'])
{
global $output;
$gcbos_head = '<script src="clientscript/gcbos.js"></script></head>';

if (!preg_match('/forumbits.css/', $output)) //Is forumbits.css being required allready
$gcbos_head = '<link rel="stylesheet" type="text/css" href="forumbits.css" />' . $gcbos_head;

$output = str_replace('</head>', $gcbos_head, $output);
$output = str_replace('<!-- {SHOUTBOX} -->', vB_Template::create('GCBOS')->render(), $output);
}

Lynne
15 Dec 2009, 16:51
You've got a couple str_replace going on in there... have you tried to narrow it down to which one is the problem? I would start by only having the last one 'on' and seeing if that works and then going backwards to see where the problem is. But, I can tell you that str_replace IS working for $output at that hook location for me.

MyChemicalSelf
15 Dec 2009, 16:55
You've got a couple str_replace going on in there... have you tried to narrow it down to which one is the problem? I would start by only having the last one 'on' and seeing if that works and then going backwards to see where the problem is. But, I can tell you that str_replace IS working for $output at that hook location for me.

How odd, and im sure its not the replaces' due the fact i cant even exit($output) and i cant seem to see it in get_defined_vars() anyway thanks for your help going to try a fresh install and hope that fixes it :)