Your Ad Here
Skip to content
 

How to add Facebook’s Like button on phpLD

Yes­ter­day, I blogged about imple­ment­ing Facebook’s Like But­ton on this web­site. It’s fairly easy. There’s already tons of Word­Press plu­g­ins for this button.

Unfor­tu­nately, com­pared to Word­Press, phpLD is a bit smaller com­mu­nity so this is prob­a­bly the first Face­book like mod for phpLD.

Any­how, the eas­i­est way to imple­ment Facebook’s Like But­ton on phpLD is to go to Facebook’s plu­gin page, fill in your URL, then copy and paste the code pro­vided to your footer or wher­ever you might want to imple­ment this but­ton on your directory.

The only prob­lem with this easy solu­tion is that it only ‘likes” the URL, most likely your home­page, you’ve given. You can’t share or “like” indi­vid­ual list­ings or arti­cles like what I’ve done here.

For­tu­nately, imple­ment­ing this but­ton on indi­vid­ual list­ings is fairly sim­ple. Just copy the fol­low­ing code on detail.tpl of the tem­plate you’re using.

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fyourwebsite.com/detail.php?id={$ID}&amp;layout=standard&amp;show_faces=true&amp;width=420&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:420px; height:100px"></iframe>

Replace yourwebsite.com with your URL. As you can see, you can manip­u­late the width and height of the plu­gin. If you dont want to show Face­book users’ pho­tos, just set show_faces to false.

If you wish, you can also place this code in your link.tpl but you’ll neeed to replace {$ID} to {$link.ID}

NOTE: I installed this on phpLD ver­sion 4.0 but the mod is so sim­ple I’m sure it works on ver­sion 3.x too and maybe even 2.2

Share/Bookmark:
  • Facebook
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • FriendFeed
  • Technorati
  • Google Bookmarks
  • Yahoo! Buzz
  • email

5 Comments

  1. David says:

    Thanks for this! I just posted about this and linked to this arti­cle in the phpLD free mods section.

  2. B A S E M says:

    Thanks for this

    How to add Share IN Twit­ter Exam­ple Facebook’s Like button

  3. Jirolu says:

    Many thanks for this mods…simple but very use­full for face­book lovers

  4. Have added it to my own direc­tory — Works like a dream

    Thanks :o)

  5. I added this mod to link.tpl because I couldn’t find detail.tpl on v2.2. This really works!

Leave a Reply