Creating "Like" buttons for arbitrary elements on my website and reading status - is it possible?

I am a complete beginner in programming on Facebook and would like to know how to continue this question , is the following possible.

I have a collection of events on a website. I get them from several RSS feeds and have complete freedom in how to display them - for example, as separate pages, so there is a permanent link for each event.

I would like to

  • Create a “like” button on Facebook for each of the events without entering them into the Facebook system in any way.

  • Read the current status “as” for any of these events via JavaScript or server side so that I can display these events in the list of events that I like. The important thing is that I need to be able to read the status later = on subsequent page requests , and not only at the moment when the user clicks the "how" button.

@ karim79 answer answers the first part, but not the second.

This page contains all the information I need to create a button: Social Plugins> Like a button , there is also an FBML event to respond when someone signs up. But this still does not allow me to check the status of the “returning” user.

Is there any way to do this?

+7
php facebook fbml
source share
1 answer

The "deadly way to automatically generate" similar "links for your site (which I recently implemented, so I know it works) would be to simply generate the" href "parameter, which (facebook) like.php reads from the iframe source. Just create the code iframe using thingie widget and use PHP to dynamize the href parameter:

 <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode($url); ?>%2F&amp;layout=button_count&amp;show_faces=false&amp;width=50&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:75px; height:21px;" allowTransparency="true"></iframe> 

You can customize it to a limited extent, just look at the list of attributes right below the button creation widgets.

Using fbml (which I'm too lazy to include, and somewhat reluctant due to the fact that I would have to include some more library):

 <fb:like width="200" show_faces="no" href="<?php echo $url; ?>"></fb:like> 

Here is a sample list of examples: http://fbrell.com/xfbml/fb:like

+13
source share

All Articles