Log in

View Full Version : How do I include a php file in VB templates?


evilc
04-03-2007, 01:28 PM
I have tried the instructions given here (http://www.vbulletin.com/forum/showthread.php?t=173937)

So I created a plugin with global_start and added this

ob_start();
include('/random/RanCon.php');
$includedphp = ob_get_contents();
ob_end_clean();

And in the postbit legacy template I added

$includedphp


BUT , All i get is blank space where the output of the php file should be.

I think its the wrong path that I am using in the include statement.. can anyone tell me what the correct path should be?

Forum is at www.domain.com/forum
PHP file is at www.domain.com/forum/random/RanCon.php

Server path is /domain.com/public_html/forum/random

Help!

WetWired
04-03-2007, 03:18 PM
Try without the leading /

evilc
04-03-2007, 09:19 PM
Hey wetwired.. got the path.. it worked WITH the leading / - just had to add a public_html in between.

Anyways the $includephp variable seems only to be working in certain templates and NOT working in others.

Example - works in navbar, but does not in postbit_legacy!!

Discussion continued here - http://www.vbulletin.com/forum/showthread.php?t=222313

WetWired
04-03-2007, 09:33 PM
In postbit_legacy, you'll need to use $GLOBALS[includephp] .
This is because postbit_legacy is processed inside of a function, so only specific globals are available there.