MyBB Community Forums

Full Version: add a string of text to a variable in a template?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I've successfully added a variable under "postbit_classic" template with a plugin that I'm creating.

My problem is, I'm failing to make the variable print out data in the postbit area... So could you tell me what I'm doing wrong?

I am using this hook:
$plugins->add_hook("postbit", "additionalGroupsPostbit_work");

and here is the function:
function additionalGroupsPostbit_work() {

	global $db, $mybb, $cache, $addit_groups;

	$addit_groups = "so is this gonna work";

}

what am I doing wrong? If i "return $addit_groups;" I get a bunch of errors which relate to eval();

I tried using eval method, but it just prints the postbit area twice.. ;/

Thank you.
ERr, anyone?
I remember I answered one of your topics, I think it's even about the same plugin and you showed a screen that it worked: http://community.mybb.com/thread-147856-...pid1047691 The solution is still the same...
(2014-05-17, 03:53 PM)Destroy666 Wrote: [ -> ]I remember I answered one of your topics, I think it's even about the same plugin and you showed a screen that it worked: http://community.mybb.com/thread-147856-...pid1047691 The solution is still the same...

Hey there, yeah I know that way works, but I'm sure I can get this to work this way? right?
anyone...?
You need to pass $post to the function.

function additionalGroupsPostbit_work(&$post)