From 0216846f9dca29f883161bfd4de54162813c7691 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 21 Mar 2010 16:53:01 +0000 Subject: more tweaks to likes on the activity stream git-svn-id: http://code.elgg.org/elgg/trunk@5460 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/river/item/wrapper.php | 18 +++++------------- views/default/likes/forms/edit.php | 8 ++++---- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/mod/riverdashboard/views/default/river/item/wrapper.php b/mod/riverdashboard/views/default/river/item/wrapper.php index bbbc27051..ab0f7a9a2 100644 --- a/mod/riverdashboard/views/default/river/item/wrapper.php +++ b/mod/riverdashboard/views/default/river/item/wrapper.php @@ -29,9 +29,6 @@ switch($vars['item']->subtype){ //count comment annotations $comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, $annotation_comment); -//count like annotations -$likes = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, "likes"); - //get last two comments display $get_comments = get_annotations($vars['item']->object_guid, "", "", $annotation_comment, "", "", 3, 0, "desc"); @@ -57,16 +54,11 @@ else "; - echo "
"; - if($likes == 1) - echo $likes . " user liked this."; - else - echo $likes . " users liked this."; - echo "
"; - } + //likes + echo "
"; + echo "
"; + echo elgg_view_likes($object); + echo "
"; //display latest 2 comments if there are any if($get_comments){ $counter = 0; diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php index 4a9bbb7d7..10bb7aada 100644 --- a/views/default/likes/forms/edit.php +++ b/views/default/likes/forms/edit.php @@ -14,17 +14,17 @@ if (isset($vars['entity']) && isloggedin()) { $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') . ""; + 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') . ""; + echo "" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userlikedthis') . ""; else - echo "
" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userslikethis') . ""; + echo "" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userslikethis') . ""; } //show the users who liked the object echo "
"; - echo list_annotations($vars['entity']->getGUID(),'likes'); + echo list_annotations($vars['entity']->getGUID(),'likes',99); echo "
"; } \ No newline at end of file -- cgit v1.2.3