Hi all. I have custom_index plugin. I would like to change the "newest groups" in index to show the "poplar groups" (ie. most number in memberhip)
currently i have this in index.php to show newest group.
$groups = list_entities('group','',0,4,false, false, false);
-----------------------------------------------------
and i have this in new_index.php (inside my themes folders)
<?php
if(is_plugin_enabled('groups')){
?>
<!-- display latest groups -->
<div class="index_box">
<h2><?php echo elgg_echo("custom:groups"); ?></h2>
<?php
if (!empty($vars['area5'])) {
echo $vars['area5'];//this will display groups
}else{
echo "<p><?php echo elgg_echo('custom:nogroups'); ?>.</p>";
}
?>
</div>
How would I show 5 groups with the most number in memberships. Thanks for your time.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- kaitlyn91@kaitlyn91
kaitlyn91 - 0 likes
- n_l1@n_l1
n_l1 - 0 likes
You must log in to post replies.I think that would be
$groups = list_entities_by_relationship_count('member', true, "", "", 0, 5, false,false,false);
Kevin thank you. That works perfect. Thanks.
Hi,
I have something very similar (and very simple I suppose, but still I don't know how to do it), I want to display pg/groups/world/?filter=active in custom_index. I am using 1.7.1, how do I have to change the code?
Thanks!