MyBB Community Forums

Full Version: PHP help please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a code that when using
echo ();
shows the content of user field but I am struggling show that content in the template?

function testing()
{
      global $mybb, $db, $theme, $hello;
    //something that returns user field content
	
	if($something that returns user field content)
	{
	$hello = "<td>hello</td>";	
	}
		
}

I have {$hello} to in template but it's not showing the anything.

echo();
does show it.

Any ideas?
Does testing() get called before reading the template? What hook do you use?
Thanks buddy:
$plugins->add_hook("online_start", "testing");

echo does work but I need to show it inside div that is inside template "online_row"

Seems that I need a hook to online_row because it works great on online template
You need to add a hook at a place where the Template is Eval'd() after your function.
Thanks buddy do you mean like this?

function testing($online_row)