Ever since TiR has been up and integrated with facebook, I've been inviting my friends to become fans of the TiR app page on facebook. However, my friends seemed to be least interested in accepting that fan invite. At first I wondered if I had reached a new low when it comes to popularity amongst my friends. Fed up with their apparent indifference, I went on working on the site. Then the other day Niki tells me that she had suggested the page to a friend, but the person never received her invite. I dismissed it as a non-tech-savvy person probably unaware of where the invite shows up... and continued with my work, and hating my friends for being such horrible people.
This weekend I was at my cousins' place. While online from there on a lazy Saturday afternoon, I realized to my horror that
- the site looks like plastic surgery gone wrong in Firefox, and
- facebook for some retarded reason refuses to actually send out those fan invitations.
Since I couldn't invite people to become fans, I thought I'd create a link on the site to allow visitors to become fans from the site itself. However facebook only provides a rather bulky "fanbox" to do this. While this would normally be OK, having a large fanbox on the rather Spartan homepage kind of ruined the look. So I dived into using the facebook API to see if I could do something about it.
Unfortunately the current facebook PHP and JavaScript client APIs, although powerful, have no way to provide the "become a fan" functionality with a simple link. It seems facebook wants you to have that box on the page after all. So I started working on a way to display the fanbox only to people who are not already fans. To do this, one has to first check if the visitor is logged in to facebook. Here's the logic... and the problem I'm facing.