Facebook Invite All Friends is used to invite friends to start using an application without requiring for manual selection in step 50 by 50. It is implemented in 3 forms: as a button, as a link or as an image, on which user has to click to open the request dialog. There is also an option to open it automatically on page load.

This class is a member of Facebook PHP SDK. To see all classes from the toolkit, please look at the Facebook PHP SDK classes.


Facebook Invite All Friends Image

Following image represents the Facebook Invite All Friends. Names are hidden, because of privacy protection.

facebook all friends


PHP Example

The example shows default Facebook Invite All Friends, which is shown on picture above. The example shows the code of whole page, but important content is highlighted: required includes and initialization for any page with brown color, and working with Facebook Request Dialog PHP class with blue color.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
       <title>Facebook Invite All Friends PHP Example</title>
    </head>
    <body>
        <?php
            require_once 'facebook.php';
            require_once 'faceconn/faceconn.php';
            UseGraphAPI();

            $invite = new InviteAllFriends();
            $invite->SetMessage("Try Facebook Connect PHP Toolkit");
            $invite->Render();
        ?>
        </body>
</html>



Facebook Invite All Friends PHP class has a demo page inside Demo Website where it can be seen how it works. The most important fact is that the Demo website is contained in package with Facebook Connect PHP Toolkit which is very useful resource of code examples for each control from the toolkit. Look at the Facebook Invite All Friends Demo page.


Configuration

Configuration of the Invite All Friends PHP class is done through calls of the setter methods, which in turn set the private properties. For Facebook Invite All Friends PHP class, there is one required property to set and others are optional. All you have to do is to create new instance of the class, set the message, and call Render() method.

facebook request dialog php
Method Name
Type
Description
facebook request dialog php
SetMessage
String
Function sets the message of the request dialog.
facebook request dialog php
SetTitle
String
Function sets the title of the request dialog.
facebook request dialog php
SetAdditionalData
String
Function sets the additional data of request dialog.
facebook request dialog php
SetFriendId
String
Function sets the friend ID. If it's set, the request will be sent just to this friend.
facebook request dialog php
SetCommandType
String
Function sets the type of the command control. Allowed values are 'link', 'button', 'image' and 'auto'. Default value is 'button'.
facebook request dialog php
SetCommandText
String
Function sets the title of a request button/link. Default value is 'Send Request'.
facebook request dialog php
SetCssStyle
String
Function sets the CSS style of the button/link.
facebook request dialog php
SetCssClass
String
Function sets the CSS class of the button/link.
facebook request dialog php
SetFilters
String
Function sets the filters of the request dialog.
facebook request dialog php
SetRedirectUri
String
Function sets the redirect URI of the request dialog.
facebook request dialog php
SetImage
String
Function sets the image of the button. Image type is set automatically.
facebook request dialog php
SetOnSendRequestJavaScript
String
JavaScript code which will be executed after request is sent. List of invited friends IDs is stored in invitedFriends JavaScript variable.
facebook request dialog php
SetOnSendRequestSubmitForm
String
Form which will be submitter after request is sent. After form is submitter, list of invited friends IDs is stored in $_GET["invitedFriends"].
facebook request dialog php
SetNextDialogTitle
String
Function sets title of invite next friends dialog. Default value is 'Invite more friends ...'
facebook request dialog php
SetNextDialogNumbers
String
Function sets numbers of invite next friends dialog. Default: Invites were sent to first {0} out of {1} of your friends.
facebook request dialog php
SetNextDialogContinueLabel
String
Function sets continue label of next friends dialog. Default: Continue with sending to next 50 friends ..
facebook request dialog php
SetNextDialogContinueButton
String
Function sets text of continue button inside next friends dialog. Default: Continue.
facebook request dialog php
SetNextDialogCancelButton
String
Function sets text of cancel button inside next friends dialog. Default: Cancel.