+
+
+ $profile_url = $item['url'];
+
+ // This is my profile but I'm not the author of this post/comment. If it's somebody that's a fan or mutual friend,
+ // I can go directly to their profile as an authenticated guest.
+
+ if(local_user() && ($item['contact-uid'] == $_SESSION['uid'])
+ && ($item['rel'] == DIRECTION_IN || $item['rel'] == DIRECTION_BOTH) && (! $item['self'] ))
+ $profile_url = $redirect_url;
+
+ // FIXME tryng to solve the mishmash of profile photos.
+
+ // $photo = (($item['self']) ? $a->profile['photo'] : $item['photo']);
+ // $thumb = (($item['self']) ? $a->profile['thumb'] : $item['thumb']);
+
+
+ // We received this post via a remote feed. It's either a wall-to-wall or a remote comment. The author is
+ // known to us and is reflected in the contact-id for this item. We can use the contact url or redirect rather than
+ // use the link in the feed. This is different than on the network page where we may not know the author.
+
+ $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
+ $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']);
+ $profile_link = $profile_url;
+
+ $drop = '';
+
+ if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == $_SESSION['uid']))
+ $drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id']));
+
+
+
+
+ $o .= replace_macros($template,array(
+ '$id' => $item['item_id'],
+ '$profile_url' => $profile_link,
+ '$name' => $profile_name,
+ '$thumb' => $profile_avatar,
+ '$title' => $item['title'],
+ '$body' => bbcode($item['body']),
+ '$ago' => relative_date($item['created']),
+ '$location' => (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : ''),
+ '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
+ '$drop' => $drop,
+ '$comment' => $comment
+ ));
+