Share multiple items on facebook - php

I need to build a page with 2 different facebook share instances.
- there is a video i want the end-user to be able to share on his/her profile.
- and then, there is the page itself, which i'd like the user to share.
how to build a page that can let users share 2 different items on a single page?

You just need two separate Facebook Like Boxes or Buttons (note that Like Boxes can only reference Facebook Pages), each configured to the relevant URL (either the video or the page). You'll only need the script and fb-root tab once on the page.
Like Button documentation
Like Box documentation

Related

Plugins for users to use on websites-PHP

I am using CodeIgniter to make a website.
I want to provide users with Plugin/Iframe/banner etc so that they can use it simply by copy pasting code.
I dont want to make image banners because of limitations and dynamic data.
Like the facebook one below .
It is clickable with different links unlike Image banners.
The data in the Box will change every time page is refreshed(almost realtime).
the box should be dynamic i.e different for user with ID1 ,ID2.
Using iframe is an option with something like example.php?banner=ID1
But i dont want user to edit links /text in that.
How should i proceed ?
It's simple.
[ 1 ] Start building your dynamic application. You can provide unique URL to each user based on USERID or USERNAME like
http://www.stackovrflow.com/users/content/{user_id} OR {username}
[ 2 ] Create JavaScript API / Restful API. When Visitor clicks on the link control the click with JS. I mean open new window like Facebook or redirect to your website. The page load above dynamic URL. See the details about New Window.
How can I open a link in a new window?
[ 3 ] This is quite possible using IFrame also providing few lines of code. But it is not preferred. Using / Providing API is always best.

Facebook Like button in Page Tab App

I've seem to have run into an issue here.
I have a voting/gallery app on a Tab of a specific page on Facebook.
So to provide a user with a direct link to a image in a Gallery(in the Paget Tab App), i generated a URL with APP_DATA, so I can pass data(image filename)to the iframe.
So basically my links look kinda like this:
https://www.facebook.com/pages/xxxxxx/xxxxxxxxx?sk=app_xxxxxxx&app_data=showimage.php%3Ffilename%3D1336314789stevakralj%2Ejpg
Now, when I try to create a Like button for this Link, I get nothing.
Any ideas?
I have exactly the same problem... In my app, which is hosted by a page tab, the "Like" buttons for each item apper correctly and the "data-href" attribute for each "like" button has the same format as yours, but EVERY like button points to the Facebook page which hosts the app, not to the individual item... so, for every item in my gallery, the "like" information under it is exactly the same (number of likes for the page hosting the app) and if I "dislike" any item, I "dislike" the entire page.
I have tried the same format but the parameter NOT on a facebook page... then it works... I don't see a difference but:
https://www.facebook.com/pages/xxxxxx/xxxxxxxxx?sk=app_xxxxxxx&app_data=abc (DOESN'T WORK, for each item which have app_data different)
https://www.mytestweb.com/test.aspx?sk=app_xxxxxxx&app_data=abc (WORKS for each item which have app_data different)
Facebook doesn't seem to allow linking directly to a tab page so strips your app ID from the URL. There's no way to get around this except by linking to an external site that bounces back to Facebook.

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).

Integrate facebook Like button for a specific element of my website

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

Facebook share button for website

i need to use share button in my website. Different share button for different products.. mostly we need to use like this,
http://www.facebook.com/sharer.php?
In the above url what are all the parameters we need to pass for showing it as our website, product and some image of that product in that share page...
You asked what parameters you need to pass it to have it show up as your site, etc. The like button uses its own Graph Protocol API to do this, it essentially makes your page a facebook page and can be read as such. It's written like XML and defines things such as the thumbnail you want to show as your picture, the shortname of the site, etc. Go to developers.facebook.com to read all about the facebook API and app development and integrating into your webpage, etc.
you cand use this on github to share content on social media (includes facebook) and make your custom button!
You can use Facebook Like also. It performs the same as the Facebook share now appearing in your Facebook newsfeed with thumbnail, or
You can use some plugins like add this or you can use the following link:
<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

Categories