Prev |  | Next

### 3.10.2. common_pre

This hook can be used for overriding settings that were loaded and setup at the start of the `common.php` script. If you want to dynamically assign and tweak certain settings, then this is the designated hook to use for that.
Because the hook was put after the request parsing phase, you can make use of the request data that is stored in the global variables `$PHORUM['forum_id']` and `$PHORUM['args']`.

Call time:

Right after loading the settings from the database and parsing the request, but before making descisions on user, language and template.

Hook input:

No input.

Hook output:

No output.

Example code:

    function phorum_mod_foo_common_pre()
    {
        global $PHORUM;

        // If we are in the forum with id = 10, we set the administrator
        // email information to a different value than the one configured
        // in the general settings.
        if ($PHORUM["forum_id"] == 10)
        {
            $PHORUM["system_email_from_name"] = "John Doe";
            $PHORUM["system_email_from_address"] = "John.Doe@example.com";
        }
    }

Prev | Up | Next
| Home |