Prev |  | Next

### 3.6.6. page_<phorum_page>

(Phorum 5 >= 5.2.7)

This hook gives modules a chance to run hook code for a specific Phorum page near the end of the the `common.php` script.
It gives modules a chance to override Phorum variables and settings near the end of the `common.php` script. This can be used to override the Phorum (settings) variables that are setup during this script.
The `phorum_page` definition that is set for each script is used to construct the name of the hook that will be called. For example the `index.php` script uses phorum_page `index`, which means that the called hook will be `page_index`.

Call time:

At the end of `common.php`, right after the common hook is called.
You can look at this as if the hook is called at the start of the called script, since including `common.php` is about the first thing that a Phorum script does.

Hook input:

No input.

Hook output:

No output.

Example code:

    function phorum_mod_foo_page_list()
    {
        global $PHORUM;

        // Set the type of list page to use, based on a cookie.
        if (empty($_COOKIE['list_style'])) {
            $PHORUM['threaded_list'] = PHORUM_THREADED_DEFAULT;
        } elseif ($_COOKIE['list_style'] == 'threaded') {
            $PHORUM['threaded_list'] = PHORUM_THREADED_ON;
        } elseif ($_COOKIE['list_style'] == 'flat') {
            $PHORUM['threaded_list'] = PHORUM_THREADED_OFF;
        } elseif ($_COOKIE['list_style'] == 'hybrid') {
            $PHORUM['threaded_list'] = PHORUM_THREADED_HYBRID;
        }
    }

Prev | Up | Next
| Home |