aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default/groups/profile/activity_module.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-05 20:23:35 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-05 20:23:35 +0000
commitb878ea5e67cf47aad416aadd0e6ecae1c56da4b9 (patch)
tree3645b6acec2ce53ec0d1a8a0d07f810c2ea15346 /mod/groups/views/default/groups/profile/activity_module.php
parentcac4c30b0cfe647d272b451612c0b59fefadf620 (diff)
downloadelgg-b878ea5e67cf47aad416aadd0e6ecae1c56da4b9.tar.gz
elgg-b878ea5e67cf47aad416aadd0e6ecae1c56da4b9.tar.bz2
reviewed groups plugin and added todo's
git-svn-id: http://code.elgg.org/elgg/trunk@8591 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default/groups/profile/activity_module.php')
-rw-r--r--mod/groups/views/default/groups/profile/activity_module.php47
1 files changed, 4 insertions, 43 deletions
diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php
index 1c7e6daa2..78eae9cec 100644
--- a/mod/groups/views/default/groups/profile/activity_module.php
+++ b/mod/groups/views/default/groups/profile/activity_module.php
@@ -2,11 +2,11 @@
/**
* Groups latest activity
*
+ * @todo add people joining group to activity
+ *
* @package Groups
*/
-global $CONFIG;
-
if ($vars['entity']->activity_enable == 'no') {
return true;
}
@@ -16,7 +16,6 @@ if (!$group) {
return true;
}
-
$all_link = elgg_view('output/url', array(
'href' => "pg/groups/activity/$group->guid",
'text' => elgg_echo('link:view:all'),
@@ -27,10 +26,11 @@ $header .= '<h3>' . elgg_echo('groups:activity') . '</h3>';
elgg_push_context('widgets');
+$db_prefix = elgg_get_config('dbprefix');
$content = elgg_list_river(array(
'limit' => 4,
'pagination' => false,
- 'joins' => array("join {$CONFIG->dbprefix}entities e1 on e1.guid = rv.object_guid"),
+ 'joins' => array("join {$db_prefix}entities e1 on e1.guid = rv.object_guid"),
'wheres' => array("(e1.container_guid = $group->guid)"),
));
elgg_pop_context();
@@ -40,42 +40,3 @@ if (!$content) {
}
echo elgg_view_module('info', '', $content, array('header' => $header));
-
-return true;
-?>
-<span class="group_widget_link">
-<?php
- echo elgg_view('output/url', array(
- 'href' => "pg/groups/activity/" . elgg_get_page_owner_guid(),
- 'text' => elgg_echo('link:view:all'),
- ));
-?>
-</span>
-<h3><?php echo elgg_echo("activity"); ?></h3>
-<?php
- $owner = elgg_get_page_owner_entity();
- $group_guid = $owner->guid;
- $limit = 5;
-
- $offset = (int) get_input('offset', 0);
-
- // Sanitise variables -- future proof in case they get sourced elsewhere
- $limit = (int) $limit;
- $offset = (int) $offset;
- $group_guid = (int) $group_guid;
-
- //@todo Holy cow, this really needs to be a function!
- $sql = "SELECT {$CONFIG->dbprefix}river.id, {$CONFIG->dbprefix}river.type, {$CONFIG->dbprefix}river.subtype, {$CONFIG->dbprefix}river.action_type, {$CONFIG->dbprefix}river.access_id, {$CONFIG->dbprefix}river.view, {$CONFIG->dbprefix}river.subject_guid, {$CONFIG->dbprefix}river.object_guid, {$CONFIG->dbprefix}river.posted FROM {$CONFIG->dbprefix}river INNER JOIN {$CONFIG->dbprefix}entities AS entities1 ON {$CONFIG->dbprefix}river.object_guid = entities1.guid INNER JOIN {$CONFIG->dbprefix}entities AS entities2 ON entities1.container_guid = entities2.guid WHERE entities2.guid = $group_guid OR {$CONFIG->dbprefix}river.object_guid = $group_guid ORDER BY posted DESC limit {$offset},{$limit}";
-
- $items = get_data($sql);
-
- if (count($items) > 0) {
- $river_items = elgg_view('river/item/list',array(
- 'limit' => $limit,
- 'offset' => $offset,
- 'items' => $items
- ));
- }
- echo $river_items;
-
-?>