Prev |  | Next

### 3.3.4. common_post_user

This hook gives modules a chance to override Phorum variables and settings, after the active user has been loaded. The settings for the active forum are also loaded before this hook is called, therefore this hook can be used for overriding general settings, forum settings and user settings.

Call time:

Right after loading the data for the active user in `common.php`, but before deciding on the language and template to use.

Hook input:

No input.

Hook output:

No output.

Example code:

    function phorum_mod_foo_common_post_user()
    {
        global $PHORUM;

        // Switch the read mode for admin users to threaded.
        if ($PHORUM['user']['user_id'] && $PHORUM['user']['admin']) {
            $PHORUM['threaded_read'] = PHORUM_THREADED_ON;
        }

        // Disable "float_to_top" for anonymous users.
        if (!$PHORUM['user']['user_id']) {
            $PHORUM['float_to_top'] = 0;
        }
    }

Prev | Up | Next
| Home |