Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://blackhatx.com/seo-forum/
- As most of you know FBML is being deprecated, so this code no longer works.
- Code:
- Non-fan content (eg. Like this page to see a monkey fly
- <fb:visible-to-connection>
- Fan content (eg. a flying monkey)
- </fb:visible-to-connection>
- Here’s what’s needed:
- A place to host files
- A FB PVA so you can create applications
- Time and willingness to read/follow these steps.
- Step 1
- Create a new application by going to:
- Code:
- http://www.facebook.com/developers/
- Click Set Up New App
- Enter a name for the application
- Click Agree to the TOS
- Click Create Application
- Enter the Captcha
- You will be leaded to you application setup page
- Click the Facebook Intergration tab
- Give a Canvas Page name (custom URL for your app)
- Give a You are going to need to make a folder on your site for your
- Canvas URL (eg. http://www.test.com/iframe/ ) and then put that in as your Canvas URL
- Change the iframe size to Auto-Resize (i just do that, up to you though)
- Go down to the Page Tabs area:
- Insert a Tab Name (eg. Welcome!)
- For your Tab URL put the exact same link as you did for the Canvas URL
- Save it so far.
- Step 2
- The code and setup
- First step is to create a folder (eg. I called mine iframe)
- Inside that folder create a php file, we’ll call it index.php
- Copy/Paste this code into index.php
- Code:
- <?php
- include_once('fb_init.php');
- // create the Facebook Graph SDK object
- require_once('facebook.php');
- $facebook = new Facebook(array(
- 'appId'=>'ENTER YOU APP ID HERE', // replace with your value
- 'secret'=>'ENTER YOUR APP SECRET HERE' // replace with your value
- ));
- $signedRequest = $facebook->getSignedRequest();
- // Inspect the signed request
- if($signedRequest['page']['liked'] == 1){
- // Show the content for the person who liked the page
- print '<script type="text/javascript">
- <!--
- window.location = "http://www.test.com/iframe/next.html"
- //-->
- </script>';
- } else {
- // Show the reveal ask content
- print '<script type="text/javascript">
- <!--
- window.location = "http://www.test.com/iframe/landing.html"
- //-->
- </script>';
- }
- ?>
- NOTES:
- Please enter your App ID and App Secret into this code where stated.
- Please change the http://www.test.com/iframe/next.html to your website and create a html , call it next.html
- Please change the http://www.test.com/iframe/landing.html to your website and create a html , call it landing.html
- Next step is you will have to download and install the PHP SDK
- Click here to download it
- Extract all the files:
- What we want from this is EVERYTHING in the src folder
- Put the files from the src folder into your iframe folder online
- That means:
- base_facebook.php
- fb_ca_chain_bundle.crt
- facebook.php
- all in /iframe
- (DON’T do this /iframe/src please, it won’t work)
- Inside the folder iframe create a php file, called fb_init.php
- Copy/Paste this code into fb_init.php
- Code:
- <?php
- // depending on your hosting provider, you may need to include
- // the entire path to the directory you added this file to, for example
- // if your FTP login is, 'monkey', it may be, consult your ISP's docs
- // for additional assistance:
- // require_once('/home/monkey/public_html/iframe/facebook.php');
- require_once('facebook.php');
- $facebook = new Facebook(array(
- 'appId'=>'', // from Facebook
- 'secret'=>'', // from Facebook
- 'cookie'=>true
- ));
- ?>
- Change
- /home/ads/public_html/iframe/facebook.php
- to your directory.
- Mine was shorter like
- ads/public_html/iframe/facebook.php
- After that’s done. You’ve setup the code!!!
- Step 3
- Setup landing.html and next.html with the things you want to show!
- landing.html is the content for the person who has NOT liked the page yet
- next.html is the content for the person who liked the page
- for more information please visit..
- https://blackhatx.com/seo-forum/
Advertisement
Add Comment
Please, Sign In to add comment