Log in

View Full Version : Problem executing a function, template arrays


crayz92
06-23-2007, 09:14 PM
function loggedin() {
echo 'blah';
}

$home['loggedin'] = 'loggedin';

$home['loggedin'](); //this will output 'blah' You know how inside templates you just have to type $home[loggedin] and it will output the contents of that array.

Well, what I need is to place my function inside that array, and call that array inside a vbulletin template using $home[loggedin] so that it executes the function ONLY when I call that array inside the template, not automatically due to my incorrect syntax.

Also directly calling the function may work, if it is possible in vbulletin templates, but I prefer the other algorithm.

Thanks.

Dismounted
06-24-2007, 05:32 AM
$home['loggedin']();
What makes you think this will work?

You will need to make a plugin containing that function and call it in the plugin by,
$home['loggedin'] = loggedin();