Customizing SMF > Portals, Bridges, and Integrations
A guide to the SMF integration hooks
Orstio:
Used in file: Subs-Post.php
Used in function: sendmail
Variables passed to hook function: $subject, $message, $headers
Variables expected from hook function: true/false
Usage: This hook is started just before the output of the email is modified for sending. The message body is still plain text at this point.
Example of use: The forum is wrapped in a CMS, so all of the URLs in outgoing emails need to be rewritten to point to the CMS.
Orstio:
Used in file: Subs-Post.php
Used in function: sendpm
Variables passed to hook function: $recipients, $from['username'], $subject, $message
Variables expected from hook function: None
Usage: This hook is started just before an SMF Personal Message is sent. It passes an array of recipients, the username of the sender, the subject, and the message body.
Example of use: A user sends a PM, and that PM should appear in the integrated system as well as SMF's PM system.
Orstio:
Used in file: Subs.php
Used in function: updateMemberData
Variables passed to hook function: $memberNames (array), $var (string), $data (string)
Variables expected from hook function: None
Usage: This hook is started just before any changes are made to users profiles. It is started when an admin is changing multiple users in the admin panel, and also when a user is changing his own profile.
The $var array is similar to the $regOptions array in the integrate_register hook. It contains all of the key names for the fields to be changed. The $data array will contain the associated values for those keys.
Example of use: A user changes his profile information, and that information needs to be passed to the integrated system.
Orstio:
Used in file: Subs.php
Used in function: redirectexit
Variables passed to hook function: $setLocation, $refresh
Variables expected from hook function: None
Usage: This hook is started just before SMF redirects after a form submission. To avoid resubmission of form data, SMF uses its own redirect system. The $setLocation variable will be the URL to which to redirect, and the $refresh variable is a boolean determining whether a page refresh should be done after loading.
Example of use: Similarly to the integrate_outgoing_email function above, this can be used to rewrite redirection URLs back to a wrapped CMS page.
Orstio:
Used in file: Subs.php
Used in function: obExit
Variables passed to hook function: $do_footer && !WIRELESS (boolean)
Variables expected from hook function: None
Usage: This hook is started just before SMF exits. This hook is extremely important for true bridges, because in certain circumstances, the forum can becomes unwrapped from the integrated context without this hook. It will execute whatever code is in the hook function before exiting PHP.
Example of use: SMF is wrapped in a CMS, and the CMS needs to finish off its execution before exit.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version