smf.php File Reference


Detailed Description

Provide an Embient interface for Simple Machines Forum.

Version:
1.0
Author:
BoogieBug
This file contains a lot of SMF specific functions and information. Please check SMF documentation for more details.

SMF Integration Installation

To enable Embient on SMF, add the following lines into the end of SMF's Settings.php

 $integration = array
 (
   'integrate_pre_include'         => '<path_to_embient>/smf.php',
   'integrate_pre_load'            => 'embient_smf_load',
   'integrate_buffer'              => 'embient_smf_filter',
   'integrate_register'            => 'embient_smf_register',
   'integrate_login'               => 'embient_smf_login',
   'integrate_logout'              => 'embient_smf_logout',
   'integrate_change_member_data'  => 'embient_smf_userdata',
   'integrate_delete_member'       => 'embient_smf_delete',
   'integrate_reset_pass'          => 'embient_smf_pass',
 );

 define('SMF_INTEGRATION_SETTINGS', serialize($integration));

Replace the <path_to_embient> with an absolute path to the directory you install the Embient in.

Definition in file smf.php.

Go to the source code of this file.

Functions

 embient_smf_load ()
 callback by SMF when embient_smf is being loaded
 embient_smf_register ($regvars, $themevars)
 new user is registering
 embient_smf_login ($username, $hash_password, $cookie_length)
 new user is logging in
 embient_smf_logout ($username)
 user is logging out
 embient_smf_userdata ($usernames, $field, $value)
 user is changing information
 embient_smf_delete ($smf_userid)
 user is being deleted
 embient_smf_pass ($username, $newusername, $newpassword)
 user is reseting password
 embient_smf_filter ($content)
 SMF output filter.
 _embient_log_error ($msg, $file, $line)
 Helper function to log error message to SMF.

Variables

 $Embient = NULL


Function Documentation

_embient_log_error msg,
file,
line
 

Helper function to log error message to SMF.

For internal use only.

Parameters:
$msg string - message to be added
$file string - file name of the module generating error
$line integer - line number that generating error

Definition at line 323 of file smf.php.

embient_smf_delete smf_userid  ) 
 

user is being deleted

Parameters:
$smf_userid int - smf id of user to be deleted

Definition at line 235 of file smf.php.

Here is the call graph for this function:

embient_smf_filter content  ) 
 

SMF output filter.

We use this to append the debug message at the end of page. However, this function does not always work, since the page can be redirected, and the debug message will be lost.

Parameters:
$content string - output content

Definition at line 286 of file smf.php.

embient_smf_load  ) 
 

callback by SMF when embient_smf is being loaded

Definition at line 49 of file smf.php.

Here is the call graph for this function:

embient_smf_login username,
hash_password,
cookie_length
 

new user is logging in

Parameters:
$username string - user name
$hash_password string - hash code of the password or null
$cookie_length int - length of cookie age

Definition at line 154 of file smf.php.

embient_smf_logout username  ) 
 

user is logging out

Parameters:
$username string - user name

Definition at line 167 of file smf.php.

embient_smf_pass username,
newusername,
newpassword
 

user is reseting password

Parameters:
$username string - current user's name
$newusername string - new username, can be the same with current one.
$newpassword string - new password

Definition at line 264 of file smf.php.

embient_smf_register regvars,
themevars
 

new user is registering

Parameters:
$regvars associative array - user information (see comments in code)
$themevars associative array - display information for user

Design Note

Example of $regvars from SMF

 $regvars = Array
 (
   [interface] => admin
   [username] => abc
   [email] => def@ghi.com
   [password] => jklmnop
   [password_check] => jklmnop
   [check_reserved_name] => 
   [check_password_strength] => 
   [check_email_ban] => 
   [send_welcome_email] => 
   [require] => nothing
   [memberGroup] => 0
   [register_vars] => Array
   (
     [memberName] => 'abc'
     [emailAddress] => 'def@ghi.com'
     [passwd] => '82316db59f20f0bcadce86ce119bed86319028ca'
     [passwordSalt] => 'c92b'
     [posts] => 0
     [dateRegistered] => 1137564375
     [memberIP] => '127.0.0.1'
     [validation_code] => ''
     [realName] => 'abc'
     [personalText] => ''
     [pm_email_notify] => 1
     [ID_THEME] => 0
     [ID_POST_GROUP] => 4
     [lngfile] => ''
     [buddy_list] => ''
     [pm_ignore_list] => ''
     [messageLabels] => ''
     [websiteTitle] => ''
     [websiteUrl] => ''
     [location] => ''
     [ICQ] => ''
     [AIM] => ''
     [YIM] => ''
     [MSN] => ''
     [timeFormat] => ''
     [signature] => ''
     [avatar] => ''
     [usertitle] => ''
     [secretQuestion] => ''
     [secretAnswer] => ''
     [additionalGroups] => ''
     [smileySet] => ''
     [is_activated] => 1
     [ID_GROUP] => 0
   )
 )

Definition at line 65 of file smf.php.

embient_smf_userdata usernames,
field,
value
 

user is changing information

Parameters:
$usernames array - list of user names to change their information
$field string - field name
$value mixed - value of the field

Definition at line 184 of file smf.php.

Here is the call graph for this function:


Variable Documentation

$Embient = NULL
 

For internal use only.

The Embient object.

Definition at line 44 of file smf.php.


Generated on Fri Feb 10 15:05:55 2006 for Embient by  doxygen 1.4.6-NO