1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<?php
/**
* Group profile widget - this displays a users groups on their profile
**/
//the number of groups to display
$number = (int) $vars['entity']->num_display;
if (!$number)
$number = 4;
//the page owner
$owner = $vars['entity']->owner_guid;
//$groups = get_users_membership($owner);
//$groups = list_entities_from_relationship('member',$owner,false,'group','',0,$number,false,false,false);
$groups = get_entities_from_relationship('member', $owner, false, "group", "", 0, "", $number, 0, false, 0);
if($groups){
echo "<div class=\"groupmembershipwidget\">";
foreach($groups as $group){
$icon = elgg_view(
"groups/icon", array(
'entity' => $group,
'size' => 'small',
)
);
echo "<div class=\"contentWrapper\">" . $icon . " <div class='search_listing_info'><p><span>" . $group->name . "</span><br />";
echo $group->briefdescription . "</p></div><div class=\"clearfloat\"></div></div>";
}
echo "</div>";
}
// echo $groups;
?>
|