Posted By

dottDesign on 10/06/11


Tagged

textmate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

fchrisb


Facebook Fans


 / Published in: Other
 

  1. <?php
  2. $signed_request = $_REQUEST["signed_request"];
  3.  
  4. list($encoded_sig, $payload) = explode('.', $signed_request, 2);
  5.  
  6. $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
  7.  
  8. $app_data = isset($data["app_data"]) ? $data["app_data"] : '';
  9. $_REQUEST["fb_page_id"] = $data["page"]["id"];
  10. $access_admin = $data["page"]["admin"] == 1;
  11. $has_liked = $data["page"]["liked"] == 1;
  12. ?>
  13.  
  14.  
  15.  
  16.  
  17.  
  18. <?php if($has_liked) : ?>
  19. fan-specifc
  20. <?php else : ?>
  21. for non-fans only
  22. <?php endif; ?>

Report this snippet  

You need to login to post a comment.