..:: Todd N. Thompson Custom Programming ::..
Todd N. Thompson

My Top 10 Web Development Projects

mmavillage.com valuereply.com widgetadgenerator.com thelistvirus.com royal-responder.com supplysidedating.com todd.90210isnow.com todd.themaxgxlsystem.com todd.3fxshots.com successmartialarts.com

March 26, 2011

Facebook Fan Page – iFrame Template for a REVEAL tab

On March 11th of this year Facebook changed the way fan pages function. This change has causes ALOT of confusion and created many heated debates.

This article is neither confusing, nor debatable.

The sole purpose is to provide a simple, easy to use fan page template that allows you to unlock the power of Facebooks new iFrame fan pages.

Below you can download the 4 files needed for this system.

The 4 files explained.

  1. control.php : Yep .. it controls the fan page. It determines what to show a visitor based on whether they have Liked your Fan page of not.
  2. facenookSDK.php : is the Facebook SDK. Basically it is a library of functions that allow easy access to facebooks API … more crazy terms, I know. Ok .. it is THE file that allows your fan page to communicate with facebook. Better?
  3. Liked.php : Is the content you show when a visitor likes your page.
  4. Unliked.php : Is the content you show when a visitor has 'NOT' liked your Fan page. This file will typically contain only images that encourage the visitor to like your page in order to receive something of value.

    Example: Supply Side Dating

Download Facebook iFrame Fan Page Template Now

One last thing … PLEASE 'LIKE' this post above .. thank you!

Enjoy!

Todd N. Thompson

Filed under Facebook, Software by

Tell The World!

del.icio.us Digg StumbleUpon Ask BlinkList Bloglines Facebook Google Newsvine Reddit Spurl Technorati Twitter Help

Permalink Print Comment

Comments on Facebook Fan Page – iFrame Template for a REVEAL tab »

April 1, 2011

jimm @ 10:12 pm

Thanks for sharing. Will give it a try.

April 2, 2011

peter mcgrath @ 1:53 am

hi Todd
Thanks for a very useful article from someone who knows nothing about
programming or setting up a fan page .I like your example maybe you could run a basic training course for people like me
cheers have agreat weekend where ever you are in the World like your emails
regards
peter mcgrath

Jef @ 3:54 am

wow Todd, as an IPhone/IPad/Ipod programmer I appreciate your creation of this Iframe Reveal tab.
You could have charged money for this and yet you give it away.

April 14, 2011

lorenzo @ 8:27 am

Hi Todd
ok I liked this page, but I have a couple of questions.
1 – does it work even if I have no PHP on my host? (probably not?)
2 – Is "index" page the control.php or unliked.php?
3 – why is impossible to find something that works in javascript than PHP?
4- why earth is not flat? :)

thanks Lorenzo

April 19, 2011

admin @ 9:02 am

Lorenzo,

A host without PHP? Really! You need to find a better host,
but you are correct .. if you do not have PHP on your host,
this script set will not work for you.

The control.php is the index page.

Javascript can be turned off in your browser and quite a few
people do to protect their computer from malicious javascript code.
So .. javascript is not a reliable option here .. you can't turn
off PHP.

The earth was flat 500 years ago . ;)

April 20, 2011

Adam Ward @ 12:30 am

Hey Todd,

After hours of struggling with the PHP to do the fangate, I found this post. Thank you so much for this tutorial, it was quick, to the point, and easy for the layman to understand. Keep up the good work!

May 2, 2011

Paige @ 3:40 pm

Hey Todd:

Trying this, but still can't seem to get to work. I work at a University and had the IT department give me space on our server, configured for PHP. I did test a "hello world" PHP just to see.

I have replaced the Liked php with html as well as a form and the UNliked is simply a jpg.

I have double checked my appid and app secret. Any thoughts?

May 24, 2011

Sean s @ 2:01 pm

Todd, Thanks so much for the coding! I do have a question for you though. When I made the pages longer than the standard 800, I encountered the dreaded scroll bar effect. With the "content" pages being called from the control page and most solutions involving some javascript in the heading, how have you gotten around the scroll bars? Thanks for your help!

admin @ 2:37 pm

Put this at the top of the Liked.php

NOTE: I removed the < character from the div and script
tags .. you will need to add them back.

div id="fb-root"> /div>

script>
window.fbAsyncInit = function() {

FB.Canvas.setSize({ width: 521, height: 1990 });

FB.init({
appId : '< ?=FACEBOOK_APP_ID;?>',
session : null, // don't refetch the session when PHP already has it
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
}; // close windows.fbAsync …

(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
/script>

Sean s @ 3:00 pm

I appreciate the quick reply! However, that didn't resolve the scrollbar issues. Oddly enough it makes the page skip the "like" and jump to the wall in IE 8 and scrollbars still exist, only on the "liked" page in firefox 3 and 4. Chrome seems to behave like it should..lol..here's the link http://www.facebook.com/pages/ReverseMyMortgagecom/206094966097394?sk=app_228093673874406

admin @ 3:34 pm

Sean,

I looked at your page .. both Liked and Unliked … and you have issues.

The Liked page has 3 references of the js function:
FB.Canvas.setSize(); <– 2 that look like this
and the one I sent you:
FB.Canvas.setSize({ width: 521, height: 1990 });

Plus you have the FB.init({ function list twice as well.

You need to fix your code.
If you put exactly what I gave you … it will work.
I have that EXACT code on 15+ fan pages.

Todd

admin @ 3:35 pm

Also … put same code on your Unlike.php to remove the
scroll bars on that page as well.

Todd

November 29, 2011

Joe @ 9:22 pm

I have a question about this part in control.php…

$PAGE_id=$response[page][id];
$LIKED=$response[page][liked]; // null means NO and 1 means YES
$isADMIN=$response[page][admin]; // null means NO and 1 means YES

Where do I place the "1" for yes?

November 30, 2011

admin @ 10:34 am

Joe,

YOU don't place a 1 anywhere. The values are pulled
from facebook based on whether the person has LIKED
your page or not.

Thanks.

Todd

Leave a Comment

Powered by WP Hashcash

Copyright © 2009-2012 Todd N. Thompson All Rights Reserved