I've never tried it but you can:
$widget = elgg_extract('entity', $vars);
$count = sanitise_int($widget->num_display, false);
if ($count < 1) {
$count = 4;
}
$user = elgg_get_logged_in_user_entity();
$user_guid = elgg_get_logged_in_user_guid()
$friends = $user->getFriends(['limit' => 0]);
$friends_guids = array();
foreach ($friends as $friend) {
$friends_guids[] = $friend->guid;
}
$options = [
'type' => 'object',
'subtype' => 'blog',
'owner_guids' => [$user_guid, $friends_guids],
'limit' => $count,
'full_view' => false,
'pagination' => false,
];
$content = elgg_list_entities($options);
echo $content;
Thanks a lot RvR!
The solution worked almost like you suggested! The only change I have to do was:
$widget = elgg_extract('entity', $vars);
$count = sanitise_int($widget->num_display, false);
if ($count < 1) {
$count = 4;
}
$user = elgg_get_logged_in_user_entity();
$user_guid = elgg_get_logged_in_user_guid()
$friends = $user->getFriends(['limit' => 0]);
$friends_guids = array();
foreach ($friends as $friend) {
$friends_guids[] = $friend->guid;
}
// Changed, because when we do [$user_guid, $friends_guids] and you have more than one friend
// the structure was: [int, [int, int]], and should be [int, int, int]
$friends_guids[] = $user_guid;
$options = [
'type' => 'object',
'subtype' => 'blog',
'owner_guids' => $friends_guids,
'limit' => $count,
'full_view' => false,
'pagination' => false,
];
$content = elgg_list_entities($options);
echo $content;
Just for the record, this changed should be done in /mod/blog/views/default/widgets/blog/content.php. If anyone is interested in the rest of the code, it will be my pleasure to share it!
Thanks again!!!
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.