Quote:
Originally Posted by SirAdrian
Put it in the PHP file, instead of using echo/print use variables, then just put the variable in the template. If that is too much work, I think you can use something like this:
PHP Code:
ob_start();
// All your PHP you want in the template here
$above = ob_get_contents(); ob_end_clean();
Then putting $above in your template would show all the PHP.
|
Thank you, I've been searching for this solution to include a separate index.php file for 3 hrs. This worked like a dream.
Just to make it clear what I did I'll show it for someone who is also looking:
Code snipet at end of custom page php file.
PHP Code:
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
ob_start();
require_once('./bf2_status/index.php');
$above = ob_get_contents();
ob_end_clean();
$navbits = array();
$navbits[$parent] = 'BF2 Status';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('STATUS') . '");');
?>
I put in "
require_once('./bf2_status/index.php');" to get the php file. Then in the template where you usually put the html code for the content, I just put
$above