* @link http://elgg.com/
*
* @uses $vars['entity']
*/
if (isset($vars['entity']) && isloggedin()) {
$guid = $vars['entity']->getGuid();
$url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}");
//check to see if the user has already liked
if(!elgg_already_created_annotation($guid, 'likes'))
echo "" . elgg_echo('likes:likethis') . "
";
//display the number of likes
$numoflikes = elgg_count_likes($vars['entity']);
if($numoflikes != 0){
if($numoflikes == 1)
echo "" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userlikedthis') . "";
else
echo "" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userslikethis') . "";
}
//show the users who liked the object
echo "