New Plugin Available: BuddyPress My Friends Widgets – Download Here

February 9, 2010  | 
29 Comments

screenshot-1Displaying a user’s friends in the sidebar is something that simply makes sense for a lot of community sites. Although there are widgets available for showing members, recently active members, and who’s online, BuddyPress does not come packaged with a widget for displaying a logged in user’s friends in the sidebar. If users are easily able to see their friends when they log in, they are more likely to check up on each other and start interacting. I wrote this little plugin last night for WordPress 2.9.1 and BuddyPress 1.2. Last week Damon Cook made a BuddyPress widgets pack using a couple of our tutorials here at WPMU.org, so I took some inspiration from his idea and made some more widgets that I think you will find to be very useful. This is my first plugin, so if you see anything wrong with how it’s written, please leave a note in the comments. I submitted it to the WordPress repository so hopefully it will show up there soon, but you can download it right here for now.

BuddyPress My Friends Widget comes with two widgets for displaying a logged in user’s friends. The small size displays 40px avatars and the big size displays 82px avatars, as you can see in the screenshots. If the user is not logged in, they will see a message that says “Login or Register to make some friends!” In the near future I will add the ability for users to select how many avatars to display in the widget options, but for now it’s set at 20 for the small ones and 10 for the big size. They are your basic drag and drop widgets – it’s so easy, even a girl can do it! ;)

Simple Installation:

screenshot-2

Step 1: Download the BuddyPress My Friends Widgets Plugin.

Step 2: Upload to the Plugins Directory.

Step 3: Activate the Plugin.

Step 4: Navigate to Dashboard >> Appearance >> Widgets and drag and drop them where you want them.

I always wondered why there wasn’t a widget to easily show your own friends in the sidebar. Now there is! If you give this plugin a try, please let us know how it works for you and what improvements you’d like to see for the next version. :)

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - Add bottom corner (or anywhere else) chat to your site

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - Every great SEO tweak you need, in one snazzy bundle

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - Host sites, get paid, just like WordPress.com

If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more

Featured Plugin - Start Your Own Powerful Membership Site

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

Featured Plugin - Easily integrate your WordPress site with Facebook

Would you like to add Facebook comments, registration, 'Like' buttons and autoposting to your WP site? Well, The Ultimate Facebook plugin has got that all covered!
Find out more

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

29 Responses to New Plugin Available: BuddyPress My Friends Widgets – Download Here

  1. That’s funny I’ve just finished the same thing for my upcoming theme… great minds think alike :)

  2. Hi , your articles are really helpful !! thanks, well I have one query I would like to show some friends suggestion based on activities i.e if one person make an activity as his “Favorite” and some other person somewhere make the same activity as his “Favorite”. so how to suggest people like this for friend suggestion?

  3. wow, really love that plugin! using it right now.
    how about a widget for displaying friends of a user? with 1.2 there is no nice way of displaying some ele’s friend directly on the profile, you have to click the friends tab first…

  4. This is nice! what about a Mutual Friends Widget????

  5. Hello,
    I meet this error:
    Fatal error: Call to undefined function bp_has_members() in ***/wp-content/plugins/buddypress-my-friends-widgets/buddypress-my-friends-widgets.php on line 88

  6. @01on Are you using 1.2 RC ? It’s not made for older versions of BuddyPress.

  7. @Sarah Gooding
    I’m using BuddyPress 1.1.3
    Sorry,I didn’t known that this plugin require BuddyPress 1.2.
    Where can I down BuddyPress 1.2 ?
    There is only 1.1.3 here: http://buddypress.org/download/

  8. Here ya go. http://buddypress.org/blog/news/buddypress-1-2-rc2/ There are instructions there for how to upgrade. You will really like 1.2 much better because there are tons of new features. :)

  9. @Sarah Gooding
    Thank you.

  10. bp_has_members( ‘type=newest&max=20&user_id=’ . bp_loggedin_user_id() ) & is_user_logged_in() ) :

    found that that replacing that line with

    ?php if ( bp_has_members( ‘per_page=40&type=active&user_id=&max=30′ . $bp->displayed_user->id == $bp->loggedin_user->id) ) : ?

    works to show the current user’s friends not only your own.

  11. Nice! Thanks for sharing that. :)

  12. np. that was for the earlier comment asking how to. :) thank you for sharing your jumpstart that got us to that little discovery!

  13. Thanks for the plugin. Currently it shows a ‘log in or sign up message’ even if users are logged in but don’t have any friends. Maybe a different message (make some friends with a link to the members list) for that in the next update?

  14. This widget works well when logged in, that is, it shows friends as intended. However, when logged out it creates a sign-up link which, in my case, point to the wrong link. My BuddyPress website is not located at the root, but the widget points to the root for registration. Example:

    Sign-up should be like this: http://www.website.com/main/register
    But the widget points to this: http://www.website.com/register

    Is there a quick work around for this?

  15. Joh- Yes, just edit the plugin’s PHP file and where you see: Login or < a href=”/register/” change to have “/main/register/” instead. :)

  16. @Sarah
    Awesome! You da best!

  17. Prompt please how to do so this widget is not displayed for non-logged on users?

  18. Hi there , I use it and works , but when a user logged in – but have no friends – plugin shows a message : Login or Sign Up …
    hmm i think it’s better to show : “You have no friend” or something like this.

  19. Hi Sara , may you help me? Plz!?

  20. Sarah,

    Any way to get multiple instances of this widget? I’m using BP-Daily Theme and there are different sidebars for different pages. It would be cool to put this more places.

    -Greg

  21. Greg – Great idea. I’m going to have to work on adding that in when I get a bit of time. Thanks.

  22. Sara.
    my it possible to add a green dot on Online friends pictures?
    tnx about this plug in , it is so useful

  23. Sephr- That sounds like a cool idea. I’m making a list of these and will see what I can add into the next version. Thanks for the great idea!

  24. Sarah – You are welcome :-)

  25. For other readers: To completely hide the widget when the user is not signed in, add the following statement just before the two extract() calls:

    if ( !is_user_logged_in() ) return;

    Sarah: Would like to see settings available in Appearance > Widgets > My Friends:
    * dropdown or radio buttons: Avatar size: large, small (rather than two widgets); may be “medium” that is 3 avatars per row. Or may be “Avatars per row: 2, 3, 4″.
    * text field: Max Friends to show (round to nearest row size, and limit to 100).
    * checkbox: Show only when signed in
    * checkbox: Link to Members when no friends. (e.g.: “No Friends”, “No Friends. Make Friends (with link to Members slug)”).

  26. Unfortunately the plugin is not localized. Does not work on websites in languages other than English.

  27. I like this plugin alot. since it limits the amount of friends displayed, I just needed it to also have a link to say “View All”.

    I added it by doing this:
    Find:
    extract( $args );

    and paste the following AFTER it:

    // get username
    global $current_user;
    $username = $current_user->user_login;

    then replace
    . 'My Friends'
    with the following:
    . 'My Friends      View All'

    — repeat that for the small and large avatar sections.

  28. oops, the last line actually displayed the html.. let me try to repost that correctly… ……………..

    I like this plugin alot. since it limits the amount of friends displayed, I just needed it to also have a link to say “View All”.

    I added it by doing this:
    Find:
    extract( $args );

    and paste the following AFTER it:

    // get username
    global $current_user;
    $username = $current_user->user_login;

    then replace
    . 'My Friends'
    with the following:
    . 'My Friends      <a href="/members/' . $username . '/friends/">View All</a>'

    — repeat that for the small and large avatar sections.

  29. Please i need help.

    I see “Login or Signup to make some friends!”

    i am logged in and have friends i don’t understand that issue.

    please halp

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting