How would I have to modify the following code so that it only displays the frinds activity in the riverdashboard instead of showing the "all, friend, mine" tabbed navigation menu. ANy help with this matter is greatly appreciated!
Cheers,
David
$owner = page_owner_entity();
//get the type - mine or friends
$type = $vars['entity']->content_type;
if(!$type)
$type = "mine";
//based on type grab the correct content type
if($type == "mine")
$content_type = '';
else
$content_type = 'friend';
//get the number of items to display
$limit = $vars['entity']->num_display;
if(!$limit)
$limit = 4;
//grab the river
$river = elgg_view_river_items($owner->getGuid(), 0, $content_type, $content[0], $content[1], '', $limit,0,0,false);
//display
echo "<div class=\"contentWrapper\">";
if($type != 'mine')
echo "<div class='content_area_user_title'><h2>" . elgg_echo("friends") . "</h2></div>";
echo $river;
echo "</div>";
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.
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Ciaphas@ciaphas
Ciaphas - 0 likes
You must log in to post replies.This is the function being called..
Pay attention to the "$subject_relationship" parameter..
```````````````````````````````````````````````````````````````````````````
function elgg_view_river_items($subject_guid = 0, $object_guid = 0, $subject_relationship = '',
$type = '', $subtype = '', $action_type = '', $limit = 20, $posted_min = 0, $posted_max = 0, $pagination = true) {
// Get input from outside world and sanitise it
$offset = (int) get_input('offset',0);
// Get river items, if they exist
if ($riveritems = get_river_items($subject_guid,$object_guid,$subject_relationship,$type,$subtype,$action_type,($limit + 1),$offset,$posted_min,$posted_max)) {
return elgg_view('river/item/list',array(
'limit' => $limit,
'offset' => $offset,
'items' => $riveritems,
'pagination' => $pagination
));
}
return '';
}
```````````````````````````````````````````````````````````````````````````
The $subject_relationship is categorizing the posts based on if they belong to the profile owner, friends or everyone in general regardless of friend status, correct?
The $subject_relationship I want to see posted is "friend" only.
I'm very dense when it comes to code stuffs.