enhanced friends plugin v1.0

Release Notes

A rather simple enhancement of the friends mod.

 

When no friends are displayed by the widget, user - if he is the owner of the profile - is presented with the friends search form. In case invitefriends plugin is installed, a link to invite friends is used as well. Form has a simple validation implemented.

 

Install:

simply copy over your 'friends' mod (yourElggDirectory/mod/friends).  You may also want to style the error message. To do so, put this into your css:

#messageFriendSearch{
    font-size: 0.8em;
    color: #E1552E;
}

  • i installed it and it created a one big mess all over my site...

  • Did you copy it over mod/friends plugin?

    If this is the case, please describe what mess did it create, and I'll try to help.

  • i cant see the difference...or a friends search form hmm

  • It worked for me. Excellent!

  • Kosmic, the search form is displayed only when you have no friends and you are watching your own profile.  Some functionality tests I've done showed that it's more intuitive for people to update their profile straight from the profile window.

    In case anyone is interrested, I have a similar plugins for groups and tidypics.

  • Someone asked me how to modify the group widget to work in the same way. You have to paste a proper code at the end of the file:

    \mod\groups\views\default\widgets\a_users_groups\view.php

    The code to paste:

      if (strlen($groups) == 0){
                $owner = get_user($vars['entity']->owner_guid);
                if ($owner && ($owner->canWriteToContainer($_SESSION['user']))){
                    echo '<form action="'.$CONFIG->url .'search/">
                            <input type="hidden" name="object" id="object" value="group">
                               <table style="width:100%;"><tr><td style="vertical-align:middle;">
                                <input type="text" name="tag" id="tagGroups">
                            </td><td style="vertical-align:middle;">
                                <input type="submit" value="'.elgg_echo("search").'">
                               </td></tr></table>                           
                          </form>';
                    echo '<p class="pages_add"><a class="pages_add" href="'.$CONFIG->url .'pg/groups/world/">'.elgg_echo("groups:all").'</a></p>';
               }
               else{
                   echo '<p class="pages_add">'.elgg_echo("groups:notsubscribed").'</p>';
               }
        }

    You'll have to add a proper translation to the language file too, and may want to add a proper styling to CSS. This works for Elgg 1.2, but I suppose it should also for 1.5

  • how to show friends name under their icon ??

  • You have to go to icon.php, and place the

    $vars['entity']->username

    or

    $vars['entity']->name

    in a proper place. Making it display right could be quite tricky though. Also, it would be hard to read the letters, since they would be very small.

     

  • it is not showing any form in friend section even though there no friend in my list

  • The friend search displays on the admin side but not the user profile or dashboard side. Please help ASAP.

Mike Zacher (vazco)

I'm an Elgg expert and CEO of vazco.eu - the first plugin store for Elgg. We focus on development of highly scalable and highly customized Elgg websites.

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 1487
  • Recommendations: 1

Other Projects

View Mike Zacher (vazco)'s plugins