Facebook Fanpage “Like” Only Content
November 7th, 2011 | Posted by in SEO & Internet MarketingDownload the Facebook php SDK at https://github.com/facebook/php-sdk/, extract it and copy the src directory to the location where your custom fan page tab script is. The following script will check whether or not the current user has “liked” your fan page and serve different information depending on its status
<?php
require 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => '123456789012345',
'secret' => 'dhsj38dh28dhshds82nxcklkldw863h2',
));
$curStatus = $facebook->getSignedRequest();
if($curStatus["page"]["liked"] == 1){
echo "Here is where you would input the content for people who have liked your fan page";
}
else{
echo "Here is where the content for people have not liked your fan page goes";
}
?>
Set the appID and secret key to the values assigned to your Facebook Application

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.




