23 Feb 2011

How to Tell if a Facebook User Likes Your Facebook Application

9 Comments Facebook, PHP

Here is how you can tell if a user likes your app no matter which Javascript API your Facebook application uses.


Put the following in a *.php file hosted on your server and then create a Facebook Tab application pointing to your server’s php file. You will be able to tell if a Facebook user liked your tab with the following.

	$signed_request = $_REQUEST["signed_request"];
	list($encoded_sig, $payload) = explode('.', $signed_request, 2);
	$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
	if (empty($data["page"]["liked"])):?>
		<p>The viewer has not clicked like for your page.</p>
	<?php else: ?>
		<p>The viewer liked your page.</p>
	<?php endif; ?>

(Current) JavaScript SDK

I was able to find more documentation on the current JS API so I could tell if a user was a fan when the page loads and as they click to “like” or “unlike”.

Read more

17 Jan 2011

Codeigniter Primer

No Comments Codeigniter, PHP

Frameworks are a huge time saver when programming however they can be intimidating and pretty frustrating to a newcomer, especially when easy to follow documentation is not readily available. I’ve definitely had a similar experience working with the Zend Framework and was looking for a better solution. Luckily the folks at NetTuts, did a great job of putting together easy to follow screen casts that got me up and running quickly with a powerful PHP framework called Codeigniter. I did some research and found some more specifics on the differences between Zend and Codeigniter and even benchmarks showing Codeigniter was faster than Zend. After working with both, my personal preference is Codeigniter due to the easy to use documantation and intuitive design. Below are links to the tutorials I found most helpful in getting started:

Read more

14 Jan 2011

Adding (CMS and Template) Layout Blocks in Magento

2 Comments Magento, PHP

There are several ways of adding static (CMS) and template file (*.phtml) layout blocks in Magento. I will try to cover them all here as a quick reference. The reasons behind each are beyond the scope of this reference but they are all useful in specific scenarios:

Read more

07 Jan 2011

Building Flash with Common Courtesy

No Comments Flash (AS3)

Flash (AS3)Recently I had a conversation with a few members of my team about Flash and we all agreed that there are a thousands of ways to do something in Flash and only a few to do it right. Unplanned and poorly organized Flash projects can dampen productivity and really make life difficult for the developer that inherits the code after you write it. Below is an introduction to best practices when developing Flash. It will make your life easier and your Flash developer friendships last longer. Read more

02 Jan 2011

Adding a Contact Form to Magento

6 Comments Magento, PHP

If you’re new to Magento, you may be confused as to how to add a contact form to your store. It wasn’t very intuitive for me so I thought I’d add this quick reference and maybe help someone out. There are two steps involved.

Read more