Setting Up Your Templates
You need only make a few minor changes to your templates to get fabEE working on your site. fabEE provides a simple set of tags and conditionals for you to use. The tags are in this format:
{fabee:tag_name}
fabEE conditionals are used exactly like ExpressionEngine ones are in this format:
{fabee_conditional}
You will need to add the primary fabEE tag on each template. Place the following tag right before the closing body tag. This tag does include jQuery 1.3 from Google APIs.
{fabee:javascripts}
</body>
If you are including jQuery elsewhere in your template then you can use the tag:
{fabee:javascripts_no_jquery}
</body>
Note: Right now, there is no easy way to integrate the fabEE tags into either the member profile templates or the forum. fabEE users will still be logged in properly when visiting those templates but their sessions will expire after 2 hours unless they visit a standard template
fabEE Tags
- linked_profile_pic
- login_button
- login_button_short
- logout_button
- publish_comment
- request_permission
- uid
fabee:linked_profile_pic
Generate a Facebook user profile image that is linked to the logged in user Facebook profile. This would typically be used in a member account block. The Facebook ToS require that when a Facebook user is active on your site you display a Facebook profile picture. This tag let’s you do that.
{fabee:linked_profile_pic}
fabee:login_button
{fabee:login_button}
Will generate a button like this: 
fabee:login_button_short
{fabee:login_button_short}
Will generate a button like this: 
fabee:logout_button
{fabee:logout_button}
fabee:publish_comment
This is to be used within your EE Comment Form. It generates a checkbox that if checked will post the submitted comment to the user’s Facebook stream. It should be used in combination with the fabee logged in and stream publish conditionals.
{fabee:publish_comment}
fabee:request_permission
Deprecated. These permissions are now requested at connect time.
This tag will generate a permissions dialog requesting that the user grant email and stream publish permissions to your site. It should be used in combination with the fabee logged in and stream publish conditionals. Note: After these permissions have been granted (or not) then the page will refresh.
{fabee:request_permission}
fabee:uid
This tag will output the logged in user’s Facebook ID. You can use this if you wish to use XFBML on your templates. This is actually the same as the existing ExpressionEngine global variable {username} but will only be populated when a user is actually connected. An example of it’s use might be to render the logged in user’s Facebook status (if they have given permission for an external site to use it).
<fb:user-status uid="{fabee:uid}" linked="true"></fb:user-status>
fabEE Conditionals
fabee_logged_in
Because you are likely to want to display content in a different way depending upon whether a user is logged in normally or whether they are logged in using Facebook this conditional can be used to differentiate between those two types of member. Here is an example of how it might be used to show a member acount block (based upon the default ExpressionEngine template):
Note: It is very important that if a user is logged in using fabEE they are shown the fabEE logout button link instead of the default EE one. The fabEE logout button link actually logs the user out of both Facebook and EE and destroys the sessions and cookies properly.
{if logged_in}
{if fabee_logged_in}{fabee:linked_profile_pic}<br />{/if}
<a href="{path=member/profile}">Your Account</a> | {if fabee_logged_in}{fabee:logout_button}{if:else}<a href="{path=logout}">Logout</a>{/if}
{/if}
fabee_logged_out
You should only need to use this if you find that user sessions are getting mismatched with EE sessions. This should only ever occur if the user’s browser does not allow 3rd party cookies or is not compatible with Facebook Connect - Opera 9 is suspected to have problems.
{if logged_out AND fabee_logged_out}
{fabee:login_button}
{/if}
fabee_stream_publish
This conditional allows you to test whether the user has granted permission for your application to post to their Facebook stream. An example of how it might be used in the ExpressionEngine Comment Form:
{if fabee_logged_in AND fabee_stream_publish}
{fabee:publish_comment} Publish this comment to Facebook?
{if:elseif fabee_logged_in}
<p>You can comment on this site but you need to give this site <a href="{fabee:request_permission}">permission</a> to be able to post to your Facebook profile</p>
{/if}
fabee_send_email
This conditional can be used to test whether the fabEE logged in user has granted permission to your site to send email.
{if fabee_logged_in AND fabee_send_email == FALSE}
{fabee:request_permission}
{if:else}
<p><input type="checkbox" name="notify_me" value="yes" {notify_me} /> Notify me of follow-up comments?</p>
{/if}