Muffin89
03-28-2011, 10:26 AM
Hi everyone. I have some trouble including a php file in my template, will describe the problem below:
I have a template with an header, a navbar, the forum/content, footer and a fixed right bar. I want to insert this php code(for now) into the right bar:
userbox.php
<?php
echo '<a href="login.php?$session[sessionurl]do=logout&logouthash=$bbuserinfo[logouthash]">Logga ut</a>';
?>
userbox plugin:
ob_start();
include('userbox.php');
$userboxinsert= ob_get_contents();
ob_end_clean();
vB_Template::preRegister('footer',array('php_inclu de' => $php_include));
Inside the footer template I have made a div that is fixed and I call the plugin with this code:
{vb:raw userboxinsert}
But it doesn't output my desired string.
The HOOK is parse_templates.
When i in the plugin write echo $userboxinsert; the userbox get's inserted but at the top of the screen, so the link works.
Would be very happy if someone could help me with this problem!
--------------- Added 1301321363 at 1301321363 ---------------
I can add that when I turn debug on, the file is included but it doesn't write out any text!
I have a template with an header, a navbar, the forum/content, footer and a fixed right bar. I want to insert this php code(for now) into the right bar:
userbox.php
<?php
echo '<a href="login.php?$session[sessionurl]do=logout&logouthash=$bbuserinfo[logouthash]">Logga ut</a>';
?>
userbox plugin:
ob_start();
include('userbox.php');
$userboxinsert= ob_get_contents();
ob_end_clean();
vB_Template::preRegister('footer',array('php_inclu de' => $php_include));
Inside the footer template I have made a div that is fixed and I call the plugin with this code:
{vb:raw userboxinsert}
But it doesn't output my desired string.
The HOOK is parse_templates.
When i in the plugin write echo $userboxinsert; the userbox get's inserted but at the top of the screen, so the link works.
Would be very happy if someone could help me with this problem!
--------------- Added 1301321363 at 1301321363 ---------------
I can add that when I turn debug on, the file is included but it doesn't write out any text!