This hook can be used for performing extra actions after a message has been approved.
Call time:
In moderation.php, right approving a message
and possibly its replies.
Hook input:
An array containing two elements:
PHORUM_APPROVE_MESSAGE or
PHORUM_APPROVE_MESSAGE_TREE)
Hook output:
Same as input.
Example code:
function phorum_mod_foo_after_approve($data)
{
global $PHORUM;
// alert the message author that their message has been
// approved
$pm_message = preg_replace(
"%message_subject%",
$data[0]["subject"],
$PHORUM["DATA"]["LANG"]["mod_foo"]["MessageApprovedBody"]
);
phorum_db_pm_send(
$PHORUM["DATA"]["LANG"]["mod_foo"]["MessageApprovedSubject"],
$pm_message,
$data[0]["user_id"]
);
return $data;
}