From 538a22b85384008533aeef2ac356ff668766e0cb Mon Sep 17 00:00:00 2001 From: pete Date: Wed, 7 Apr 2010 14:10:51 +0000 Subject: Riverdashboard refreshed, and updated display of comments and likes (the loading of these needs to be moved to ajax callbacks) git-svn-id: http://code.elgg.org/elgg/trunk@5643 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/river/item/wrapper.php | 99 +++++++++++++--------- 1 file changed, 61 insertions(+), 38 deletions(-) (limited to 'mod/riverdashboard/views/default/river') diff --git a/mod/riverdashboard/views/default/river/item/wrapper.php b/mod/riverdashboard/views/default/river/item/wrapper.php index 0dba70e5c..dba6f9953 100644 --- a/mod/riverdashboard/views/default/river/item/wrapper.php +++ b/mod/riverdashboard/views/default/river/item/wrapper.php @@ -8,6 +8,8 @@ $object = get_entity($vars['item']->object_guid); //get object url $object_url = $object->getURL(); +$numoflikes = elgg_count_likes($object); + //user //if displaying on the profile get the object owner, else the subject_guid if(get_context() == 'profile' && $object->getSubtype() == 'thewire') @@ -29,7 +31,7 @@ switch($vars['item']->subtype){ //count comment annotations $comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, $annotation_comment); -//get last two comments display +//get last three comments display $get_comments = get_annotations($vars['item']->object_guid, "", "", $annotation_comment, "", "", 3, 0, "desc"); if($get_comments){ @@ -37,7 +39,7 @@ if($get_comments){ $get_comments = array_reverse($get_comments); } -//minus two off the comment total as we display two by default +//minus 3 off the comment total as we display 3 by default if($comment_count < 3) $num_comments = 0; else @@ -48,32 +50,40 @@ else $user, 'size' => 'small')); ?>
- - -
+ -"; - echo "
"; - echo elgg_view_likes($object); - echo "
"; - //display latest 2 comments if there are any + //display latest 3 comments if there are any if($get_comments){ $counter = 0; - $background = ""; - echo "
"; + //$background = ""; - //display the number of comments if there are any - if($num_comments != 0){ - //set the correct context comment or comments - if($num_comments == 1) - echo "+{$num_comments} more comment"; - else - echo "+{$num_comments} more comments"; + echo "
"; + + if($comment_count <= 3) { + echo "Comments"; + } + + //display 'more comments' if there are any + if($num_comments != 0){ + echo "Comments (+{$num_comments} more)"; } - + + if($numoflikes != 0){ + echo elgg_view('likes/forms/display', array('entity' => $object)); + } + echo "
"; // close river_comments_tabs + + echo "
"; + + if($numoflikes != 0){ + //show the users who liked the object + echo ""; + } + foreach($get_comments as $gc){ //get the comment owner $comment_owner = get_user($gc->owner_guid); @@ -92,7 +102,7 @@ else echo ""; //truncate comment to 150 characters if(strlen($gc->value) > 150) { - $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "..."; + $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "…"; } $contents = strip_tags($gc->value); echo "
"; @@ -101,20 +111,33 @@ else echo "
"; $counter++; } + echo elgg_make_river_comment($object); + echo "
"; // close river_comments + } else { + // tab bar nav - for users that liked object + echo "
"; + $numoflikes = elgg_count_likes($object); + if($numoflikes != 0){ + echo elgg_view('likes/forms/display', array('entity' => $object)); + } + echo "
"; // close river_comments_tabs + + echo "
"; + + if($numoflikes != 0){ + //show the users who liked the object + echo ""; } - //display the comment link - if($vars['item']->type != 'user'){ - //for now don't display the comment link on wire and conversations for now - if($vars['item']->subtype != 'thewire' && $vars['item']->subtype != 'conversations' && $vars['item']->subtype != '') - //don't display the comment option on group discussions atm - if($vars['item']->subtype == 'groupforumtopic'){ - echo "Visit discussion"; - }else{ - echo "
"; - echo elgg_make_river_comment($object); - echo "
"; - } - } - ?> + + // if there are no comments to display + // and this is not a user or a group discussion entry - include the inline comment form + if($vars['item']->type != 'user' && $vars['item']->subtype != 'groupforumtopic') { + echo elgg_make_river_comment($object); + } + echo "
"; + } +echo ""; // close river_item_contents +?> \ No newline at end of file -- cgit v1.2.3