Skip to:
Content
Pages
Categories
Search
Top
Bottom

New Facebook Like

  • Avatar of mlemberg
    mlemberg
    Participant

    @mlemberg

    Hi!

    A quick question for you clever heads out there.

    Facebook has just released their new set of social plugins. Take a look at them here: http://developers.facebook.com/docs/reference/plugins

    Many of them makes a lot of sense implementing on a Buddypress Site, for instance the new Like Button in compliance with the Recommendations widget.

    The Recommendations widget is peace of cake to implement. But the like button is bugging me because I can’t use a PHP function as i.e. <?php bp_activity_thread_permalink() ?> to define the link that the button will like.

    Can any of you guys point to a work around on this issue? Having a site where everyone registers with Facebook Connect already these plugins would really create value for my users.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of Sarah Gooding
    Sarah Gooding
    Participant

    @pollyplummer

    Yes, here’s how you do it for items in the activity stream. Open entry.php and then paste this in there kind of around where you see the favorite buttons – probably you want it only available if a user is logged in:

    <iframe src="http://www.facebook.com/plugins/like.php?href=<?php bp_activity_thread_permalink() ?>&layout=standard&show-faces=true&width=450&action=like&font=arial&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>

    This will work for you but you should then style it so it doesn’t take up weird amounts of space. I’m writing up a whole tutorial on how to use this with BuddyPress. It will publish tomorrow at 10AM eastern time. I’ll post a link here.

    Avatar of stwc
    stwc
    Participant

    @stwc

    A separate iframe for every single item in the activity stream seems a little… suboptimal.

    Avatar of Sarah Gooding
    Sarah Gooding
    Participant

    @pollyplummer

    I’d love to hear another way to do this :) I’m no expert, just trying things based on the facebook dev documentation.

    Avatar of Sarah Gooding
    Sarah Gooding
    Participant

    @pollyplummer

    You can also use XFBML. It is more flexible than iframes, but requires you use the JavaScript SDK. So that’s another option if you don’t like the iframe.

    Avatar of stwc
    stwc
    Participant

    @stwc

    Nah, I just don’t like Facebook. ;-)

    Carry on!

    Avatar of Sarah Gooding
    Sarah Gooding
    Participant

    @pollyplummer

    Here’s the tutorial about how to do that:

    How to Add the Global Facebook Like Button to BuddyPress Profiles and Activity Stream Items -

    http://wpmu.org/how-to-add-the-global-facebook-like-button-to-buddypress-profiles-and-activity-stream-items/

    Avatar of mlemberg
    mlemberg
    Participant

    @mlemberg

    Thanks Sarah.

    I think I prefer to use the XFBML version but I am not completely clear on how to implement the JavaScript SDK. Could you perhaps give me a few pointers?

    I have this problem with the position of the frame in the default theme. Someone can tell me how to fix it?

    http://img.skitch.com/20100427-mhpbutdq2ebmqukscj3arx3njg.jpg

    Thanks!!

    Avatar of Wallace K
    Wallace K
    Participant

    @wallacekusumo

    I’m having the same problem, anyone?

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.