X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fdisplay.php;h=e9d1bbbb1483013bd34d600de1a6204ab1da2ef3;hb=c2086ec50ed339fb864c8f0a93fbc40ff530c666;hp=84176d293423d94e783d24d86eb6599676db274c;hpb=a8e4ec7801b5ca8c986febed1f95124b412e92f9;p=friendica.git diff --git a/mod/display.php b/mod/display.php index 84176d2934..e9d1bbbb14 100644 --- a/mod/display.php +++ b/mod/display.php @@ -3,6 +3,8 @@ function display_content(&$a) { + $o = '
' . "\r\n"; + require_once('mod/profile.php'); profile_init($a); @@ -100,6 +102,7 @@ function display_content(&$a) { ); + $cmnt_tpl = load_view_file('view/comment_item.tpl'); $like_tpl = load_view_file('view/like.tpl'); $tpl = load_view_file('view/wall_item.tpl'); @@ -112,41 +115,31 @@ function display_content(&$a) { if(count($r)) { - 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'][] = '' . $item['name'] . ''; - } - 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'][] = '' . $item['name'] . ''; - } + if((local_user()) && (local_user() == $a->profile['uid'])) { + q("UPDATE `item` SET `unseen` = 0 + WHERE `parent` = %d AND `unseen` = 1", + intval($r[0]['parent']) + ); } - + foreach($r as $item) { + like_puller($a,$item,$alike,'like'); + like_puller($a,$item,$dlike,'dislike'); + } foreach($r as $item) { - $comment = ''; + $template = $tpl; + + $comment = ''; + $owner_url = ''; + $owner_photo = ''; + $owner_name = ''; $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) + if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) + && ($item['id'] != $item['parent'])) continue; $lock = (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) @@ -222,13 +215,14 @@ function display_content(&$a) { $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); $profile_link = $profile_url; - if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == local_user())) + if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'])); else $drop = replace_macros(load_view_file('view/wall_fake_drop.tpl'), array('$id' => $item['id'])); - $like = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); - $dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$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']) ? '' . $item['location'] . '' : ''); $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); if($coord) {