WordPress.org

Ready to get started?Download WordPress

Forums

BP Show Friends
[resolved] Display Everywhere - Your Friends Only (9 posts)

  1. shoeyn
    Member
    Posted 3 years ago #

    Love this plugin, does it's job well, the best I've seen.
    But, is it possible for me to change the code so the widget displays on every page and it only displays that person's friends.
    I think I've changed it so it only display the logged in person's friends by changing $user_id = $bp->displayed_user->id; to $user_id = $bp->loggedin_user->id; but I can't figure out how to change it so it displays on every page. Any help would be great.

    http://wordpress.org/extend/plugins/bp-show-friends/

  2. imath
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks and happy you like this widget.

    You should test this in order to display the friends of the loggedin_user on every page :
    line 39, 87 and 111 : $user_id = $bp->loggedin_user->id;
    line 40 : $user_all_friends_url = $bp->loggedin_user->domain . BP_FRIENDS_SLUG;

    remove line 42 and 58
    remove line 135 and 151.

    It should work, and you actually built another widget ;)

  3. imath
    Member
    Plugin Author

    Posted 3 years ago #

    well actually, a user must be logged in, so instead of removing line 42, 58, 135 and 151, i think it would be best to edit line 42 this way :
    <?php if(is_user_logged_in()): ?>

    and line 135 this way
    if(is_user_logged_in()){

  4. shoeyn
    Member
    Posted 3 years ago #

    thanks for your replies, I shall test it out and report back after christmas :)

  5. James
    Member
    Posted 3 years ago #

    hi imath,

    thanks for great plugin, your corrections here are exactly what I needed, as shoeyn still celebrates christmas, I can confirm that your method works, at least at the moment see no any issue.

  6. imath
    Member
    Plugin Author

    Posted 3 years ago #

    Hi James,

    thank you for the feedback, i was afraid to wait for Sheyn till next year christmas ;)

  7. Bowe
    Member
    Posted 3 years ago #

    Works perfectly.. nice!

  8. imath
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Bowe ;)

    Just added a beta version of next version if you want to test it..

    Version 1.1, as you suggested on my blog, will add the widget on every page displaying the loggedin user's friends and when in BP member area, it will display the displayed member's friends.

  9. blitz999
    Member
    Posted 2 years ago #

    Hi there,

    Just to say that this plugin does not show as a widget in BP 1.5. It is not uncommon as I've tried a few widgets that fail to show on the Appearance/Widgets page. Something fairly fundamental seems to have changed in the way widgets are registered.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic