Sort of, but not exactly.
In your global.php file, you need to add a line like this:
PHP Code:
$something = eval("include(\"somefile.php\");");
The eval() function evaluates a line of code "on-demand" rather than every time the script runs. In other words, if you did it your way (without eval) then it would just display the contents of the included PHP file at the top of every page -- I don't believe include() returns a value.
Anyway, then in your templates, wherever you add $something, you will get the contents of the PHP file.
This is essentially the third option that Logician gave:
Quote:
3- Add you code to global.php. It also runs everytime any vb scripts runs, just like phpinclude template.Therefore you can try to add either the include statement or the entire code to global.php as well..
|
And yes, it works; I just tested it on one of my sites. Have fun.