Soldato
Anyone familar with coding Facebook Tab Apps?
Trying to get a "Pre Like" and a "Post Like" page to appear.
Here's the code, but it doesn't seem to work! Just constantly shows the Pre Like even after the user has liked the page.
Trying to get a "Pre Like" and a "Post Like" page to appear.
Here's the code, but it doesn't seem to work! Just constantly shows the Pre Like even after the user has liked the page.
PHP:
<?php
require 'src/facebook.php';
$app_id = "MY ID HERE";
$app_secret = "MY APP SECRET HERE";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$signed_request = $facebook->getSignedRequest();
$page_id = $signed_request["page"]["id"];
$page_admin = $signed_request["page"]["admin"];
$like_status = $signed_request["page"]["liked"];
$country = $signed_request["user"]["country"];
$locale = $signed_request["user"]["locale"];
// The following statement does a test of $like_status and chooses which page to display to the visitor
if ($like_status) {$a = file_get_contents("reveal.php");
echo ($a);
}
else {$a = file_get_contents("prelike.php");
echo ($a);
}
?>