Here's the scenario:
I made a custom php script that does some processing. I wanted to perform this processing only when a custom page was called. The PHP process is also outputting some HTML and other stuff that has to be displayed on the custom template.
To do this, I created a custom plug that is called on 'global_start'. It looks like this:
Code:
ob_start();
include('MYCUSTOMCODE.php');
$includedphp = ob_get_contents();
ob_end_clean();
In the custom template I have this:
Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle] - $vbphrase[image_veri]</title>
</head>
<body>
$header
$navbar
$includedphp
$footer
It works great except for one major problem. MYCUSTOMCODE.php fires on every page load and click, even though it's not diplaying anything. This is causing a major performance problem on my site.
How do I make this custom PHP only fire when the custom template is being called?