Friends Plugin

I’ve added to my mu, the friends plugin but there is a problem, an users that already have friends, can do an other request to begin friends and so his blog is showed two times in friends list. the plugin don do any check ?

  • simos
    • WPMU DEV Initiate

    sorry for my bad english, i hope you have understand … i think is needed a check that if primary blog of the user have already one blog in wp_friends, the link to add to the friensslist is not showed, i’ve try to make a check but i’m not a php programmer and so without any result.

  • trent
    • Site Builder, Child of Zeus

    With the recent release of WPMU 1.3.2 would you recommend that we do something like the following after line 26 of /wp-admin/menu.php

    $menu[45] = array(__('Friends'), 'read', 'friends.php?page=friends_main' );

    The way they changed menu.php doesn’t work the same as with the older version of menu.php

    Thoughts? Or just don’t worry about it since you mentioned that you will be developing another friends plugin later?

    Trent

  • Andrew
    • Champion of Loops

    Hi Trent,

    That’s about as good a fix as any for the time being. We had been holding off on developing a new friends plugin due to BuddyPress but now that BuddyPress is practically dead in the water there’s a good chance we’ll start on a new plugin sometime in February. No guarantees at this point though. February is going to be a busy month for us.

    Thanks,

    Andrew

  • simos
    • WPMU DEV Initiate

    I’ve solved by this way :

    added to friends.php this function :

    function already_friends() {

    global $wpdb, $wp_roles, $current_user;

    $query = "SELECT DISTINCT friend_blog_ID FROM wp_friends WHERE blog_ID = '" . $wpdb->blogid . "'";

    $friends_list = $wpdb->get_results( $query, ARRAY_A );

    $visitor = get_usermeta($current_user->ID, 'primary_blog');

    if (in_array($visitor, $friends_list[0])) {

    return true;

    } else {

    return false;

    }

    }

    modified wiedget_friends.php output:

    <?php echo $before_widget; ?>

    <?php echo $before_title . "Amici" . $after_title; ?>

    <?php

    echo "
    ";

    echo "

      ";

      friends_list_widget_output();

      echo "

    ";

    if (is_user_logged_in() == true){

    //echo "
    ";

    $tmp_url = get_blog_details(get_usermeta($current_user->ID, 'primary_blog'));

    if ($wpdb->blogid == get_usermeta($current_user->ID, 'primary_blog') || already_friends ()) {

    //echo "
    ";

    // don't display link

    echo "<p>Already in friends list</p>";

    } else {

    echo $after_widget;

    echo $before_widget;

    echo "

    ";

    }

    ?>

    now if an user is already friend don’t see friends request link.

  • jcnjr
    • HummingBird

    Wasn’t sure whether I should resurrect this old post or start a new one, so here goes …

    I just downloaded and am testing the latest version (1.1.3) of the Friends plugin. It seems to be working fine, but I noticed the folowing issues:

    1. The plugin code itself reads "Plugin Name: Report Posts Comments". That should be an easy fix! :wink:

    2. There is no action for messaging friends in the Friends admin. Can I assume this just requires the Messaging plugin to be installed? The install instructions do not indicate that it is required.

    3. There is no link for adding a user as a friend in the widget. And yes, I logged in as a different user who is not a friend and visited the blog with the widget enabled, yet no friending link was visible.

    4. FYI: Install instructions do not mention how to enable friend approval, which I discovered in the plugin Config section.

    Thanks for any input!

  • drmike
    • DEV MAN’s Mascot

    I believe the Messaging plugin is required. I seem to remember a previous thread on that topic.

    edit: I for one would have have old threads brought back instead of newer ones created. 1) Shows that you searched and 2) have the information in front of everybody. But that’s just me. I hate forums with rules like "If it’s more than a month old, start a new thread."

  • Andrew
    • Champion of Loops

    Hiya,

    1. The plugin code itself reads "Plugin Name: Report Posts Comments". That should be an easy fix! :wink:

    Already fixed locally. We’re not going to issue an update just for that though :wink:

    There is no action for messaging friends in the Friends admin. Can I assume this just requires the Messaging plugin to be installed? The install instructions do not indicate that it is required.

    There’s nothing in the install instructions because it’s not required for the friends plugin to function. If you want the messaging features though, you’ll need to install the messaging plugin.

    3. There is no link for adding a user as a friend in the widget. And yes, I logged in as a different user who is not a friend and visited the blog with the widget enabled, yet no friending link was visible.

    We’ll look into that for a future version. We need to rebuild the widget using the new widget API anyway.

    4. FYI: Install instructions do not mention how to enable friend approval, which I discovered in the plugin Config section.

    Oops, looks like the note about the config section got removed (or was never added).

    Thanks,

    Andrew

  • jcnjr
    • HummingBird

    We’ll look into that for a future version. We need to rebuild the widget using the new widget API anyway.

    Since you may be also updating Friends to comply with update notifications, sometime in the not too distant future anyway… here’s a thought:

    How ’bout adding an option for Admins to identify “default” Friend(s)?

    We often get users adding the Friends widget before learning how to add friends. This leaves them with an empty widget. It would be cool if the widget could included a member identified by the Admin, by default, upon activation.

    Perhaps this could be done with a configuration edit to the plugin code. One friend would be nice, but in our case I see how adding multiple default friends could help – our primary blog admin, and our tech support blogger.

    Make sense? Doable, or pain in the arse?

    EDIT: The tricky part may be not adding the default friend if the user has already been added as a friend on existing blogs. But then again, the friend check fix that started this topic may address that. Thanks for the consdieration!

  • Andrew
    • Champion of Loops

    Hiya,

    Since you may be also updating Friends to comply with update notifications, sometime in the not too distant future anyway… here’s a thought

    People seem to be throwing that around a lot lately. We have *a lot* of plugins to update with the update notifications bit. So I’m afraid we won’t be making any changes to plugins aside from the updates notifications addition unless the plugin is already on our “fix list” due to reported bugs, etc.

    As for the default friends suggestion. It’s definitely doable if a good number of members are interested :slight_smile:

    Thanks,

    Andrew

  • kingdomtools
    • Design Lord, Child of Thor

    i just installed Friends, messaging, but avatar page cannot be found (all say they need to be installed together)

    Also, in the Friends install folder there is no:

    friends-framework.php

    widget_friends.php

    as referred to in the install instructions. Am I missing something?

  • jcnjr
    • HummingBird

    Have you installed the Avatars plugin? Friends isn’t much without it. I’m still running v.1.1.3 but just confirmed that the 1.1.4 zip does not include the widget or framework files.

    Perhaps this is another one that was rewritten for 3.1 and released early?

  • okso
    • WPMU DEV Initiate

    Just arrived on WPMU, the 1st thing I do is instal Friends (Release Date: 2012-05-10 Downloads: 1,110 Compatible With: Multisite 3.4.2

    Changelog:slight_smile: and realize it doesn’t play nice with Buddypress 1.6. I then search forum and find here 1yr old note about plugs redundancy in BP.

    Should a basic notification to this show up in changelog/docs?

    *So I don’t do this again with more plugs, can you give any tips for me to look out for this kind of issue?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.