PDA

View Full Version : PHP in vB 3.8.6 Templates


grayloon
07-28-2010, 05:44 PM
I need to use a bit of PHP code in my vBulletin 3.8.6 header template. I tried following the instructions in the docs (http://www.vbulletin.com/docs/html/templates_externalfiles), but it's not working.

I created an external PHP file at the root of my forums called realtree-nav.php.

I created a plugin with the following contents:
ob_start();
include('realtree-nav.php');
$includedphp = ob_get_contents();
ob_end_clean();



In AdminCP > Styles & Templates > Default > header, I added the following:
{vb:raw includedphp}


In my forums, {vb:raw includedphp} shows up without being parsed. What have I done wrong?

kh99
07-28-2010, 06:40 PM
I think you've used the version 4 template syntax (you need to choose the manual version from the drop-down menu to get the manual for older versions). For 3.8.6 just put $includedphp in the template where you want it to appear.

grayloon
07-28-2010, 06:54 PM
That worked. Thanks!