X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fconversation.php;h=21b700f2fe0e42de4f0c9477ecd12b462454b8a1;hb=e0ecbd0b95454ed2ff4b0082b41d388d2938e3ae;hp=5ce02a55f698e3bd25b7a3ebfc1fdb9c5d5cce82;hpb=675a6adf356689c9e504c4a65eacd073aad421eb;p=friendica.git diff --git a/include/conversation.php b/include/conversation.php index 5ce02a55f6..21b700f2fe 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -349,7 +349,10 @@ function localize_item(&$item) // add sparkle links to appropriate permalinks $author = ['uid' => 0, 'id' => $item['author-id'], 'network' => $item['author-network'], 'url' => $item['author-link']]; - $item['plink'] = Contact::magicLinkbyContact($author, $item['plink']); + + if (!empty($item['plink'])) { + $item['plink'] = Contact::magicLinkbyContact($author, $item['plink']); + } } /** @@ -402,7 +405,7 @@ function visible_activity($item) { * that are based on unique features of the calling module. * */ -function conversation(App $a, $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) { +function conversation(App $a, array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) { require_once 'mod/proxy.php'; $ssl_state = ((local_user()) ? true : false); @@ -482,7 +485,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order = $profile_owner = $a->profile['uid']; if (!$update) { $live_update_div = '
' . "\r\n" - . ""; } } elseif ($mode === 'community') { @@ -631,8 +634,8 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order = $tmp_item = [ 'template' => $tpl, - 'id' => (($preview) ? 'P0' : $item['item_id']), - 'guid' => (($preview) ? 'Q0' : $item['guid']), + 'id' => ($preview ? 'P0' : $item['id']), + 'guid' => ($preview ? 'Q0' : $item['guid']), 'network' => $item['network'], 'network_name' => ContactSelector::networkToName($item['network'], $profile_link), 'linktitle' => L10n::t('View %s\'s profile @ %s', $profile_name, $item['author-link']), @@ -679,7 +682,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order = $arr = ['item' => $item, 'output' => $tmp_item]; Addon::callHooks('display_item', $arr); - $threads[$threadsid]['id'] = $item['item_id']; + $threads[$threadsid]['id'] = $item['id']; $threads[$threadsid]['network'] = $item['network']; $threads[$threadsid]['items'] = [$arr['output']]; @@ -765,7 +768,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order = * * @return array items with parents and comments */ -function conversation_add_children($parents, $block_authors, $order, $uid) { +function conversation_add_children(array $parents, $block_authors, $order, $uid) { $max_comments = Config::get('system', 'max_comments', 100); $params = ['order' => ['uid', 'commented' => true]];