diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-11-01 14:25:13 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-11-01 14:25:13 +0000 |
commit | afc1302be668997cc352c2ab58186300c15974c5 (patch) | |
tree | 39cbfc0ebe658a5fb5bc8e8606691b2d52b15527 /mod | |
parent | ef06e8e2bc4952edb47cca2563d84127153fe9d9 (diff) | |
download | elgg-afc1302be668997cc352c2ab58186300c15974c5.tar.gz elgg-afc1302be668997cc352c2ab58186300c15974c5.tar.bz2 |
Latest discussion fix
git-svn-id: https://code.elgg.org/elgg/trunk@2377 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/groups/discussions.php | 11 | ||||
-rw-r--r-- | mod/groups/views/default/object/groupforumtopic.php | 11 |
2 files changed, 9 insertions, 13 deletions
diff --git a/mod/groups/discussions.php b/mod/groups/discussions.php index c0734b4ff..3e171374e 100644 --- a/mod/groups/discussions.php +++ b/mod/groups/discussions.php @@ -15,15 +15,8 @@ // Load Elgg engine
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
- // Get the current page's owner
- $page_owner = page_owner_entity();
- if ($page_owner === false || is_null($page_owner)) {
- $page_owner = $_SESSION['user'];
- set_page_owner($_SESSION['guid']);
- }
-
// Display them
- $area2 = elgg_view_title(elgg_echo("groups:alldiscussion"));
+ $area2 = elgg_view_title(elgg_echo("groups:latestdiscussion"));
set_context('search');
$area2 .= list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 40, 0, 0, false, true);
set_context('groups');
@@ -31,7 +24,7 @@ $body = elgg_view_layout("two_column_left_sidebar", '', $area2);
// Display page
- page_draw(sprintf(elgg_echo('groups:user')),$body);
+ page_draw(elgg_echo('groups:latestdiscussion'),$body);
?>
\ No newline at end of file diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index 23afe00e0..949a1b8e2 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -14,9 +14,11 @@ $title = $vars['entity']->title; $description = autop($vars['entity']->description); $group = get_entity($vars['entity']->container_guid); - $forum_created = friendly_time($vars['entity']->time_created); + $forum_created = friendly_time($vars['entity']->time_created);
+ if (isloggedin()) { $counter = $vars['entity']->countAnnotations("group_topic_post"); - $last_post = $vars['entity']->getAnnotations("group_topic_post", 1, 0, "desc"); + $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; @@ -30,8 +32,9 @@ $info .= '</p>'; //get the group avatar $icon = elgg_view("profile/icon",array('entity' => $group, 'size' => 'small')); - //get the group and topic title - $info .= "<p>" . elgg_echo('group') . ": <a href=\"{$group->getURL()}\">{$group->name}</a></p>"; + //get the group and topic title
+ if ($group instanceof ElggGroup) + $info .= "<p>" . elgg_echo('group') . ": <a href=\"{$group->getURL()}\">{$group->name}</a></p>"; $info .= "<p>" . elgg_echo('topic') . ": <a href=\"{$vars['url']}mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$group->guid}\">{$title}</a></p>"; //get the forum description |