ewinslow/elgg-followers — Issue #10: Add support for following groups
Author: hypeJunction
Created: 2012-03-01 12:16:04+00:00
State: open

Add an ability for users to follow open groups without joining them. 'Following' in this case would imply that group activity shows up in the 'Following' tab of the user dashboard.

{{{
$options['joins'] = array("JOIN {$db_prefix}entity_relationships r on r.guid_two = rv.subject_guid
JOIN {$db_prefix}entities e1 on e1.guid = rv.object_guid
JOIN {$db_prefix}entity_relationships r1 on r1.guid_two = e1.container_guid
");
$options['wheres'] = array("(r.relationship = 'follower' AND r.guid_one = '$user_guid') OR (r1.relationship = 'follower' AND r1.guid_one = '$user_guid')");
}}}