Prev |  | Next

### 3.15.9. after_approve

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:

- The message data
- The type of approval (either `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;

    }

Prev | Up | Next
| Home |