MyBB Community Forums

Full Version: Variable in Postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all ,

Is is possible to make a plugin(function) that returns a variable to be used in the postbit ?? which Hook should I use ?
all the plugins I saw till now used
$post['someproperty'] = $post['someproperty'] . "<br />" . $thevariable ;

but I want to use it like this :
edit the tamplate adding {$thevariable} to the place where you want it to appear .

Thanks Big Grin
Hook:
$plugins->add_hook('postbit', 'FUNCTION_NAME');

Function:
function FUNCTION_NAME(&$post)
{
// Variable Name as $post['var_name'] 
// Use $post['var_name'] in your postbit template where you want to display ...
$post['var_name'] = "MyBB Roxx";
}
ok , I'll try this . Thank you