PDA

View Full Version : Using include


dilbert
04-13-2006, 01:42 PM
Hi,

I created a plug-in called "Left Column Top", it's Hook Location is global_start.

The code is $includedhtml = implode('', file('D:\inetpub\bloodbanktalk\calls\test.htm'));

Then on my template "left_column" I added this $includedhtml, but it does not show the contents of the page I want included.

Did I go wrong somewhere?

The Chief
04-13-2006, 06:03 PM
I would like to know how to include pages as well..

sabret00the
04-14-2006, 03:53 PM
the file was not an array so why are you imploding it?

check out www.php.net/file_get_contents

dilbert
04-14-2006, 03:58 PM
the file was not an array so why are you imploding it?

check out www.php.net/file_get_contents (http://www.php.net/file_get_contents)
Why, because I am clueless in php, the post only attests to that. :surprised:
Plus it's the advice I received http://www.vbulletin.com/forum/showthread.php?t=181892.

How would I include another file in a php template? I am using the left column hack and have 8 styles, so I'd like to simply put an include in all of the templates and only need to update a file, not 8 templates.

sabret00the
04-14-2006, 04:02 PM
$includedhtml = file_get_contents('filelocation/filename.fileextention');

dilbert
04-14-2006, 04:13 PM
Hmm, not working.

I tried these separately in the plug in:
$includedhtml = file_get_contents('http://www.bloodbanktalk.com/calls/test.php');
$includedhtml = file_get_contents('D:/inetpub/bloodbanktalk/calls/test.php');
$includedhtml = file_get_contents('calls/test.php');

Then in the template I place $includedhtml where I want the output. It doesn't give an error, but it doesn't show what I have in the test file either.

sabret00the
04-15-2006, 10:24 AM
what happens when you do
$includedhtml = file_get_contents('filelocation/filename.fileextention');
echo $includedhtml . "_<br />";
print_r($includedhtml);

dilbert
04-15-2006, 08:57 PM
That didn't do it either, thanks for trying, but I give up at this point.