diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-16 02:12:03 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-16 02:12:03 +0000 |
commit | fcc68792fd00a2778746f6813efd0a5d879584d6 (patch) | |
tree | 177d2e48710e46aa1b922a0a12b17dd0d7e4f9f9 /views/default/widgets/friends/content.php | |
parent | 5922d93173db6353e3404c1c2a941842a9f166ed (diff) | |
download | elgg-fcc68792fd00a2778746f6813efd0a5d879584d6.tar.gz elgg-fcc68792fd00a2778746f6813efd0a5d879584d6.tar.bz2 |
moved friends widget into core
git-svn-id: http://code.elgg.org/elgg/trunk@7640 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/widgets/friends/content.php')
-rw-r--r-- | views/default/widgets/friends/content.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php new file mode 100644 index 000000000..2f9ab71ea --- /dev/null +++ b/views/default/widgets/friends/content.php @@ -0,0 +1,36 @@ +<?php + +/** + * Elgg Friends + * Friend widget display view + * + * @package ElggFriends + * @subpackage Core + */ + + +// owner of the profile page +$owner = get_user($vars['entity']->owner_guid); + +// the number of friends to display +$num = (int) $vars['entity']->num_display; + +// get the correct size +$size = $vars['entity']->icon_size; + +// Get the user's friends +$friends = $owner->getFriends("", $num); + +// If there are any friends to view, view them +if (is_array($friends) && sizeof($friends) > 0) { + + echo "<div id=\"widget_friends_list\">"; + + foreach($friends as $friend) { + echo "<div class=\"widget_friends_singlefriend\" >"; + echo elgg_view("profile/icon",array('entity' => get_user($friend->guid), 'size' => $size)); + echo "</div>"; + } + + echo "</div>"; +} |