StephenKay
06-23-2008, 01:11 AM
I have studied the tutorial section on how to included php files.
I want to include my header template as a file on my server, instead of pasting it into the area in the style manager.
So I have created a plug-in attached to the global_start hook:
ob_start();
include('kl_templates/header.php');
$inc_tpl_header = ob_get_contents();
ob_end_clean();
In the style manager, in the header template, is:
$inc_tpl_header
So far, so good. It works somewhat - the header file (on my server as /forum/kl_templates/header.php is indeed included.) The problem is that there are images in the header which are referenced as (example):
<img src="$stylevar[imgdir_misc]/nav_welcome.gif" width="251" height="29" alt="" />
These images cannot be located. It seems that this variable is not available?
Also, there are some php variables in the header template, that are just getting printed out, instead of the actual php code.
Do I need to put an eval() somewhere in the above code? Kind of lost on this... thanks.
--------------- Added 1214187596 at 1214187596 ---------------
Actually, looking at the HTML source shows that the php in the header is not being executed. the URL of the images still show up as $stylevar[...], so obviously I need to be doing something different to get the php in the header.php file to actually execute, but what?
I want to include my header template as a file on my server, instead of pasting it into the area in the style manager.
So I have created a plug-in attached to the global_start hook:
ob_start();
include('kl_templates/header.php');
$inc_tpl_header = ob_get_contents();
ob_end_clean();
In the style manager, in the header template, is:
$inc_tpl_header
So far, so good. It works somewhat - the header file (on my server as /forum/kl_templates/header.php is indeed included.) The problem is that there are images in the header which are referenced as (example):
<img src="$stylevar[imgdir_misc]/nav_welcome.gif" width="251" height="29" alt="" />
These images cannot be located. It seems that this variable is not available?
Also, there are some php variables in the header template, that are just getting printed out, instead of the actual php code.
Do I need to put an eval() somewhere in the above code? Kind of lost on this... thanks.
--------------- Added 1214187596 at 1214187596 ---------------
Actually, looking at the HTML source shows that the php in the header is not being executed. the URL of the images still show up as $stylevar[...], so obviously I need to be doing something different to get the php in the header.php file to actually execute, but what?