-
- foreach($r as $item) {
-
- $sparkle = '';
-
- if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
- $url = $item['url'];
- if(($item['network'] === 'dfrn') && (! $item['self'])) {
- $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
- $sparkle = ' class="sparkle" ';
- }
- if(! is_array($alike[$item['parent'] . '-l']))
- $alike[$item['parent'] . '-l'] = array();
- $alike[$item['parent']] ++;
- $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>';
- }
- if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
- $url = $item['url'];
- if(($item['network'] === 'dfrn') && (! $item['self'])) {
- $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
- $sparkle = ' class="sparkle" ';
- }
- if(! is_array($dlike[$item['parent'] . '-l']))
- $dlike[$item['parent'] . '-l'] = array();
- $dlike[$item['parent']] ++;
- $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '"'. $sparkle .'>' . $item['name'] . '</a>';
- }
- }
-
- foreach($r as $item) {
-
- $sparkle = '';
- $comment = '';
- $likebuttons = '';
-
- $template = $tpl;
-
- $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
-
- if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent']))
- continue;
-
- $lock = (($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 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.