aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/activity.php
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-19 16:31:35 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-06-19 16:31:35 +0000
commit856dc92ef07c9fe06339349224533a12898b31d7 (patch)
tree4e1a665848a8339a0c37cab948edab259f338d5f /mod/groups/activity.php
parent47e359de2e11aac5c89039fbac11c1c871d3baed (diff)
downloadelgg-856dc92ef07c9fe06339349224533a12898b31d7.tar.gz
elgg-856dc92ef07c9fe06339349224533a12898b31d7.tar.bz2
There was no point in group discussions having their own comment annotations, better to use the generic comments so this has been changed and a full group activity stream added. For v1.8, there will need to be an upgrade script which will change 'group_topic_post' -> 'generic_comment' and on all existing topics, take the first annotation of type 'group_topic_post' and populate the topic's description.
git-svn-id: http://code.elgg.org/elgg/trunk@6526 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/activity.php')
-rw-r--r--mod/groups/activity.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/mod/groups/activity.php b/mod/groups/activity.php
new file mode 100644
index 000000000..18a97265b
--- /dev/null
+++ b/mod/groups/activity.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Elgg group activity
+ */
+
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+$group_guid = (int)get_input('group');
+set_page_owner($group_guid);
+if (!(page_owner_entity() instanceof ElggGroup)) {
+ forward();
+}
+group_gatekeeper();
+
+global $CONFIG;
+
+// set up breadcrumbs
+$group = get_entity($group_guid);
+elgg_push_breadcrumb(elgg_echo('groups'), $CONFIG->wwwroot."pg/groups/world/");
+elgg_push_breadcrumb($group->name, $group->getURL());
+elgg_push_breadcrumb(elgg_echo('groups:activity'));
+
+$area1 = elgg_view('navigation/breadcrumbs');
+
+$limit = get_input("limit", 20);
+$offset = get_input("offset", 0);
+$group_guid = get_input("group", 7);
+// Sanitise variables -- future proof in case they get sourced elsewhere
+$limit = (int) $limit;
+$offset = (int) $offset;
+$group_guid = (int) $group_guid;
+
+$entities = elgg_get_entities(array(
+ 'container_guids' => $group_guid,
+ 'group_by' => 'e.guid'
+));
+
+$entity_guids = array();
+foreach ($entities as $entity) {
+ $entity_guids[] = $entity->getGUID();
+}
+
+if (count($entity_guids) > 0) {
+ $river_items = elgg_view_river_items('', $entity_guids, '', '', '', '', $limit);
+} else {
+ $river_items .= elgg_echo('groups:no_activity');
+}
+
+$area1 .= elgg_view_title(elgg_echo('groups:activity'));
+$area1 .= "<div class='group_listings hide_comments'>".$river_items."</div>";
+$title = sprintf(elgg_echo("groups:activity"), page_owner_entity()->name);
+$body = elgg_view_layout('one_column_with_sidebar', $area1);
+
+// Finally draw the page
+page_draw($title, $body); \ No newline at end of file