PLUGIN README
facebookLogin - Extends Website Membership to support login and sign-up via Facebook
-------------------------------------------------------------------------------

GETTING STARTED
-------------------------------------------------------------------------------
This plugin extends the functionality of the "Website Membership" plugin.

If you haven't already done so, see the "readme.txt" instructions that came
with "Website Membership" and follow those instructions to setup and activate
the Website Membership plugin.

Next, create a Facebook App by following these instructions:


CREATING A FACEBOOK APP AND ENABLING FACEBOOK LOGIN
------------------------------------------------------------------------------

- Go to developers.facebook.com, login if required, then go to My Apps -> Add a new App in the drop down menu at the top of the page.

- If this is your first app, or if you have not verified your facebook account, click on "Register Now" and register.

- A pop up will appear asking you which type of app you wish to create, select website. 

- On the Quick start for website screen enter the name you'd like for your App and click 'Create New Facebook App ID'. Then select which category your app falls under. Leave 'Is this a test version of another app? Learn More. ' set to No.

- You'll be taken to a 4 step 'quick start' process. 

- The first step shows you some JavaScript code, you can ignore this and enter your sites domain in the 'site url' field at the bottom of the page.

- Once this is done, you'll be taken directly to the 'test' step, and the initial configuration is complete!

- Now you can click 'Skip quick start' button in the top corner of this page. 

- This will bring you to your app edit page.

- Copy the APP ID and APP Secret strings into the plugin:
  $GLOBALS['FACEBOOKAPI_APP_ID']                = '';   // Copy facebook App ID from app created at https://developers.facebook.com/apps
  $GLOBALS['FACEBOOKAPI_APP_SECRET']            = '';   // Copy facebook App Secret from app created at https://developers.facebook.com/apps

- Click on "App Domains" and enter your domain without the www (eg: example.com)

- Click on "Website with Facebook Login".  Enter your website URL (eg: http://example.com/ ) and click "Save Changes".

- Enable Facebook Login in your plugin by setting $GLOBALS $GLOBALS['FACEBOOKAPI_ENABLE_LOGIN'] to true.


ADD "LOGIN WITH FACEBOOK" TO YOUR LOGIN PAGE.
------------------------------------------------------------------------------
To add a "Login With Facebook" button to your page:

First, open the login page that you previously created with Website Membership.

Add this HTML where you want to display the login with facebook link:
  <?php if (@$GLOBALS['FACEBOOKAPI_ENABLE_LOGIN']): ?>
    <a href="<?php echo facebookLogin_getFacebookLoginUrl();?>"
       onclick="<?php echo facebookLogin_getFacebookLoginUrl_popupOnClick(); ?>">Login with Facebook</a><br/><br/>
  <?php endif ?>


SET LOGIN URL AND ACTIVATE PLUGIN
------------------------------------------------------------------------------

Finally, check the "WEBSITE_LOGIN_LOGIN_FORM_URL" value in the Website Membership
plugin and make sure the URL is an absolute url starting withing http, https, or /.

Finally, activate the "Facebook Login" plugin under: Admin > Plugins.

Then reload the login page, logging off if necessary, and try logging in with facebook.

If a user account already exists with the same email address as the facebook account, then
facebook will be associated with that account and the user will be logged in.

If no user account exists with the same email as the facebook account, then a
new account will be created for that user.

NOTE: If you have any problems or errors, either follow the instructions to correct
them, or temporarily deactivate the FacebookLogin plugin if needed.


FACEBOOK LOGOS AND BRANDING
-------------------------------------------------------------------------------
If you want to use any type of Facebook Logo or branding on your site, you must
ensure that you are ONLY using those images in accordance with Facebook rules and
guidelines.

For more information, see here:
http://www.facebook.com/brandpermissions/


ADDITIONAL TECHNICAL NOTES
-------------------------------------------------------------------------------
This plugin creates two fields in the accounts table to store the users facebook
login details.  They are as follows: facebook_id and facebook_access_token.

-------------------------------------------------------------------------------
end of file.
