Groupextended (with further instruction) v2.5

Release Notes

This is my first contribution to the Elgg community, please be gentle! 

All credit for this plugin belongs to its creator, Diego Andrés Ramírez Aragón. Be sure to support him by visiting http://www.somosmas.org/ - He's a great guy who creates amazing Elgg plugins! Groupextended is an extremely useful plugin and has become a very important tool for many people who run Elgg!

 

 

ABOUT THIS PLUGIN:

The release of this plugin addition is only for the purpose of better explanation on how to add different types of "group types". Many people have had quite a bit of trouble understanding how to set up "handlers", deal with "functions", etc. etc. As I tell exactly step-by-step instructions, hopefully you get the answer you're looking for with this release! 

 

A TREAT TO MAKE LIFE EASIER:

As this plugin is being released mainly to give further instruction on how to add more group types, I have taken the liberty of inserting all of the information that I discussed in "INST_README.txt" within the plugin itself, this way you can replace your old "groupextended" plugin and see the immediate change of the added type "Corporation"(used only for the sake of example), that is displayed right under "Network", "Organization", and "Group".

"Corporation" can be renamed to whatever you'd like, or even deleted if you change your mind entirely. I've tested it within Elgg 1.5 ONLY.

 

 

WHERE TO LOOK:

For the instructions, take a look at the file "INST_README.txt". I've tried to explain (atleast to my own understanding) the process of how to add new group types.

 

WHAT HAS BEEN ADDED TO THE PLUGIN (covered in instructions):

 

  • "corporation.php"
  • Added text/code in the "language" file.
  • Added text/code in "start.php"
  • Renamed the original "README.txt" to "Original_README.txt"
  • The instruction file "INST_README.txt"
Remember to be sure and backup your original "groupextended" plugin. I do not want to provide guaranteed support for this addition of the groupextended plugin, however please let me know if there are any problems downloading the Zip file (was made via Mac's "Stuffit", which has been known to cause problems sometimes with Zip files).

 

  • Thank you,, A much needed documentation!!!

  • Thanks @cinema123. I will add those improvements in the next elgg version.

  • Hello,

    I've made a small modification of this plugin, which allows to display separatelly members of a group and groups as members.

    You have to do 2 things.

    1. Replace file /mod/groupextended/views/default/groups/members.php with this:

    <?php
    /**
     * Elgg groupextended members view
     *
     * Just make the default icon size bigger
     *
     * @package ElggGroupExtended
     * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
     * @author Diego Andrés Ramírez Aragón <diego@somosmas.org>
     * @copyright Corporación Somos más - 2008
     * @link http://www.somosmas.org
     */
         
         //var_export($vars['entity']);
    ?>

    <div id="group_members">

    <?php

        if(get_plugin_setting("invitegroups","groupextended")=="yes"){
          $members = get_entities_from_relationship('member', $vars['entity']->getGUID(), true, '', '', 0, "", 100);
        }
        else{
          $members = $vars['entity']->getMembers(100);
        }
        $users = "";
        $groups = "";
        foreach($members as $mem){
              
            if ($mem->type == 'user')
                $users .= "<div class=\"member_icon\">" . elgg_view("profile/icon",array('entity' => $mem, 'size' => 'tiny')) . "</div>";  
            else
                $groups .= "<div class=\"member_icon\">" . elgg_view("groups/icon",array('entity' => $mem, 'size' => 'tiny')) . "</div>";  
       
        }
        echo '<h2>' . elgg_echo("groups:members") . '</h2>';
        echo $users;
        echo '<br class="clearfloat" />';
        echo '<h2>' . elgg_echo("groupextended:friendlygroups") . '</h2>';
        if ($groups) {
            echo $groups;
            echo '<br class="clearfloat" />';
        }
        else {
            echo '<p class="contentWrapper">' . elgg_echo("groupextended:friendlygroups:notfound") . '</p>';
            echo '<br class="clearfloat" />';
        }
    ?>

    </div>

     

    2. Next step is to add to your language files (placed in /mod/groupextended/languages/ directory) two lines and translate them:

    'groupextended:friendlygroups:notfound' => "Friendly groups"
    'groupextended:friendlygroups:notfound' => "Not found",

     

    That's all :)

  • A little bug :)
    Step 2 should be:

    'groupextended:friendlygroups' => "Friendly groups"
    'groupextended:friendlygroups:notfound' => "Not found",

  • @eMKa, thanks for posting your modification! I apologize but I don't think I understand what your modification actually does - I realize that you briefly described what it does but would you mind explaining a little further and why I would want to use this modification? Thanks!

  • Hi cinema123,

    If You turn on (in plugin settings) groups as members (aka subgroups), You can invite groups to be a member of a group. In sidebar menu (group details view) You can see group members. There are all together peoples and groups. My small modification adds a separate view for displaying group members, peoples and groups.

    Example

    That's all

    Sorry for my english :)

  • All seems to work except step two?  I put it in the en.php file.  tried adding a "," to line two.  but either way I get this error message?

    Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/harcha24/archaicradio.com/recording_community/mod/groupextended/languages/en.php on line 28

    any help would be good help  : )

  • @H

    Post lines 20 - 35 here .. must be a simple php syntax typo thingy..

  • Here's the whole original file

    Mod/groupextended/languages/en.php

    _________________________________________________________________________________

    <?php
    /**
    *
    * @author Diego Andrés Ramírez Aragón <diego@somosmas.org>
    * @copyright Corporación Somos más - 2008
    */

    $english = array(
      'groups:group_type'=>"Group type",
      'groupextended:type:network'=>"Band",
      'groupextended:type:organization'=>"Song",
      'groupextended:type:group'=>"Programs",
      'networks:all'=>"All Networks and groups",
      'organizations:all'=>"All Organizations",

      'groupextended:members:admin' => 'Members management',
      'groupextended:remove' => 'Remove from group',
      'groupextended:left'=> "%s' left '%s'",
      'groupextended:cantleave'=> "'%s' can't leave '%s'",
      'groupextended:group:cantjoin'=> "A group can't request membership to another group!",

      'groupextended:invitegroups'=>'Allow group as group members?',
      'groupextended:squareicon'=>"Crop group icon to an square?",
      'groupextended:invite:groups'=>'Invite groups',
      'groupextended:invite:subject' => "%s has been invited to join %s!",
      'groupextended:invite:body' => "Hi %s,

    Your group '%s' has been invited to join the '%s' group, click below to confirm:

    %s",

    );

    add_translation("en",$english);

    ?>

  • is it possible that the script provided by emka above is the problem? it looks like I might be the first to have tested it?

  • Droped the plugin to the bottom and it fixed it... lol. get so caught up in thinking I don't know I over look the obvious

  • Hi all,

    I have installed this and have a problem - this is the erroe:

    Form is missing __token or __ts fields

    Can some one advise or help as I need to have subGroups on my site.

    Thanks

  • I get the same error when trying to select a group type under edit group

  • me too, with elgg 1.7. Anyone has fixed this? :(

  • Same here... with elgg 1.7.3 :(

  • I have managed to fix this issue (Elgg 1.7.4 here) by following this tutorial. In short: for each code looking like

    <form ... method="post">

    add immediately below it this correspond line of PHP code:

    <?php echo elgg_view('input/securitytoken'); ?>

    Files changed:

    views/default/forms/groups/membersadmin.php
    views/default/forms/groups/invitegroups.php
    views/default/forms/groups/invitefriends.php
    views/default/forms/groups/edit.php
    

    The whole issue is put in perspective here and here.

  • Another change (using groupextended v2.5, elgg 1.7.4):

    views/default/groups/grouplisting.php

    From:

    $url = $vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=unfeature";
    

    To:

    $url = elgg_add_action_tokens_to_url($vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=unfeature");
    

    And from:

    $url = $vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=feature";
    

    To:

    $url = elgg_add_action_tokens_to_url($vars['url'] . "action/groups/featured?group_guid=" . $vars['entity']->guid . "&action=feature");
    

    Worthy to say that plugin groupextended must be set above plugin groups.

Stats

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