Combine "mine" and "friend" into one river tab

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;
}
  • 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.

  • 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.

    rv.subject_guid != $user->guid AND rv.subject_guid NOT IN (SELECT ...)
  • I feel foolish. You're right! The above did the trick! Thank you again!