]> git.mxchange.org Git - friendica.git/blobdiff - mod/network.php
Groups should now be fast (and accurate)
[friendica.git] / mod / network.php
index e10e7b78805e46b860a1791e1cf7a46913fd1a4e..fed6748777f0ec60805ec25c734cccaba5ea5062 100644 (file)
@@ -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 = '<h2>' . t('Group: ') . $r[0]['name'] . '</h2>' . $o;
        } elseif($cid) {