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.
Thanks but I don't think that will work either because it will grab people that are also logged_in_users. Those same people are my friends. I don't want friends. I want everyone but friends.
I don't know what that means. Who are the logged_in_users? Your code runs in a single session, so there is only one logged in user. That user has friends and everyone who is not a friend. It's binary, so using NOT IN does what I think you want to get done. If you also need to include current user, just do it with additional query.
I feel foolish. You're right! The above did the trick! Thank you again!
- Previous
- 1
- 2
- 3
- Next
You must log in to post replies.