Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Provides access to app specific values such as your app id and app secret.
- // Defined in 'AppInfo.php'
- require_once('AppInfo.php');
- require_once('utils.php');
- require_once('sdk/src/facebook.php');
- $facebook = new Facebook(array(
- 'appId' => AppInfo::appID(),
- 'secret' => AppInfo::appSecret(),
- 'sharedSession' => true,
- 'trustForwarded' => true,
- ));
- $signed_request = $facebook->getSignedRequest();
- $liked = $signed_request['page']['liked'];
- // Fetch the basic info of the app that they are using
- $app_info = $facebook->api('/'. AppInfo::appID());
- $app_name = idx($app_info, 'name', '');
- ?>
- <!DOCTYPE html>
- <html xmlns:fb="http://ogp.me/ns/fb#" lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />
- <title><?php echo he($app_name); ?></title>
- <link rel="stylesheet" href="stylesheets/screen.css" media="Screen" type="text/css" />
- <link rel="stylesheet" href="stylesheets/mobile.css" media="handheld, only screen and (max-width: 480px), only screen and (max-device-width: 480px)" type="text/css" />
- <?php
- if( $liked ):
- echo('fan');
- //this is your secret content
- else :
- echo('not a fan ') ;
- //this is shown to potential fans
- endif;
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement