35mm
08-01-2011, 01:02 PM
Just wondering if there is a definitive guide for including php files and code in vb4.x or if someone can explain. Right now I am trying to include a php header file. I have followed the instructions here https://www.vbulletin.com/docs/html/main/templates_externalfiles but can't get it working.
Here's what I have tried in plugins under the global_start hook;
ob_start();
$includedphp = ob_get_contents('/home/site/public_html/inc/header-inc.php');
vB_Template::preRegister('header',array('includedp hp' => $includedphp));
ob_end_clean();
and I have put {vb:raw includedphp} in the header template.
I have also tried {vb:raw global.includedphp}
This doesn't work. The site's header include consists of plain html with inline php echos. I have tried changing it to a single php echo but still no good.
Any advice would be greatly appreciated!
Here's what I have tried in plugins under the global_start hook;
ob_start();
$includedphp = ob_get_contents('/home/site/public_html/inc/header-inc.php');
vB_Template::preRegister('header',array('includedp hp' => $includedphp));
ob_end_clean();
and I have put {vb:raw includedphp} in the header template.
I have also tried {vb:raw global.includedphp}
This doesn't work. The site's header include consists of plain html with inline php echos. I have tried changing it to a single php echo but still no good.
Any advice would be greatly appreciated!