From 417d1080d4495ea52469f5292d7bac00f1953eca Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Nov 2012 00:30:40 -0800 Subject: likes working a bit better - not translateable yet --- include/conversation.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/conversation.php') diff --git a/include/conversation.php b/include/conversation.php index 532fe0ba1..f763bb0b9 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -89,15 +89,17 @@ function localize_item(&$item){ $item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']); $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">"; +/* if (activity_match($item['verb'],ACTIVITY_LIKE) || activity_match($item['verb'],ACTIVITY_DISLIKE)){ +// FIXME we shouldn't have a DB lookup on every item $r = q("SELECT * from `item`,`contact` WHERE `item`.`contact-id`=`contact`.`id` AND `item`.`uri`='%s';", dbesc($item['parent_uri'])); if(count($r)==0) return; $obj=$r[0]; - $author = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; + $author = '[url=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/url]'; $objauthor = '[url=' . $obj['author-link'] . ']' . $obj['author-name'] . '[/url]'; switch($obj['verb']){ @@ -131,6 +133,7 @@ function localize_item(&$item){ $item['body'] = sprintf($bodyverb, $author, $objauthor, $plink); } +*/ if (activity_match($item['verb'],ACTIVITY_FRIEND)) { if ($item['obj_type']=="" || $item['obj_type']!== ACTIVITY_OBJ_PERSON) return; @@ -1599,7 +1602,7 @@ function like_puller($a,$item,&$arr,$mode) { $verb = (($mode === 'like') ? ACTIVITY_LIKE : ACTIVITY_DISLIKE); if((activity_match($item['verb'],$verb)) && ($item['id'] != $item['parent'])) { - $url = $item['author-link']; + $url = $item['author']['xchan_url']; if((local_user()) && (local_user() == $item['uid']) && ($item['network'] === 'dfrn') && (! $item['self']) && (link_compare($item['author-link'],$item['url']))) { $url = $a->get_baseurl(true) . '/redir/' . $item['contact-id']; $sparkle = ' class="sparkle" '; @@ -1616,7 +1619,7 @@ function like_puller($a,$item,&$arr,$mode) { $arr[$item['thr_parent']] = 1; else $arr[$item['thr_parent']] ++; - $arr[$item['thr_parent'] . '-l'][] = '' . $item['author-name'] . ''; + $arr[$item['thr_parent'] . '-l'][] = '' . $item['author']['xchan_name'] . ''; } return; }} -- cgit v1.2.3