Orstio:
One of the great things about SMF is the fact that it has integration hooks throughout the code at key points so that you can add integration functions in at those key points without actually modifying any SMF code at all.

Please note that the documentation about integration hooks for SMF 2.x can be found on the wiki at the page Integration hooks.

Added by emanuele: the information in this topic are still valid for SMF 1.1, that's why the topic is still sticky.

This topic will be a guide to the usages of these hooks. I hope it serves useful.

Starting up the integration systemThe hooksintegrate_pre_includeintegrate_pre_loadintegrate_verify_userintegrate_validate_loginintegrate_loginintegrate_logoutintegrate_activateintegrate_fix_urlintegrate_verify_passwordintegrate_reset_passintegrate_delete_memberintegrate_registerintegrate_outgoing_emailintegrate_personal_messageintegrate_change_member_dataintegrate_redirectintegrate_exitintegrate_whos_online

New in SMF 2.0:integrate_create_topicintegrate_load_themeintegrate_ouput_error

Orstio:

There are numerous methods to start up the integration hook system.

Typically, when creating a bridge, I have SMF "wrapped" within the context of a CMS, so the startup is done in the CMS, as a part of the component/module that displays the forum.

The names of the hooks are defined in SMF code, and the function name can be whatever you want. In fact, it could even be a native function of the system in which you are integrating. This is very open-ended.

Alternatively, the 'hook name' => 'function name' can be entered into SMF's settings table with an installation query, as 'variable' => 'value', and the result will be the same. In this case, you wouldn't need to define the SMF_INTEGRATION_SETTINGS constant; the values would be pulled from the settings table along with all of SMF's other settings.

Orstio:
Now that we've defined the functions that will be called whenever a hook event takes place, we need to know what these hooks are, and when they take place, and the expected input and output for each one.

This is the very first integration hook encountered in the workflow. It is started immediately after the loading of the SMF settings. So, if you need to include some scripting at the beginning of SMF, this can be done with this hook in a separate file, without any need for modifying the SMF code.

Example of use: Information is needed from a separate system that needs to be started after SMF is loaded.