Prev |  | Next

### 3.14.7. after_post

This hook can be used for performing actions based on what the message contained. It is specifically useful for fully overriding the redirect behavior. When you only need to provide a different URL, then make use of the after_post_redirect hook.

Call time:

In `include/posting/action_post.php`, after all the posting work is done and before executing the built-in redirect behavior.

Hook input:

An array containing message data.

Hook output:

Same as input.

Example code:

    function phorum_mod_foo_after_post($message)
    {
        global $PHORUM;

        // remove the post count increment for the user in select forums
        if (in_array($message["forum_id"], $PHORUM["mod_foo"]["forums_to_ignore"])) {
            phorum_api_user_save (
                array (
                    "user_id"    => $PHORUM["user"]["user_id"],
                    "posts"      => $PHORUM["user"]["posts"]
                    )
                );
        }

        return $message;
    }

Prev | Up | Next
| Home |