+
+
+ $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['network'] === 'dfrn') && (! $item['self'] )) {
+ $profile_url = $redirect_url;
+ $sparkle = ' sparkle';
+ }
+ else
+ $sparkle = '';
+
+ // We would prefer to use our own avatar link for this item because the one in the author-avatar might reference a
+ // remote site (which could be down). We will use author-avatar if we haven't got something stored locally.
+ // We use this same logic block in mod/network.php to determine it this is a third party post and we don't have any
+ // local contact info at all. In this module you should never encounter a third-party author, but we still will do
+ // the right thing if you ever do.
+
+ $diff_author = (($item['url'] !== $item['author-link']) ? true : false);
+
+ $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
+ $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']);
+
+ $profile_link = $profile_url;
+
+ $drop = '';
+ $dropping = false;
+
+ if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user()))
+ $dropping = true;
+
+ $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id']));
+
+
+ $like = ((isset($alike[$item['id']])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
+ $dislike = ((isset($dlike[$item['id']])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
+ $location = (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : '');
+ $coord = (($item['coord']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['coord']) . '">' . $item['coord'] . '</a>' : '');
+ if($coord) {
+ if($location)
+ $location .= '<br /><span class="smalltext">(' . $coord . ')</span>';
+ else
+ $location = '<span class="smalltext">' . $coord . '</span>';
+ }
+
+ $indent = (($item['parent'] != $item['item_id']) ? ' comment' : '');
+
+ if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
+ $indent .= ' shiny';
+
+ $tmp_item = replace_macros($template,array(
+ '$id' => $item['item_id'],
+ '$profile_url' => $profile_link,
+ '$name' => $profile_name,
+ '$thumb' => $profile_avatar,
+ '$sparkle' => $sparkle,
+ '$title' => $item['title'],
+ '$body' => smilies(bbcode($item['body'])),
+ '$ago' => relative_date($item['created']),
+ '$lock' => $lock,
+ '$location' => $location,
+ '$indent' => $indent,
+ '$drop' => $drop,
+ '$like' => $like,
+ '$vote' => $likebuttons,
+ '$dislike' => $dislike,
+ '$comment' => $comment
+ ));
+
+ $arr = array('item' => $item, 'output' => $tmp_item);
+ call_hooks('display_item', $arr);
+
+ $o .= $arr['output'];
+