• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How do I do this in xenForo?

Brent W

Well-known member
#1
Pretty simple plugin on vBulletin that includes a file and allows me to include that in a template with a variable.

PHP:
ob_start();
include_once('/home/www/file.php');
$filecontent = ob_get_contents();
ob_end_clean();
and where $filecontent was placed the contents of file.php would show in the template. (Need it in Footer template)
 

mmoore5553

Well-known member
#2
you can also put it as a hook. I think this is what you was wanting. It pulls external php file. I think that hook name is located where you want but there are a couple other hooks to use.


if($hookName == 'footer')
{
ob_start();
require_once('folder/your_file.php');
$contents .= ob_get_contents();
ob_end_clean();
}