X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdisplay.php;h=f879a91aeca49ec4a135d7ed36e7d80520c148f1;hb=0c9cc29a51941eb572bf16fd5489d0947d47d033;hp=4ee26b7405ad48a3b9aebcd58e73cbdceae31d0c;hpb=7dc5fc8b9f3d2bb1a9dc8d743ee413778eb59a0e;p=friendica.git diff --git a/mod/display.php b/mod/display.php index 4ee26b7405..f879a91aec 100644 --- a/mod/display.php +++ b/mod/display.php @@ -362,18 +362,15 @@ function display_content(&$a, $update = 0) { return ''; } - $r = q("SELECT %s, %s FROM `item` - INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s - WHERE %s AND `item`.`uid` = %d + $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", - item_fieldlist(), contact_fieldlist(), - contact_condition(), item_condition(), intval($a->profile['uid']), 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` @@ -385,13 +382,9 @@ function display_content(&$a, $update = 0) { if($r) { $item_uri = $r[0]['uri']; - $r = q("SELECT %s, %s FROM `item` - INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND %s - WHERE %s AND `item`.`uid` = %d + $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 ", - item_fieldlist(), contact_fieldlist(), - contact_condition(), item_condition(), intval(local_user()), dbesc($item_uri), intval(local_user()) @@ -399,7 +392,6 @@ function display_content(&$a, $update = 0) { } } - if($r) { if((local_user()) && (local_user() == $a->profile['uid'])) {