Jump to content

Recommended Posts

Hi,

 

I'm going to have a website where I'm going to publish certain newsitems daily/weekly or whatever.

This is the link

http://onenation.freehostia.com/kenneth/nieuws.php

 

If you click the title of the certain news item you get the whole article.

Now, each of these articles should have a "like button" from Facebook.

A bit like it is now, but if I click like in my first article, it likes the whole site instead of the 1 article.

How can I seperate this?

 

Article 1

Like!

 

Article 2

You like this!

Link to comment
https://forums.phpfreaks.com/topic/259413-facebook-like-button/
Share on other sites

The like buttons will each have to be "linked" to a different URL, so as to separate the likes.

 

Take a look at the Facebook Developers site where they have the generator for their like buttons. You should be able to to figure out where the article's URL should go and insert that dynamically using PHP

yeah I know, it gives something like this. With the bold being my URL.

 

Article 1

 

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fonenation.freehostia.com%2Fkenneth%2Fnieuws.php&artikelID=1&layout=standard&show_faces=true&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>

 

 

Article 2

 

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fonenation.freehostia.com%2Fkenneth%2Fnieuws.php&artikelID=2&layout=standard&show_faces=true&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>

 

And it doesn't do it correctly

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.