This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : 'xxx', // App ID | |
channelUrl : 'channel.html', // Channel File | |
status : true, // check login status | |
cookie : true, // enable cookies to allow the server to access the session | |
xfbml : true // parse XFBML | |
}); | |
// Remove those pesky scrollbars |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, body { | |
width: 810px; | |
overflow: hidden; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- anchor example --> | |
<a href="#" onclick="FB.Canvas.scrollTo( 0, 500 );">Click here to enter</a> | |
<!-- anchor with jQuery dynamic placement example --> | |
<a href="#" onclick="FB.Canvas.scrollTo( 0, $('.enter-btn').offset().top );">Click here to enter</a> | |
<!-- page load example --> | |
<script type="text/javascript"> | |
window.fbAsyncInit = function() { | |
FB.init({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$appId = 'aaaaaaaaaaaa'; | |
$appSecret = 'bbbbbbbbbbbb'; | |
// init facebook | |
$facebook = new Facebook( array( 'appId' => $appId, 'secret' => $appSecret ) ); | |
// get user_id, 0 if not logged in | |
$user = $facebook->getUser(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sr = $facebook->getSignedRequest(); | |
// check if the page has been liked | |
if ( !isset( $sr ) || !isset( $sr['page']['liked'] ) || $sr['page']['liked'] != true ) { | |
// likegate | |
header( 'Location: likegate.php' ); | |
} else { | |
// regular content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array | |
( | |
[algorithm] => HMAC-SHA256 | |
[issued_at] => 1378146888 | |
[page] => Array | |
( | |
[id] => 1234567890 | |
[liked] => 1 | |
[admin] => 1 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// change these to match your app | |
$app_id = '1234567890'; | |
$app_secret = 'abcdefghijklmnopqrstuvwxyz'; | |
// init facebook class | |
$facebook = new Facebook( array( 'appId' => $app_id, 'secret' => $app_secret ) ); | |
/* Ban Users */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// change these to match your app | |
$app_id = '1234567890'; | |
$app_secret = 'abcdefghijklmnopqrstuvwxyz'; | |
// init facebook class | |
$facebook = new Facebook( array( 'appId' => $app_id, 'secret' => $app_secret ) ); | |
// call {app_id}/banned/ using app access_token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once( 'parse/parse.php' ); | |
$parseQuery = new parseQuery('_User'); | |
$result = $parseQuery->find(); | |
foreach ( $result->results as $user ) { | |
unset( $user->email ); | |
if ( isset( $user->authData->facebook ) ) { | |
unset( $user->authData->facebook->access_token ); |
OlderNewer