any solution for this?

I found an interesting article related to this post:

http://community.elgg.org/pg/forum/topic/784253/comments-only-for-friends/

all good Until You try to reply to a comment from a friend, and surprise, I ironically as owner of the post I can not comment ... wrong ...

there is a plugin, derivate of this, called "socialprivacy" but does not solve the problem ... experts who have the solution?

  • Hi,

    Well, I totally forgot about this plugin. Anyways, I test this old one and you're right, owner can't comment. Never noticed that. 

    In esence you would like only friends to comment. I'll see if I can upgrade this to 1.8.x

     

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • thanks rjcalifornia, 

    I think I found the solution for (Elgg 1.7.x),

    in case anyone needs it, or if you want to add to the plugin!

    /views/default/comments/forms/edit.php

    $owner = get_user($vars['entity']->owner_guid);

    $user = page_owner_entity(); // by me

    if (isset($vars['entity']) && isloggedin() && $owner->isFriendsWith(get_loggedin_userid()) || isadminloggedin() || $user->guid == get_loggedin_userid()) {

    ... comment form ...

    }

     

  • Great solution! I came up with this solution last night:

     

    $owner = get_user($vars['entity']->owner_guid);

    $user = $_SESSION['user']->username; 

    if (  $owner->username == $user || $owner->isFriendsWith(elgg_get_logged_in_user_guid()))

    {

    ... comment form ...
          }
    See it for elgg 1.8 here:

     

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • Rj:instead of relying on session variables use,

    $owner = get_user($vars['entity']->owner_guid);

    $logged_in_guid = elgg_get_logged_in_user_guid();

    if ( $owner->guid == $logged_in_guid || $owner->isFriendsWith($logged_in_guid)){

    ... comment form ...

    }