X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Flike.php;h=966fe500b255aaed69db82c231c9555f43acbb4e;hb=020deefba613327a1d8875ba7f2cf9a750be42dd;hp=7b20975781452166f942c333b65abf9b28f520ea;hpb=f649692c25a6846f645383b256026b24d4dde970;p=friendica.git diff --git a/mod/like.php b/mod/like.php index 7b20975781..966fe500b2 100644 --- a/mod/like.php +++ b/mod/like.php @@ -101,9 +101,7 @@ function like_content(&$a) { intval($r[0]['id']) ); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", - array(),$foo)); + proc_run('php',"include/notifier.php","like","$post_id"); return; } @@ -126,9 +124,9 @@ function like_content(&$a) { EOT; if($verb === 'like') - $bodyverb = t('likes'); + $bodyverb = t('%1$s likes %2$s\'s %3$s'); if($verb === 'dislike') - $bodyverb = t('doesn\'t like'); + $bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s'); if(! isset($bodyverb)) return; @@ -149,9 +147,11 @@ EOT; $arr['author-name'] = $contact['name']; $arr['author-link'] = $contact['url']; $arr['author-avatar'] = $contact['thumb']; - $arr['body'] = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' . ' ' . $bodyverb . ' ' - . '[url=' . $item['author-link'] . ']' . $item['author-name'] . t('\'s') . '[/url]' . ' ' - . '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]' ; + + $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; + $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; + $plink = '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; + $arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink ); $arr['verb'] = $activity; $arr['object-type'] = $objtype; @@ -173,11 +173,11 @@ EOT; ); } + $arr['id'] = $post_id; - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); + call_hooks('post_local_end', $arr); - proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" &", - array(),$foo)); + proc_run('php',"include/notifier.php","like","$post_id"); return; // NOTREACHED } \ No newline at end of file