X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcommunity.php;h=06a96c7403f54ff933efa10c8cbaa1d3406a6830;hb=71f9e500141f6c8787a4a648b4aa57448da2097f;hp=d6f87762bdefefda35ecdb15ec387c7711a439a9;hpb=58ac6bde098ce2b28d851767b5aaf7d9095d6a44;p=friendica.git diff --git a/mod/community.php b/mod/community.php index d6f87762bd..06a96c7403 100644 --- a/mod/community.php +++ b/mod/community.php @@ -14,6 +14,10 @@ function community_content(&$a, $update = 0) { $o = ''; + // Currently the community page isn't able to handle update requests + if ($update) + return; + if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { notice( t('Public access denied.') . EOL); return; @@ -116,23 +120,18 @@ function community_getitems($start, $itemspage) { if (get_config('system','community_page_style') == CP_GLOBAL_COMMUNITY) return(community_getpublicitems($start, $itemspage)); - $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`alias`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`, - `user`.`nickname`, `user`.`hidewall` + $r = q("SELECT %s FROM `thread` FORCE INDEX (`wall_private_received`) - INNER JOIN `user` ON `user`.`uid` = `thread`.`uid` AND `user`.`hidewall` = 0 + INNER JOIN `user` ON `user`.`uid` = `thread`.`uid` AND NOT `user`.`hidewall` INNER JOIN `item` ON `item`.`id` = `thread`.`iid` AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' - INNER JOIN `contact` ON `contact`.`id` = `thread`.`contact-id` - AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`self` - WHERE `thread`.`visible` = 1 AND `thread`.`deleted` = 0 and `thread`.`moderated` = 0 - AND `thread`.`private` = 0 AND `thread`.`wall` = 1 - ORDER BY `thread`.`received` DESC LIMIT %d, %d ", - intval($start), - intval($itemspage) + %s AND `contact`.`self` + WHERE `thread`.`visible` AND NOT `thread`.`deleted` AND NOT `thread`.`moderated` + AND NOT `thread`.`private` AND `thread`.`wall` + ORDER BY `thread`.`received` DESC LIMIT %d, %d", + item_fieldlists(), item_joins(), + intval($start), intval($itemspage) ); return($r); @@ -140,17 +139,15 @@ function community_getitems($start, $itemspage) { } function community_getpublicitems($start, $itemspage) { - $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`, - `author-name` AS `name`, `owner-avatar` AS `photo`, - `owner-link` AS `url`, `owner-avatar` AS `thumb` - FROM `item` WHERE `item`.`uid` = 0 AND `item`.`id` = `item`.`parent` - AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' - AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' - ORDER BY `item`.`received` DESC LIMIT %d, %d", - intval($start), - intval($itemspage) + + $r = q("SELECT %s + FROM `thread` + INNER JOIN `item` ON `item`.`id` = `thread`.`iid` %s + WHERE `thread`.`uid` = 0 + ORDER BY `thread`.`created` DESC LIMIT %d, %d", + item_fieldlists(), item_joins(), + intval($start), intval($itemspage) ); return($r); - }