Dasfaust
Member
Hi, so basically I want to include a PHP file in an external page, I have a class and listener for a template hook, in this case the template "market".
Here's the class:
The contents of "market/index.php" is printed at the top of the page, not inside the breadcrumb. Seems it isn't that simple so I'm stumped on what to do.
I have tried a varation of this code that I got from searching around on here (which I have done a ton of), and it works, but using this breaks overlays completely (they don't load, for example, trying to change the theme does nothing) I can't really go on without overlays because I'm trying to use them in the script that's being included:
Here's the class:
PHP:
<?php
class Market_Loader
{
public static function templateHook($hookName, &$content, array $hookParams, XenForo_Template_Abstract $template)
{
if($hookName == 'market')
{
$content = include("market/index.php");
}
}
I have tried a varation of this code that I got from searching around on here (which I have done a ton of), and it works, but using this breaks overlays completely (they don't load, for example, trying to change the theme does nothing) I can't really go on without overlays because I'm trying to use them in the script that's being included:
PHP:
ob_start();
require("market/index.php");
$myContent = ob_get_contents();
ob_end_clean();
$content = $myContent;