MyBB Community Forums

Full Version: Add new hook? post_author_user
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been developing a simple plugin for my forum. I need to load my var from post_author_user template... but this hook in not in MyBB. Ehy not to add this in future?

Or am I missing something, how to solve this in different way? Thank you
How does your function look like?
Hi, I am sorry for late reply. This is my function:

function RepGiven($post)
{
	global $mybb, $db,$Text,$TextColor,$Color,$Cero;
	$Text = $mybb->settings['RepGiven_text'];
	$TextColor = $mybb->settings['RepGiven_text_color'];
	$Color = $mybb->settings['RepGiven_color'];
	$Cero = $mybb->settings['RepGiven_cero'];
	$RepGiven = $db->query("SELECT uid FROM ".TABLE_PREFIX."reputation WHERE adduid='".$post['uid']."'");
    $RepGivenResultado = $db->num_rows($RepGiven);
    if($RepGivenResultado)
    {
        $post['RepCount'] = $RepGivenResultado;
		$post['RepCount'] = "<font color=\"".$TextColor."\">".$Text."</font> <font color=\"".$Color."\"><b>{$post['RepCount']}</font></b>";
    }
    else 
    {
        $post['RepCount'] = "<font color=\"".$Cero."\"><b>0</b></font>";
		$post['RepCount'] = "<font color=\"".$TextColor."\">".$Text."</font> {$post['RepCount']}";
    }
	$post['RepGiven'] = "{$post['RepCount']}";
}

Now it works only in postbit, I need to work this in post_author_user - why? I need to change the order, not show it at the end.

Something like str_replace('<!--REPGIVEN--> should be fine, but it is not working for me. My php knowledge is not big