Extending fabEE

fabEE is designed to allow you to extend it to suit your own requirements. fabEE does the basics, it handles login, logout, account linking and comment posting, the minimum requirement for integration into an ExpressionEngine site. However, you may wish to develop functionality just for your users. Find out how to do that in this section.

PHP in Templates/Plugins/Modules

If you wish to access fabEE user data using PHP in a template you can use the global fabEE object and make your own Facebook API calls. The global fabEE object is accessed like this:

global $FABEE;

You can potentially use any of the Facebook API calls listed in the Facebook Developer Wiki bearing in mind that you may have to manage user permissions. For example:

$FABEE->api_client->users_getInfo();

You should always ‘try’ these calls and catch any exception since they are nearly all external to the Facebook servers and could potentially fail for a variety of reasons: try {
$FABEE->api_client->users_getInfo();
}
catch(Exception $e) {
// Do something else
}

Example Plugin

The download package contains a plugin folder with an example that shows you how to use the fabEE global. pi.pur_fabee_connected_friends.php will list the Facebook friends of the currently connected user who are also members of your site. It can output just a total of connected friends or show their profile pictures and names.

Extension Hooks

pur_fabee_post_authorise ($FABEE->user)

Intercept or rewrite the post authorise method. This is a silent HTTP POST from any of the Facebook network IP addresses that is called whenever a Facebook user authorises your site.
Note: this does not necessarily mean that the user is currently logging into your site, the user could have authorised it as an application on the Facebook canvas. The default process in this method is to:

Hook Parameters
Appearance of hook in code
$edata = $EXT->universal_call_extension('pur_fabee_post_authorise', $FABEE->user);
if ($EXT->end_script === TRUE) return;

pur_fabee_post_remove

Intercept or rewrite the post remove method. This is a silent HTTP POST from any of the Facebook network IP addresses that is called whenever a Facebook user deauthorises your site. This would typically occur when a Facebook user removes an application in their privacy settings. The default process in this method is to:

Hook Parameters
Appearance of the hook in code
$edata = $EXT->universal_call_extension('pur_fabee_post_remove', $FABEE->user);
if ($EXT->end_script === TRUE) return;

Top of Page