diff --git a/mod/network.php b/mod/network.php index e10e7b7880..fed6748777 100644 --- a/mod/network.php +++ b/mod/network.php @@ -531,9 +531,10 @@ die("ss"); info( t('Group is empty')); } - $sql_post_table = " INNER JOIN (SELECT DISTINCT(`parent`) FROM `item` WHERE (`contact-id` IN ($contact_str) OR `allow_gid` like '".protect_sprintf('%<'.intval($group).'>%')."') and deleted = 0 ORDER BY `created` DESC) AS `temp1` ON $sql_table.$sql_parent = `temp1`.`parent` "; + //$sql_post_table = " INNER JOIN (SELECT DISTINCT(`parent`) FROM `item` WHERE (`contact-id` IN ($contact_str) OR `allow_gid` like '".protect_sprintf('%<'.intval($group).'>%')."') and deleted = 0 ORDER BY `created` DESC) AS `temp1` ON $sql_table.$sql_parent = `temp1`.`parent` "; - $sql_extra3 .= " AND `contact-id` IN ($contact_str.$contact_str_self) "; + $sql_extra3 .= " AND `contact-id` IN ($contact_str$contact_str_self) "; + $sql_extra3 .= " AND EXISTS (SELECT id FROM `item` WHERE (`contact-id` IN ($contact_str) OR `allow_gid` like '".protect_sprintf('%<'.intval($group).'>%')."') and deleted = 0 AND parent = $sql_table.$sql_parent) "; $o = '

' . t('Group: ') . $r[0]['name'] . '

' . $o; } elseif($cid) {