Custom facebook like button / fan count - not using facebooks like button generated code

The is probably a simple solution to this, but all I can find is facebook like buttons and share URL's, which won't work for me.

I would like to have a button on my website to like this URL... ...and also retrieve the fan count.

Is it possible using the facebooks PHP or Javascript SDK to create my own? I've already loaded facebook php SDK into my website.

Because I need my button graphic to change to 'Liked' if the current logged in facebook user has already like the page, and say 'Like us' if the logged in user has not liked the page?

And also is it possible to retrieve a facebook page count in a separate div?

If anyone share any pointers, tutorial links, or code you've used to achieve something similar.. that would be awesome.

See my design below which I'm trying to make a reality, and you can see why I need to make my own.

Thank you.


Outside of a canvas/page tab app you would have to get the users permission to read his likes first. If your app requires a login and granting permissions in general, you could include the user_likes permission, and then ask the Graph API if the user liked your page/url already. But if it doesn’t, or the user is unknown (just a random site visitor), then that’s not practical/even possible.

For the count of likes of a page, you can query that from the API separately, but it will also require a page access token.

(If your not familiar with these techniques/terms, please start reading Facebooks documentation on these matters.)

Need Your Help

Mouse wheel not scrolling in JDialog but working in JFrame

java swing scroll jdialog

I'm facing a frustrating issue. I have an application where the scroll wheel doesn't work in a JDialog window (but works in a JFrame).

C# Conway's Game Of Life

c# list button checkbox collections

I built a version of Conway's game of life as a C# Windows Form Application.