Advertisement
w0lfiesmith

Hroku Facebook Fan-gate replacment index.php file

Mar 7th, 2013
1,712
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. // Provides access to app specific values such as your app id and app secret.
  5. // Defined in 'AppInfo.php'
  6. require_once('AppInfo.php');
  7. require_once('utils.php');
  8. require_once('sdk/src/facebook.php');
  9.  
  10. $facebook = new Facebook(array(
  11.   'appId'  => AppInfo::appID(),
  12.   'secret' => AppInfo::appSecret(),
  13.   'sharedSession' => true,
  14.   'trustForwarded' => true,
  15. ));
  16.  
  17. $signed_request = $facebook->getSignedRequest();
  18. $liked = $signed_request['page']['liked'];
  19.  
  20. // Fetch the basic info of the app that they are using
  21. $app_info = $facebook->api('/'. AppInfo::appID());
  22.  
  23. $app_name = idx($app_info, 'name', '');
  24.  
  25. ?>
  26. <!DOCTYPE html>
  27. <html xmlns:fb="http://ogp.me/ns/fb#" lang="en">
  28.   <head>
  29.     <meta charset="utf-8" />
  30.     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />
  31.  
  32.     <title><?php echo he($app_name); ?></title>
  33.     <link rel="stylesheet" href="stylesheets/screen.css" media="Screen" type="text/css" />
  34.     <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" />
  35.  
  36.     <?php
  37.     if( $liked ):
  38.       echo('fan');
  39.       //this is your secret content
  40.     else :
  41.       echo('not a fan ') ;
  42.       //this is shown to potential fans
  43.     endif;
  44.     ?>
  45.    
  46.   </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement