Integrate facebook Like button for a specific element of my website - php

I have a website where i implement a wall of messages, the idea is to add to each of this wall messages a like button, where clicking on it would immediately post on the user's facebook profile page that he likes THAT SPECIFIC COMMENT.
Is this possible? I just enter this new world of facebook php developers, and as far as I have read here it always talks about adding a Like button for a specific URL. I would like to make the like button apply for the specific post within the messages wall.
I am clueless as where to start, if by the way any one could recommend a detailed tutorial on how to integrate a website to facebook in its different ways, i would really appreciate it.
EDIT:
Looking into #Kaan Soral suggestion of using open graph, I think it is important to add that I dont want each wall post that the user likes to appear in the "Likes and Interests" section of his profile... This wouldn't make sense because he would rapidly have loads of likes of separate wall posts.

Its possible, read this: http://developers.facebook.com/docs/opengraph/
You have to create a URL for every item that will be liked and on that URL there should be META tags for descriptions, image etc

Related

How to auto fill Text box in php (Similar to Facebook)

What I am trying to do is to make something similar to what I see all the time on almost any website. The button that says Share to facebook. The goal for me is to let my guests share the item they are viewing in my store (Ran on prestashop) on their blog I run (Running on Oxwall).
The goal is for the button to not only link to a blog post submission webpage but to already have the subject line filled out with the item they are sharing's name and the blog post to display the information about the item. I would like to try and do all this using PHP. I am not sure how to go about doing it but I am sure that I could pass the value. Please note that I can mod BOTH the blog site and the shop as I run both and want to connect them.
As an extra bonus I am also running a forum using phpbb3 if I could do the same thing but onto that as well I would greatly thank you. I am trying to interlink everything into one big network. I know its not an easy task but I am sure there is an easy way to pass data onto the other site so that this can be done.
Facebook a 2 tools to get items informations in the page, it parses the page looking for the most common tags and it uses OpenGraph.
You can also provide product informations in the head of your page (between head tags), then blog side, you retrieve only the contents and parse it as XML.
I advise you to cache this data to avoid useless connections between websites and awful overloads while parsing.
You can use your own specifications, Open Graph or another standard, but i advise to use a standard.

AddThis - Posting a variable score to Facebook and Twitter

Is it possible to have facebook and twitter "AddThis" links pull a user's score from a game?
Im developing a simple HTML5 "quiz". There is a score counter set up that I would like to be able to echo to the Twitter and Facebook share options, but I cant seem to make this work and im not sure if it's even possible...
The counter is handled through JS and displays dynamically in "#score":
<div id="score-counter"><span id="score"></span<span>/20</span></div>
I would like to be able to share something like "I got '__'/20 on this game, can you beat me?"
Looked through a ton of documentation but still can't seem to figure it out... Can anyone advise how to go about accomplishing this?
Since the open graph is essentially a page scraper, you can't dynamically generate meta tags via javascript. Essentially, this answer is probably the right one which will ultimately lead you to this question/answer.
You would basically need to create a separate share url where you'd pass in query parameters for the page to read in order to dynamically spit out the correct meta tags for the open graph to see.

What's up with Facebook Pages why is there fragmentation

I'm trying to figure out why Facebook is creating fragmentation with its pages. I really don't understand it. Also is there anything that can be done about this.
Here is a perfect example I have my Facebook company page for "Scoreoid" (http://www.facebook.com/pages/Scoreoid/245182948843019) this has my content wall post's, photos ect..
Then I have this page which I guess is only connected to the Scoreoid website which is new and was automatically done http://www.facebook.com/pages/Scoreoid-the-ultimate-game-platform-for-developers/269861406410210
This is the page for the Scoreoid site which has 130 likes but of course on Facebook it only shows 15 another question either way why is there two pages why can't everything be connected to one page.
All this does is create fragmentation which is noting but bad user experiences.
It would max sense to have everything directed to the Facebook main page. Of course I have other questions for which do I run advertising on which should I update with content?
I've already answered you here two weeks ago:
Facebook Likes not showing on Facebook page but show up on site
Facebook pages like counts are NOT THE SAME as like counts for a web site. They cannot be joined by Facebook as they are two separate IDs. You can have your parsing scripts add together the two like counts yourself.
This has been my experience. If you add the open graph meta tags (og:url, og:image, og:type, etc.) Facebook will create a "facebook page", but this page will only be accessable by you. This is the message that facebook will show on this open graph page: http://snag.gy/z9UfG.jpg
If besides this you create another page then it will not be linked with this page. I recommend you use the page you created as that page is accessible by everyone.
If this is not your case then please clarify.

Facebook "Like" a photo in a list of photos on single PHP page

What I'm trying to accomplish seems like it should be pretty simple...
I have a gallery of 10-20 photos in a grid, all on a single PHP page.
I want a Facebook "Like" button below each photo. When the "Like" is shared on the user's profile (if they choose), I want it to show the photo they liked, but link to the page with the gallery.
A wireframe image of what I'm trying to accomplish is here: http://i.stack.imgur.com/u3h0E.png
Right now, I'm simply using a simple Facebook Like Button, but I want to tie each Like Button to the respective photo, yet have it all tied back to this gallery page.
Any help or direction is appreciated! Would certainly prefer to stay away from setting up anything complicated with the Graph API, but if that's the only method, let me know!
One quick solution would be to have each photo in the gallery (and its respective like button) render within its own IFRAME. As far as the photo display and LIKE button are concerned, they live in a separate context (and URI). You could then redirect any requests to that URI that don't originate from an AJAX request (i.e. whenever someone tries to access the content that has been "Liked") to the gallery page. This has the added advantage that you can (as your app evolves) use AJAX calls to substitute out and load in new photos, in place of the old ones, with minimal effort (that's a tangent though).

How does the Facebook 'share' button on Stack overflow work?

I am looking to add social icons to our site, giving customers the ability to "like", tweet and share content on their facebook and twitter profiles. I have noticed to the left of this box, the facebook and twitter icons do exactly what I am trying to accomplish but I am not familiar with how to do this. Looking at the source code, there are JS references to:
<script type="text/javascript">
StackExchange.ready(function() {
var shareUrl = "http%3a%2f%2fstackoverflow.com%2fq%2f7505636%2f337690";
var shareMsg = "Advice+integrating+Facebook+%27share%27+and+link%2fimage+capabilities+with+our+site";
StackExchange.share.facebook($("#fb-share-7505636"), shareUrl, shareMsg);
StackExchange.share.twitter($("#twitter-share-7505636"), shareUrl, shareMsg);
});
</script>
Our site works this way: While anybody can visit the primary site at any time, individuals can sign up as representatives with their own unique URL that acts as a referrer to give 'credit' on rewards. I have reviewed the facebook developer site and to be honest I am slightly overwhelmed. I want to give our members the ability to click a Facebook icon from within their dashboard, prompting them to post on their wall with a set image, set title, and description. I have read in the documentation this is done by setting meta tags in the head but it does not seem to matter for my site (or I am clearly doing it wrong).
What if the URL facebook is looking for (share URL) is behind a password protected page or an area of the site which would not allow content based on a missing PHP SESSION variable?
Edit
I have also seen a lot on the net which says I have to integrate the Facebook JS SDK but then goes on to talk about authentication/permission to write on walls, etc. Yes the link to the left does not ask for permission to do anything other than to 1) log into the FB account, 2) post on the user's wall.
This site is a perfect example
The link above is great but it assumes I need to authorize a 'share' which does not occur on this site.
When you click on the share button, you call a script on facebook.com that will then in turn access the page pointed to in the querystring (?u=xxxxxx).
Facebook will parse that page and grab the first few images it finds, a description and title from the page. That is what it shows to you and allows you to add some additional text (as well as edit the title/description/and choose different images).
If that page contains the specific meta tags that facebook asks you to add to the page, then they'll use those to populate the title/description/image. This allows the webpage author to control how their page shows up in a facebook feed (although the user could still edit it before posting). These meta tags would need to be in that particular page to be used by facebook.
If facebook cannot access the page because it's password protected, etc. - then it cannot parse the meta tags and will then just show the user the URL as the title with no description and thumbnail.

Categories