diff options
Diffstat (limited to 'mod')
| -rw-r--r-- | mod/groups/languages/en.php | 1 | ||||
| -rw-r--r-- | mod/groups/views/default/groups/forum_latest.php | 28 | 
2 files changed, 19 insertions, 10 deletions
| diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 05ee07965..0b9f579ba 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -53,6 +53,7 @@  			'groups:forum' => 'Group forum',
  			'groups:addtopic' => 'Add a topic',
 +			'groups:forumlatest' => 'Forum latest',
  			'groups:edittopic' => 'Edit topic',
  			'groups:topicmessage' => 'Topic message',
  			'groups:topicstatus' => 'Topic status',
 diff --git a/mod/groups/views/default/groups/forum_latest.php b/mod/groups/views/default/groups/forum_latest.php index f0a62a14f..dc2857f12 100644 --- a/mod/groups/views/default/groups/forum_latest.php +++ b/mod/groups/views/default/groups/forum_latest.php @@ -1,14 +1,22 @@ -<h2>Forum latest</h2>
 +<h2><?php echo elgg_echo("groups:forumlatest"); ?></h2>
  <?php
 -//get the latest from the group files
 -// Display them
 -	   // list_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "", $value = "", $limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true) {
 -		
 -		set_context('search');
 -	   // $forum_topics = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 5, 0, 3, false, true);
 -	    set_context('forums');
 -	    
 -	    echo $forum_topics;
 +    $forum = get_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 0, $vars['entity']->guid, 4, 0, "asc", false);
 +	
 +    if($forum){
 +        foreach($forum as $f){
 +        	    
 +                $count_annotations = $f->countAnnotations("group_topic_post");
 +                 
 +        	    echo "<div class=\"forum_latest\">";
 +    	        echo "<div class=\"topic_title\"><p>" . $f->title . " (Replies: " . $count_annotations . ")</p></div>";
 +    	        echo "<div class=\"topic_owner_icon\">" . elgg_view('profile/icon',array('entity' => $f->getOwnerEntity(), 'size' => 'tiny')) . "</div>";	
 +    	        echo "</div>";
 +    	        
 +        }
 +    }else{
 +        
 +        echo elgg_echo("grouptopic:notcreated");
 +    }
  ?>
\ No newline at end of file | 
