PDA

View Full Version : Including a file in a template...


nando99
06 Sep 2008, 05:14
I've read how to do it and I'm pretty sure I did it right.... I mean, I know its doing something because it gives me an errror..lol

Hook Location:
global_start

Execution Order:
5

Plugin PHP Code:
ob_start();
include('home/fatboy99/public_html/templatefiles/arcadeheader.php');
$arcadeheader = ob_get_contents();
ob_end_clean();


I get this error:
Warning: include(home/fatboy99/public_html/templatefiles/arcadeheader.php) [function.include]: failed to open stream: No such file or directory in [path]/global.php(404) : eval()'d code on line 105

Warning: include(home/fatboy99/public_html/templatefiles/arcadeheader.php) [function.include]: failed to open stream: No such file or directory in [path]/global.php(404) : eval()'d code on line 105

Warning: include() [function.include]: Failed opening 'home/fatboy99/public_html/templatefiles/arcadeheader.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/global.php(404) : eval()'d code on line 105

The file exists: http://www.fatboymagazine.com/templatefiles/arcadeheader.php

I added $arcadeheader to the header template.

Not sure what I've done wrong - its prolly something simple I missed or not... Not sure... Any help is appreciated - thanks in advance....

SEOvB
06 Sep 2008, 05:46
the error being generated says you've got a path wrong. try

include('/home/fatboy99/public_html/templatefiles/arcadeheader.php');

Note the first slash before home

Opserty
06 Sep 2008, 09:01
Isn't you're forum already in the "/home/fatboy99/public_html/" directory?

So something like:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Would probably work better...

nando99
06 Sep 2008, 19:39
Isn't you're forum already in the "/home/fatboy99/public_html/" directory?

So something like:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


Would probably work better...


wow - duh! that worked... thanks!