X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdisplay.php;h=f879a91aeca49ec4a135d7ed36e7d80520c148f1;hb=f09cd571655bfd9966dd4529d4fb10256246a81c;hp=949ba5ab46d8d3f8b3bacf19d07513ede5e193bf;hpb=a25d58b2ee785175b12fe9b1a6dcca7095dfd124;p=friendica.git diff --git a/mod/display.php b/mod/display.php index 949ba5ab46..f879a91aec 100644 --- a/mod/display.php +++ b/mod/display.php @@ -362,14 +362,7 @@ function display_content(&$a, $update = 0) { return ''; } - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - AND NOT `contact`.`blocked` AND NOT `contact`.`pending` - WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` - AND NOT `item`.`moderated` + $r = q(item_query()." AND `item`.`uid` = %d AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `id` = %d) $sql_extra ORDER BY `parent` DESC, `gravity` ASC, `id` ASC", @@ -377,6 +370,7 @@ function display_content(&$a, $update = 0) { intval($item_id) ); + if(!$r && local_user()) { // Check if this is another person's link to a post that we have $r = q("SELECT `item`.uri FROM `item` @@ -388,14 +382,7 @@ function display_content(&$a, $update = 0) { if($r) { $item_uri = $r[0]['uri']; - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`, - `contact`.`network`, `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` - FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - AND NOT `contact`.`blocked` AND NOT `contact`.`pending` - WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted` - AND NOT `item`.`moderated` + $r = q(item_query()." AND `item`.`uid` = %d AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `uri` = '%s' AND uid = %d) ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ", intval(local_user()), @@ -405,7 +392,6 @@ function display_content(&$a, $update = 0) { } } - if($r) { if((local_user()) && (local_user() == $a->profile['uid'])) {