So I'm a bit of a gamer
For Gears 1
Gears 2
Now I'm playing the Gears 3
Hit me up if you see me online, I'm willing to die by lancer. GamerTag: Zaaneek
So, to follow up on my previous Facebook post, I wanted to share our solution.
The goal was a fangate page. A user goes to the page. If they are a fan, they see one page, if they are not a fan they see a page asking them to like it to view the other content.
Nothing I was finding online was working, especially since FB is moving away from FBML and towards iFrames and we needed to implement their PHP SDK. Everything we found online, and subsequently tried would prompt the user for permissions to access their account. We didn't need that, nor did we even want any of it.
Long story short, we had four files and that solved the problem (five if you count the facebook.php file from GITHUB). Assuming you already have a Facebook page setup and have created an app to mess around with-
The structure went like this/index.php
/config.php
/fanpage.php
/becomeafan.php
/library/facebook.php
/config.php looks like this
/index.php looks like this
/fanpage.php can look like whatever you want to display. For testing I made it just
/becomeafan.php can also look like whatever you want to display. For testing I made it just
On a gotcha, this only worked within a Facebook page. When running the .php files directly from the server getSignedRequest didn't return anything, and thus $like_status was always null, and the user was always sent to the becomeafan.php page.
But that's all it took. After all the searching and digging and testing and page updating and refreshing and asking others in the office to click on things.