X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdisplay.php;h=02e838f55d42ee6cc817458ef450540c7a367237;hb=6a23f51549e6b476d494dce4131a24f8ebcdba43;hp=9ab25a96b4d2cd5ac74f678693cc661ef2879ca8;hpb=9ebb2c6527499c1a398491445700fa5651cb475e;p=friendica.git diff --git a/mod/display.php b/mod/display.php index 9ab25a96b4..02e838f55d 100644 --- a/mod/display.php +++ b/mod/display.php @@ -54,7 +54,7 @@ function display_init(App $a) $item = null; $item_user = local_user(); - $fields = ['id', 'parent', 'author-id', 'body', 'uid', 'guid']; + $fields = ['id', 'parent', 'author-id', 'body', 'uid', 'guid', 'gravity']; // If there is only one parameter, then check if this parameter could be a guid if ($a->argc == 2) { @@ -101,12 +101,12 @@ function display_init(App $a) } if (!empty($_SERVER['HTTP_ACCEPT']) && strstr($_SERVER['HTTP_ACCEPT'], 'application/atom+xml')) { - Logger::log('Directly serving XML for id '.$item["id"], Logger::DEBUG); - displayShowFeed($item["id"], false); + Logger::log('Directly serving XML for id '.$item['id'], Logger::DEBUG); + displayShowFeed($item['id'], false); } - if ($item["id"] != $item["parent"]) { - $parent = Item::selectFirstForUser($item_user, $fields, ['id' => $item["parent"]]); + if ($item['gravity'] != GRAVITY_PARENT) { + $parent = Item::selectFirstForUser($item_user, $fields, ['id' => $item['parent']]); $item = $parent ?: $item; } @@ -207,8 +207,8 @@ function display_content(App $a, $update = false, $update_uid = 0) $condition = ['guid' => $a->argv[1], 'uid' => local_user()]; $item = Item::selectFirstForUser(local_user(), $fields, $condition); if (DBA::isResult($item)) { - $item_id = $item["id"]; - $item_parent = $item["parent"]; + $item_id = $item['id']; + $item_parent = $item['parent']; $item_parent_uri = $item['parent-uri']; } } @@ -216,8 +216,8 @@ function display_content(App $a, $update = false, $update_uid = 0) if (($item_parent == 0) && remote_user()) { $item = Item::selectFirst($fields, ['guid' => $a->argv[1], 'private' => Item::PRIVATE, 'origin' => true]); if (DBA::isResult($item) && Contact::isFollower(remote_user(), $item['uid'])) { - $item_id = $item["id"]; - $item_parent = $item["parent"]; + $item_id = $item['id']; + $item_parent = $item['parent']; $item_parent_uri = $item['parent-uri']; } } @@ -226,8 +226,8 @@ function display_content(App $a, $update = false, $update_uid = 0) $condition = ['private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $a->argv[1], 'uid' => 0]; $item = Item::selectFirstForUser(local_user(), $fields, $condition); if (DBA::isResult($item)) { - $item_id = $item["id"]; - $item_parent = $item["parent"]; + $item_id = $item['id']; + $item_parent = $item['parent']; $item_parent_uri = $item['parent-uri']; } }