diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/groups/all.php | 115 | ||||
-rw-r--r-- | mod/groups/views/default/group/default.php | 6 |
2 files changed, 62 insertions, 59 deletions
diff --git a/mod/groups/all.php b/mod/groups/all.php index 08bdd4a0a..909e02894 100644 --- a/mod/groups/all.php +++ b/mod/groups/all.php @@ -1,70 +1,73 @@ <?php - /** - * Elgg groups plugin - * - * @package ElggGroups - */ +/** + * Elgg groups plugin + * + * @package ElggGroups + */ +require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); +$limit = get_input("limit", 10); +$offset = get_input("offset", 0); +$filter = get_input("filter"); +if (!$filter) { + // active discussions is the default + $filter = "newest"; +} - $limit = get_input("limit", 10); - $offset = get_input("offset", 0); - $filter = get_input("filter"); - if (!$filter) { - // active discussions is the default - $filter = "newest"; - } +$context = elgg_get_context(); - $context = elgg_get_context(); +switch ($filter) { + case "newest": + $objects = elgg_list_entities(array( + 'type' => 'group', + 'limit' => $limit, + 'full_view' => false, + )); + break; - switch($filter){ - case "newest": - $objects = elgg_list_entities(array('types' => 'group', 'owner_guid' => 0, 'limit' => $limit, 'offset' => $offset, 'full_view' => false)); - break; + case "pop": + $objects = list_entities_by_relationship_count('member', true, "", "", 0, $limit, false); + break; - case "pop": - $objects = list_entities_by_relationship_count('member', true, "", "", 0, $limit, false); - break; + case "active": + case 'default': + $options = array( + 'type' => 'object', + 'subtype' => 'groupforumtopic', + 'annotation_name' => 'generic_comment', + 'order_by' => 'e.last_action desc', + 'limit' => 40, + 'fullview' => TRUE + ); + $objects = elgg_list_entities($options); + break; +} - case "active": - case 'default': - $options = array( - 'type' => 'object', - 'subtype' => 'groupforumtopic', - 'annotation_name' => 'generic_comment', - 'order_by' => 'e.last_action desc', - 'limit' => 40, - 'fullview' => TRUE - ); - $objects = elgg_list_entities($options); - break; - } +//get a group count +$group_count = elgg_get_entities(array('types' => 'group', 'limit' => 10, 'count' => TRUE)); - //get a group count - $group_count = elgg_get_entities(array('types' => 'group', 'limit' => 10, 'count' => TRUE)); +//find groups +$area2 .= elgg_view("groups/find"); - //find groups - $area2 .= elgg_view("groups/find"); +//featured groups +$featured_groups = elgg_get_entities_from_metadata(array('metadata_name' => 'featured_group', 'metadata_value' => 'yes', 'types' => 'group', 'limit' => 10)); +$area2 .= elgg_view("groups/featured", array("featured" => $featured_groups)); - //featured groups - $featured_groups = elgg_get_entities_from_metadata(array('metadata_name' => 'featured_group', 'metadata_value' => 'yes', 'types' => 'group', 'limit' => 10)); - $area2 .= elgg_view("groups/featured", array("featured" => $featured_groups)); +elgg_set_context($context); - elgg_set_context($context); +$objects = "<div class='group_listings'>" . $objects . "</div>"; - $objects = "<div class='group_listings'>".$objects."</div>"; +$title = elgg_echo("groups:all", array(elgg_get_page_owner()->name)); +if (isloggedin ()) { + $area1 .= elgg_view('page/elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "pg/groups/new")); +} +$area1 .= elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter)) . $objects; - $title = elgg_echo("groups:all", array(elgg_get_page_owner()->name)); - if(isloggedin()){ - $area1 .= elgg_view('page/elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "pg/groups/new")); - } - $area1 .= elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter)) . $objects; +$params = array( + 'content' => $area1, + 'sidebar' => $area2 +); +$body = elgg_view_layout('one_sidebar', $params); - $params = array( - 'content' => $area1, - 'sidebar' => $area2 - ); - $body = elgg_view_layout('one_column_with_sidebar', $params); - - // Finally draw the page - echo elgg_view_page($title, $body);
\ No newline at end of file +// Finally draw the page +echo elgg_view_page($title, $body);
\ No newline at end of file diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php index 3ba482d63..bc3710888 100644 --- a/mod/groups/views/default/group/default.php +++ b/mod/groups/views/default/group/default.php @@ -21,11 +21,11 @@ if ($membership == ACCESS_PUBLIC) { } // number of members -$num_members = '17 ' . elgg_echo('groups:member'); +$num_members = get_group_members($group->guid, 10, 0, 0, true); +$members_string = elgg_echo('groups:member'); $metadata = "<ul class=\"elgg-list-metadata\"><li>$mem</li>"; -$metadata .= "<li>$num_members</li>"; -//. " / <b>" . get_group_members($vars['entity']->guid, 10, 0, 0, true) ."</b> " . elgg_echo("groups:member"); +$metadata .= "<li>$num_members $members_string</li>"; // feature link if (isadminloggedin()) { |