]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
more tweaks to likes on the activity stream
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 21 Mar 2010 16:53:01 +0000 (16:53 +0000)
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 21 Mar 2010 16:53:01 +0000 (16:53 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5460 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/riverdashboard/views/default/river/item/wrapper.php
views/default/likes/forms/edit.php

index bbbc27051cb84a17f7474902eaf93461ab350929..ab0f7a9a22ec89d9a0ec449af7312458a616a5a2 100644 (file)
@@ -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
        
 <!-- display comments and likes -->
 <?php
-       //show the number of users who liked an item
-       if($likes){
-               echo "<div class='river_comments'>";
-               echo "<div class='river_comment latest clearfloat'>";
-               if($likes == 1)
-                       echo $likes . " user liked this.";
-               else
-                       echo $likes . " users liked this.";
-               echo "</div></div>";
-       }
+       //likes
+       echo "<div class='river_comments'>";
+       echo "<div class='river_comment latest clearfloat'>";
+       echo elgg_view_likes($object);
+       echo "</div></div>";
        //display latest 2 comments if there are any
        if($get_comments){
                $counter = 0;
index 4a9bbb7d7453d10c3a3f562a6586fbb9afd7920f..10bb7aada5bf36efb135136b2e5aa81e61b9346c 100644 (file)
@@ -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 "<a href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a>";              
+               echo "<a href=\"{$url}\">" . elgg_echo('likes:likethis') . "</a><br />";                
        //display the number of likes
        $numoflikes = elgg_count_likes($vars['entity']);
        if($numoflikes != 0){
                if($numoflikes == 1)
-                       echo "<br /><a onclick=\" $('#showLikes').show('slow');\">" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userlikedthis') . "</a>";
+                       echo "<a onclick=\" $('#showLikes').show('slow');\">" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userlikedthis') . "</a>";
                else
-                       echo "<br /><a onclick=\" $('#showLikes').show('slow');\">" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userslikethis') . "</a>";
+                       echo "<a onclick=\" $('#showLikes').show('slow');\">" . elgg_count_likes($vars['entity']) . " " . elgg_echo('likes:userslikethis') . "</a>";
        }
        //show the users who liked the object
        echo "<div id=\"showLikes\" style=\"display:none;\">";
-       echo list_annotations($vars['entity']->getGUID(),'likes');
+       echo list_annotations($vars['entity']->getGUID(),'likes',99);
        echo "</div>";
 }
\ No newline at end of file