From ca0c1bfd57ef7e57d198d2127a381e9688dd2273 Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 7 Aug 2008 16:44:39 +0000 Subject: changed the latest discussion view git-svn-id: https://code.elgg.org/elgg/trunk@1772 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/object/groupforumtopic.php | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index 597d5cec5..8aa3c9d0b 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -1,11 +1,11 @@ + * @author Curverider * @copyright Curverider Ltd 2008 * @link http://elgg.com/ */ @@ -14,23 +14,22 @@ $title = $vars['entity']->title; $description = autop($vars['entity']->description); $group = get_entity($vars['entity']->container_guid); - $num_topics = $vars['entity']->countEntitiesFromRelationship("forum_topic"); $forum_created = friendly_time($vars['entity']->time_created); - // get the topic entities - $entities = $vars['entity']->getEntitiesFromRelationship("forum_topic"); - $counter = 0; - foreach($entities as $ent){ - //count the post annotations for each topic - $counter = $ent->countAnnotations("topic_post"); - } - - $info = "

" . elgg_echo('created') . " " . $forum_created . ", " . elgg_echo('with') . " " . $num_topics . " " . elgg_echo('topics') . " " . elgg_echo('and') . " " . $counter . " " . elgg_echo('posts') . ".

"; + $counter = $vars['entity']->countAnnotations("group_topic_post"); + $last_post = $vars['entity']->getAnnotations("group_topic_post", 1, 0, "desc"); + //get the time and user + foreach($last_post as $last){ + $last_time = $last->time_created; + $last_user = $last->owner_guid; + } + + $info = "

" . elgg_echo('created') . " " . $forum_created . ", " . elgg_echo('with') . " " . $counter . " " . elgg_echo('posts') . "
last updated " . friendly_time($last_time) . "
by getURL() . "\">" . get_user($last_user)->username . "

"; //get the group avatar $icon = elgg_view("profile/icon",array('entity' => $group, 'size' => 'tiny')); //get the group and topic title $info .= "

" . elgg_echo('group') . ": getURL()}\">{$group->name}

"; - $info .= "

" . elgg_echo('groups:topic') . ": guid}&group_guid={$group->guid}\">{$title}

"; + $info .= "

" . elgg_echo('topic') . ": guid}&group_guid={$group->guid}\">{$title}

"; //get the forum description $info .= $description; -- cgit v1.2.3