PHP file header

How do I insert or call a PHP file in the header?
What is the best way?
I teach step-by-step.
Help me?
Quote · 27 Jan 2012

The best way is to include a php file is to create an injection.  There is a database table called sys_injections and there are different locations to inject things found in the template files:

  • injection_header
  • injection_head 
  • etc
First thing is to determine where you want the injection to show up:
If you look in templates/base/_sub_header.html you will find some of the injection tags that are populated from the "data" field of the sys_injections entries.

 

Example:
If you wanted something to be added to the "injection_header" tag:
<bx_injection:injection_header/>

 

You would insert a row into the sys_injections table:
INSERT INTO `sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES ('my_injection', '0', 'injection_header', 'php', 'require_once(BX_DIRECTORY_PATH_ROOT.''myfile.php'');', '0', '1');

 

Obviously you would have to change the name field, and the path and filename to your file.

 

Hope this helps...
sup
Quote · 27 Jan 2012
It worked perfectly.
Thank you!
Quote · 31 Jan 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.