A guide to the SMF integration hooks

Started by Orstio, May 26, 2007, 03:35:09 PM

Previous topic - Next topic

Orstio

Used in file:  Who.php
Used in function:  determineActions

Variables passed to hook function:  $actions (array)
Variables expected from hook function: $data (text defining current user action)

Usage:  This hook is started during the process of figuring out what each user is doing for the Whos online list.  It expects text back depending on the variables in the query string of the page the user is viewing, which should all be passed in the $actions array.
 
Example of use:  A user is accessing a page in an integrated system, and that page should be reported correctly in the Whos online.

Orstio

Used in file: Subs-Post.php
Used in function: createPost

Variables passed to hook function: $msgOptions (array), $topicOptions (array), $posterOptions (array)
Variables expected from hook function: None

Usage:  This hook is started right after a new topic post is entered into the SMF database.  It passes all relevant posting information out to the integration hook function.

Example of use:  The forum has a "News" board, and all new topics posted in that board are also news articles on the front page of a CMS.

Orstio

Used in File: Load.php
Used in function: loadTheme

Variables passed to hook function: None
Variables expected from hook function: None

Usage:  This hook is started after SMF has defined its template layers, but before the template layers are used.  It gives the integration a chance to alter the template layers before they are used.

Example of use:  The forum is wrapped in a CMS, so the HTML headers need to be omitted to remain W3C compliant.

Orstio

Used in file: Errors.php
Used in function: error_handler

Variables passed to hook function: $message (string), $error_type (string), $error_level (int), $file (string), $line (int)
Variables expected from hook function: None

Usage:  This hook is started after an error message is generated in SMF, but before SMF displays it.

Example of use:  The integration should redirect to a global error page rather than a SMF page.

Advertisement: