Social Media Support Center
Would you like to react to this message? Create an account in a few clicks or log in to continue.

detect fans in iframe taq

2 posters

Go down

detect fans in iframe taq Empty detect fans in iframe taq

Post by achan Wed May 25, 2011 11:35 pm

how to detect fans / non-fans in iframe to display different info. for them?

this code work to detect my app, by not my page....
Code:
<?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;
?>



<?php if($has_liked) : ?>
<p>fan-specifc</p>
<?php else : ?>
<p>for non-fans only</p>
<?php endif; ?>
</body>
</html>
achan
achan
New Member



Back to top Go down

detect fans in iframe taq Empty Re: detect fans in iframe taq

Post by Admin Thu May 26, 2011 6:31 pm

The signed up request is the only piece of code that seems to be correct, of the above.

Unfortunately, I cannot post the codes that must be used in an iFrame-based tab for fans and non-fans (copyright reasons), but you can find a tutorial on Google.

You just need to get the signed request, the app's ID, the app's secret key, and then 2 echo's: one for fans, and one for non-fans.

Good luck! Wink
avatar
Admin
Ultimate SN Fan



Back to top Go down

detect fans in iframe taq Empty Re: detect fans in iframe taq

Post by achan Thu May 26, 2011 11:20 pm

Thx for you hint!

It works now. Yay
achan
achan
New Member



Back to top Go down

detect fans in iframe taq Empty Re: detect fans in iframe taq

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum