I'm trying to figure out how to combine "mine" and "friends" into one river tab. This is what I got so far but it isn't working. Any suggestions?
pages/river.php
switch ($page_type) {
case 'mine':
$title = elgg_echo('river:mine');
$page_filter = 'mine';
$options['subject_guid'] = elgg_get_logged_in_user_guid();
break;
case 'friends':
$title = elgg_echo('river:friends');
$page_filter = 'friends';
$options['relationship_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
case 'combined':
$title = elgg_echo('river:mine');
$page_filter = 'combined';
$options['relationship_guid' . 'subject_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
default:
$title = elgg_echo('river:all');
$page_filter = 'all';
break;
}
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.
I don't see how that's supposed to work. You can't just change an array key, it will be ignored by elgg_get_river(), because such key is not supported.
You need to add a custom join and where clauses, because by default the function generates AND statements, you need OR.
Yeah you are right I have no idea what I'm doing. Where are the other array keys supported?
Inline docs are pretty thorough
How much do you think it would cost me to have someone customize my river to include both mine and friends? Maybe I should take this thread to professional services?
I'm kinda lost any help out there? Would this be a big or small job?
@Ismayil thanks for posting the query. I also tried to come up with a solution but got stuck (not even close to the solution to be honest).
@Ismayil Khayredinov Seriously thank you so much! that worked perfectly!
@Ismayil Khayredinov I may have spoke too soon. Now I'm having styling issues. I think its because I'm calling the echo inside of a page_filter. Here's the whole page. Also, how much would you charge to help me with this issue? Are you on UpWork?
@Ismayil Khayredinov, I am using another code to extract only the "Group" activity. How can I club my code with yours so that I can have "Mine"+"Friends"+"Groups Activity" in one go.
My Code:
- Previous
- 1
- 2
- 3
- Next
You must log in to post replies.