pasenseoso
Power Member
- Aug 19, 2011
- 765
- 141
any one can help me check the problem with this? it does show the page but it cannot determine whether the page is already liked or not. it only shows the area for non-likers even if it is already liked.. need help.. if you got better scripts, may you share it if you don't mind..
*app id and secret are samples only
please help..
Code:
<?php
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => '53095196139124',
'secret' => '7e2204334894fd8369d070ecbcc5945c',
'cookie' => true
));
$signed_request = $facebook -> getSignedRequest();
$like_status = $signed_request["page"]["liked"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PAGE TITLE</title>
<base target='_blank' />
</head>
<body>
<?php if ($like_status == "1")
{ ?>
CONTENT FOR PAGE LIKERS
<?php } else { ?>
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fb.o.f.g.i.n.f.o&send=false&layout=box_count&width=450&show_faces=true&font&colorscheme=light&action=like&height=90&appId=53095196139124" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:90px;" allowTransparency="true"></iframe>
CONTENT FOR NON LIKERS
<?php } ?>
</body>
</html>
*app id and secret are samples only
please help..