From: Michael Vogel Date: Thu, 20 Mar 2014 22:34:09 +0000 (+0100) Subject: Groups should now be fast (and accurate) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e1a41aff058dab1b6df230a9bde1c42e60b08034;p=friendica.git Groups should now be fast (and accurate) --- 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) {