Ejemplo n.º 1
0
                                    <div class="contentdiv">

                                        <h1 style="font-size:18px">Facebook Logout Button</h1>

                                        <p style="text-align: justify">
                                        Facebook Logout button is used to break application connection with Facebook. After logout is made,
                                        it is impossible to get any more data from Facebook or to use some of the UI features implemented in the toolkit.
                                        Logout button can be implemented as button, link, image, or auto open on page load.

                                        <br /><br />
                                        For all details about the control, with descriptions of all optional properties, please visit:<br />
                                        <b><a href="http://faceconn.com/facebook-logout-button">Facebook Logout Button Tutorial</a></b>.</p>
                                        <br />

                                       <?php 
$logout = new LogoutButton();
$logout->SetOnLogoutJavaScript("alert('Logout executed')");
$logout->SetOnLogoutSubmitForm("form1");
$logout->SetCssClass("faceconn_button");
$logout->SetCssStyle("width:170px");
$logout->Render();
?>
                                        <br /><br />
                                    </div>
                                    <br />
                                    <?php 
include 'SessionCheck.php';
?>
                                </form>
                                
                                
Ejemplo n.º 2
0
// create facebook object.
$facebook = new Facebook(AppConfig::GetKeyArray());
try {
    // create facebook user
    $facebookUser = $facebook->getUser();
    // check if user if connected
    if ($facebookUser) {
        // get user data
        $loggedUser = $facebook->api('/me');
        echo "<b>User data:</b><br />";
        echo "<br /><b>User ID:</b> " . $loggedUser['id'];
        echo "<br /><b>First name:</b> " . $loggedUser['first_name'];
        echo "<br /><b>Last name:</b> " . $loggedUser['last_name'];
        echo "<br /><b>Email:</b> " . $loggedUser['email'];
        echo "<br /><br />";
        $logout = new LogoutButton();
        $logout->SetImage("images/fb_logout.png");
        $logout->SetOnLogoutSubmitForm("form1");
        $logout->Render();
    } else {
        ShowLoginButton();
    }
} catch (Exception $ex) {
    ShowLoginButton();
}
?>
                <br /><br />
                <div class="contentdiv" style="width:400px">
                    This starter kit is used to demonstrate the implementation of authorization inside Facebook Connect application. To see all 15 components from the Faceconn Toolkit 
                    and the other two starter kits click <a href="http://faceconn.com/demo/" target="_blank">Faceconn Demo</a>.
                </div>