- foreach($r as $item) {
-
- $sparkle = '';
- $comment = '';
- $likebuttons = '';
-
- $template = $tpl;
-
- $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
-
- if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE)))
- && ($item['id'] != $item['parent']))
- continue;
-
- $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
- || strlen($item['deny_cid']) || strlen($item['deny_gid']))))
- ? '<div class="wall-item-lock"><img src="images/lock_icon.gif" class="lockview" alt="' . t('Private Message') . '" onclick="lockview(event,' . $item['id'] . ');" /></div>'
- : '<div class="wall-item-lock"></div>');
-
- if(can_write_wall($a,$a->profile['profile_uid'])) {
- if($item['id'] == $item['parent']) {
- $likebuttons = replace_macros($like_tpl,array('$id' => $item['id']));
- }
- if($item['last-child']) {
- $comment = replace_macros($cmnt_tpl,array(
- '$return_path' => $_SESSION['return_url'],
- '$type' => 'wall-comment',
- '$id' => $item['item_id'],
- '$parent' => $item['parent'],
- '$profile_uid' => $a->profile['profile_uid'],
- '$mylink' => $contact['url'],
- '$mytitle' => t('This is you'),
- '$myphoto' => $contact['thumb'],
- '$ww' => ''
- ));
- }
- }
-
-
- $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';
-
- $o .= 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
- ));
-
- }
- }