PDA

View Full Version : External Files, need some help.


Otikeu
08-31-2007, 04:39 AM
Hello,

I've used the guide (http://www.vbulletin.com/docs/html/main/templates_externalfiles) for including external php files and it does work. There is only one issue that doesn't seem to work...

I've got $sitemenu to include a .html file. $sitemenu is defined within the php file that I added into a plugin (using that guide). Normally, I just used php code on my website, but of course it is different with vB. Since I can't do include php codes in the templates, I've tried something like:

$sitemenu = include('/path/to/file.html');

However, it just gives a "1" where the variable is and outputs the raw data of the .html file to the top.

The plugin is hooked to global_start and the variable is being used the header. Is there a better way to have this work?

Dismounted
08-31-2007, 11:23 AM
Have you followed that page exactly and used the PHP code provided (and change the path of course)?

Opserty
08-31-2007, 01:02 PM
Just a guess but...

The link you gave give this code:
$includedhtml = implode('', file('path/to/this/file/myfile.html'));
For HTML files, you are using include

Otikeu
08-31-2007, 09:31 PM
I have php working, I'm talking about the included html file in the in the php file I have connected to vBulletin using that guide.

As in, I have connected a external php file. however, the php file has a varialbe as seen above of which I want to be echoed onto vB.

Thanks.

Opserty
08-31-2007, 10:17 PM
In which case you need to return the variable:

i.e. put return($sitemenu); after your include statment in the PHP file.

Source: http://www.php.net/include/#id2543347

Try that see if it works.