Robust Groups v0.2

Release Notes

Done:

  • Admin backended all new features
  • Added post count feature
  • Added post rank feature based on post counts
  • Added special upgrade action that will update all currently open groups with topics and posts for post counts and hot topics

The special upgrade searches for all currently open groups,topics and posts and reads through them all and updates users' post counts and topics hot topics if relevant. This should be done as a one off if your site already has groups and discussion topics before you enabled the post counts and hot topics.
Still to do:

  • Better index tabbed output allowing users to find groups based on different types of data
  • More functional control of forums such as sticky posts, (and maybe, just maybe more than one forum per group)
  • Searching through other group extender plugins to see how best to get them to integrate with RObust Groups.

Suggestions:
Yes please. I'm looking to develop more features for groups in general, as well as for the forum section specifically.

  • Sorry for the previous comments being removed due to a quick update. 

  • I have just tried this out, I love the concept!  I did find that if the plugin is above "Profile Manager" the tabs dissapear, so it may not be quite as robust as intended...

  • Just another little thing, in the Group Activity tab the text goes over the contributor's icon (which does not show correct image for some reason) I fixed the css with: #groups_box #groups_river p {margin-left:20px}

  • when I try to start a new thread created with "group discussion" and try to read the post I get the following error

    Parse error: syntax error, unexpected T_STRING in home/elg/mod/groups/views/default/forum/topicposts.php on line 66

    how can I fix this?

  • To fix the Profile Manager plugin order thing, I changed this plugins groupprofile.php by adding the Profile Manager code as follows:

    <div id="groups_box">
       
        <div id="groups_info">
        <?php
            if ($vars['full'] == true) {
                $group_fields = profile_manager_get_categorized_group_fields();
               
                if(count($group_fields["fields"]) > 0){
                    $group_fields = $group_fields["fields"];
                   
                    foreach($group_fields as $field) {
                        $metadata_name = $field->metadata_name;
                        $value = $vars['entity']->$metadata_name;
                        if($value){           
                            // make title
                            $title = $field->getTitle();
                           
                            // adjust output type
                            if($field->output_as_tags == "yes"){
                                $output_type = "tags";
                            } else {
                                $output_type = $field->metadata_type;
                            }
                           
                            if($field->metadata_type == "url"){
                                $target = "_blank";
                            } else {
                                $target = null;
                            }
                           
                            //This function controls the alternating class
                            $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even';
                           
                            echo "<p class=\"{$even_odd}\">";
                            echo "<b>" . $title . ": </b>";
                            echo elgg_view("output/" . $output_type, array('value' => $value, "target" => $target));
                            echo "</p>";
                        }
                    }
                }
            }
        ?>
        </div>

     

    It seems to work :)

  • I edited the file /mod/profile_manager/views/default/groups/groupprofile.php

    adding that but now that you put the message but when I read it gives me the same error

    Parse error: syntax error, unexpected T_STRING in home/ELG/mod/groups/views/default/forums/topicposts.php on line 66

  • When I try to view a Discussion Topic, I get a page without the template and many others views. As you can see in the picture below, there are problems with characters tooimage

    Picture: http://abavu.com/image.JPGimage

  • @avibook I edited the groupprofile.php in the groups plugin views, not the profile manager plugin. i.e. /mod/groups/views/default/groups/groupprofile.php

  • on line 66 it could be something like this that is wrong,I'm not a coder though

    content="_this" should be  content=\"this\"

    maybe that will help

  • Morning All:

    topicpost.php line 66 has the following problem:

    echo elgg_echo('groups:postcount:rank') . ": " . elgg_echo('groups:rank:squatter) . "<br>";

    change to

    echo elgg_echo('groups:postcount:rank') . ": " . elgg_echo('groups:rank:squatter') . "<br>";

    @Mark Bridges: version 0.2 will never work with every plugin available on elgg. Slowly but surely things will start to integrate. Thanks for the Profile Manager fix I will include it. 

  • BTW, line 64 is also missing the trailing ' from the second elgg_echo(). 

  • @Mark Bridges: I can't replicate the Activity tab issue. That coding is from the plugin group river and works fine on my install. Everyone styles their own river items so you may find it's due to your site's original styling. :) Are you on a version that is lower than 1.7.7?

  • @avibook sorry... I forgot to mention that as the Profile Manager code is now in the groups plugin, you can rename the Profile Manager version xgroupprofile.php so that there is no unnecessary duplication/conflict - may all be achademic now as new versions have been released :)

    @ Trajan - quite possibly... this is a problem with elgg, so many things get overridden by other things and the result is a bit of a mess sometimes :( Good work though, I like this plugin very much :)

  • @Mark: yep, I've had a look around but I haven't found an easy way of finding out what is being overridden in what order yet. I'm sure there is a built in core function for it somewhere. The update for this plugin now has a compatibility checker in admin settings that can tell site admins in what order they should place relevant plugins. Best I can do. 

  • That compatability checker thing sounds neat... should be standard on all plugins... I'll check it out.  Thanks!

  • What is this "Compatibility checker " in the PlugIn ?

  • n/m i found the code in C:\xampp\htdocs\Elgg0UTIL\______PLUGINS_TEST_2\_____PLUGINS_TEST_4\_robust-groups-trajan\groups\views\default\settings\groups\edit.php

    that checks against the plugins you know about (presumably tested with ) ->

                        if(($plugin == "profile_manager") && ($plugin[key] > $groups[key])){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:prof_manager:toolow') . "</div>";
                        }elseif(($plugin == "profile_manager") && ($plugin[key] < $groups[key])){
                        echo "<div id='admin_good'>" . elgg_echo('groups:admin:prof_manager:right') . "</div>";   
                        }elseif(($plugin == "group_multiple_admin") && ($plugin[key] < $groups[key])){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:group_multiple_admin:toolow') . "</div>";
                        }elseif((($plugin == "group_multiple_admin") && ($plugin[key] > $groups[key]))){
                        echo "<div id='admin_good'>" . elgg_echo('groups:admin:group_multiple_admin:right') . "</div>";   
                        }elseif(($plugin == "group_kick") && ($plugin[key] < $groups[key])){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:group_kick:toolow') . "</div>";
                        }elseif((($plugin == "group_kick") && ($plugin[key] > $groups[key]))){
                        echo "<div id='admin_good'>" . elgg_echo('groups:admin:group_kick:right') . "</div>";   
                        }elseif($plugin == "groupriver"){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:groupriver:already') . "</div>";

     

  • but pray do tell that

    ...&& ($plugin[key] ....

    is a typo ;-)

     

  • Yep, thats the right code. Just checks plugin list ordering of some plugins that work/override the groups plugin. Nothing special but quite useful for newbie elggsters.

  • what's wrong with using "$plugin[key]"?

  • the "key" is being used as a constant but has not been defined nor setup before

    $plugin is a one-dimensional array so - cannot have more than one associative element - only numerically indexed elements.

    in summary - the array reference will not work as intended.

    try a print_r ($plugins) ;

    to see what the array really looks like... i just did ;-)

     

  • Interesting. I'm not too familiar with different types of arrays, however the coding seems to do what it is expected to do. 

    The get_plugin_list() call creates an array of all plugins with the first element in the array being the highest placed plugin in the list. 

    print_r($plugins) outputs the following on my site:

    Array ( [10] => language_selector [20] => blog [30] => toolbar [40] => garbagecollector [50] => diagnostics [60] => profile [70] => messageboard [80] => search [90] => friends [100] => members [110] => embed [120] => groups [130] => thewire [140] => uservalidationbyemail [150] => logrotate [160] => invitefriends [170] => custom_index [180] => defaultwidgets [190] => logbrowser [200] => file [210] => twitterservice [220] => externalpages [230] => bookmarks [240] => htmlawed [250] => pages...

    I admit the keys are not 0,1,2,3,4,5... but the highest placed plugin has the lowest key while the lowest placed plugin has the highest key. Thus the above code works exactly as it is supposed to by evaluating the key in comparison to other plugin keys and acting accordingly. Might not be pretty, but works. ;-)

  • Try putting some PlugIns out of the order that you expect..

    Then see what happens ;-)

    That code cannot work ;)

    It will always "seem to work" as long as the PlugIns are in the correct order.

    You will always get the "<div id='admin_good'>"

    Do I gotta say "Trust me on this one..." ?

  • Try =>

     

    //------------------------------------------------------------------------------
            $plugins = get_plugin_list();
                if($plugins){
                    foreach($plugins as $plugin)
                    {
                        if($plugin == "groups")
                        {
                            $groups = $plugin;
                        }
                        echo "<h2>(",$plugin[key],")</h2>";//***********************************
                        if(($plugin == "profile_manager") && ($plugin[key] > $groups[key])){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:prof_manager:toolow') . "</div>";
                        }elseif(($plugin == "profile_manager") && ($plugin[key] < $groups[key])){
                        echo "<div id='admin_good'>" . elgg_echo('groups:admin:prof_manager:right') . "</div>";   
                        }elseif(($plugin == "group_multiple_admin") && ($plugin[key] < $groups[key])){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:group_multiple_admin:toolow') . "</div>";
                        }elseif((($plugin == "group_multiple_admin") && ($plugin[key] > $groups[key]))){
                        echo "<div id='admin_good'>" . elgg_echo('groups:admin:group_multiple_admin:right') . "</div>";   
                        }elseif(($plugin == "group_kick") && ($plugin[key] < $groups[key])){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:group_kick:toolow') . "</div>";
                        }elseif((($plugin == "group_kick") && ($plugin[key] > $groups[key]))){
                        echo "<div id='admin_good'>" . elgg_echo('groups:admin:group_kick:right') . "</div>";   
                        }elseif($plugin == "groupriver"){
                        echo "<div id='admin_error'>" . elgg_echo('groups:admin:groupriver:already') . "</div>";
                        }
                    }
                }
    //------------------------------------------------------------------------------

Trajan

Building the dream and living the life

Stats

  • Category: Tools
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 9424
  • Recommendations: 9

Other Projects

View Trajan's plugins