X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FContent%2FItem.php;h=172729f2689faca7ad91fe8fc89b26e2962277e8;hb=ff80e46eb05554417d5fdef9ff5b14df1f10eb4a;hp=0a606e057a39b2c26f994114be90b9d6cf3eef61;hpb=a20cb0fe98a534636ad64e311df67d8a5166eb34;p=friendica.git diff --git a/src/Content/Item.php b/src/Content/Item.php index 0a606e057a..172729f268 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -96,32 +96,33 @@ class Item } /** - * Return array with details for categories and folders for an item + * Lists categories and folders for an item * * @param array $item * @param int $uid - * @return [array, array] - * + * @return array * [ - * [ // categories array - * { - * 'name': 'category name', - * 'removeurl': 'url to remove this category', - * 'first': 'is the first in this array? true/false', - * 'last': 'is the last in this array? true/false', - * } , - * .... - * ], - * [ //folders array - * { - * 'name': 'folder name', - * 'removeurl': 'url to remove this folder', - * 'first': 'is the first in this array? true/false', - * 'last': 'is the last in this array? true/false', - * } , - * .... - * ] - * ] + * [ // categories array + * { + * 'name': 'category name', + * 'removeurl': 'url to remove this category', + * 'first': 'is the first in this array? true/false', + * 'last': 'is the last in this array? true/false', + * }, + * ... + * ], + * [ //folders array + * { + * 'name': 'folder name', + * 'removeurl': 'url to remove this folder', + * 'first': 'is the first in this array? true/false', + * 'last': 'is the last in this array? true/false', + * } , + * ... + * ] + * ] + * + * @throws \Exception */ public function determineCategoriesTerms(array $item, int $uid = 0): array { @@ -135,9 +136,9 @@ class Item return [$categories, $folders]; } - foreach (Post\Category::getArrayByURIId($item['uri-id'], $uid, Post\Category::CATEGORY) as $savedFolderName) { + foreach (Post\Category::getArrayByURIId($item['uri-id'], $uid) as $savedFolderName) { if (!empty($item['author-link'])) { - $url = $item['author-link'] . "?category=" . rawurlencode($savedFolderName); + $url = $item['author-link'] . '/conversations?category=' . rawurlencode($savedFolderName); } else { $url = '#'; } @@ -338,7 +339,7 @@ class Item } else { $post_type = $this->l10n->t('status'); } - // Let's break everthing ... ;-) + // Let's break everything ... ;-) break; } $plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]'; @@ -377,7 +378,11 @@ class Item 'url' => $item['author-link'], ]; $profile_link = Contact::magicLinkByContact($author, $item['author-link']); - $sparkle = (strpos($profile_link, 'contact/redir/') === 0); + if (strpos($profile_link, 'contact/redir/') === 0) { + $status_link = $profile_link . '?' . http_build_query(['url' => $item['author-link'] . '/status']); + $photos_link = $profile_link . '?' . http_build_query(['url' => $item['author-link'] . '/photos']); + $profile_link = $profile_link . '?' . http_build_query(['url' => $item['author-link'] . '/profile']); + } $cid = 0; $pcid = $item['author-id']; @@ -391,12 +396,6 @@ class Item $rel = $contact['rel']; } - if ($sparkle) { - $status_link = $profile_link . '/status'; - $photos_link = $profile_link . '/photos'; - $profile_link = $profile_link . '/profile'; - } - if (!empty($pcid)) { $contact_url = 'contact/' . $pcid; $posts_link = $contact_url . '/posts';