blob: d00dc444331d7142e03ffc9ed85352358dcfddc0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<?php
// Latest forum discussion for the group home page
//check to make sure this group forum has been activated
if($vars['entity']->forum_enable != 'no'){
?>
<h3><?php echo elgg_echo('groups:latestdiscussion'); ?></h3>
<?php
$forum = elgg_get_entities_from_annotations(array('types' => 'object', 'subtypes' => 'groupforumtopic', 'annotation_names' => 'group_topic_post', 'container_guid' => $vars['entity']->guid, 'limit' => 4, 'order_by' => 'maxtime desc'));
if($forum){
foreach($forum as $f){
$count_annotations = $f->countAnnotations("group_topic_post");
echo "<div class='entity_listing clearfloat'>";
echo "<div class='entity_listing_icon'>" . elgg_view('profile/icon',array('entity' => $f->getOwnerEntity(), 'size' => 'tiny', 'override' => true)) . "</div>";
echo "<div class='entity_listing_info'><p class='entity_title'><a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$f->guid}&group_guid={$vars['entity']->guid}\">" . $f->title . "</a></p>";
echo "<p class='entity_subtext'>".elgg_echo('groups:posts').": " . $count_annotations . "</p></div>";
echo "</div>";
}
} else {
echo "<p class='margin_top'>".elgg_echo("grouptopic:notcreated")."</p>";
}
}//end of forum active check
?>
|