]> git.mxchange.org Git - friendica.git/blobdiff - mod/display.php
Merge pull request #2711 from rabuzarus/0408-frio-photo-tpl-fix
[friendica.git] / mod / display.php
index 949ba5ab46d8d3f8b3bacf19d07513ede5e193bf..f879a91aeca49ec4a135d7ed36e7d80520c148f1 100644 (file)
@@ -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'])) {