Am using WHMCS, and trying to create a separate file for my header menu. The header menu is a multidimensional array, and I wanted it to be kept separate for my own sanity sake.
I created a .php page with the MySQL code as such:
<?php ...
# To assign variables to the template system use the following syntax.
# These can then be referenced using {$variablename} in the template.
$smartyvalues["variablename"] = $value;
$list = array();
$result = full_query("SELECT id,title,slug,parent FROM `pages` WHERE title!='404' AND slug!='404'");
...
$smartyvalues["header"] = $list;
# Define the template filename to be used without the .tpl extension
$templatefile = "headermenu";
outputClientArea($templatefile);
?>
The headermenu.tpl shows the menu as it should, but when I try to include the file elsewhere, the menu is blank. I add some static content, and that shows. I tried using both {include} and {include_php} to no avail. Any idea how I can show my MySQL result without directly putting it into the file I need it in?
I could not figure out a way to include the file through .tpl, so I created a .php and included it with {include_php}. The .php had my MySQL code, and after including the file, I was able to show the MySQL result as needed.