2011-10-31 70 views

回答

1

在PHP中您可以使用

<?php 
$signed_request = $_REQUEST["signed_request"]; 

list($encoded_sig, $payload) = explode('.', $signed_request, 2); 

$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true); 

$app_data = isset($data["app_data"]) ? $data["app_data"] : ''; 
$_REQUEST["fb_page_id"] = $data["page"]["id"]; 
$access_admin = $data["page"]["admin"] == 1; 
$has_liked = $data["page"]["liked"] == 1; 
?> 

,你可以檢查是否喜歡使用$ has_liked

<?php if($has_liked) : ?> 
fan-specifc 
<?php else : ?> 
for non-fans only 
<?php endif; ?> 
相關問題