diff options
author | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-15 21:05:50 +0000 |
---|---|---|
committer | pete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-04-15 21:05:50 +0000 |
commit | 5266d4b4673b04e4a3faed5bd467a86cbd0abc3d (patch) | |
tree | 43fcf4f2d3f1fd4186c12cdcf5e1b23ea58bf039 /mod/groups/views/default | |
parent | ae0070da382d2b2c5d4939763e9919f2eb39873b (diff) | |
download | elgg-5266d4b4673b04e4a3faed5bd467a86cbd0abc3d.tar.gz elgg-5266d4b4673b04e4a3faed5bd467a86cbd0abc3d.tar.bz2 |
Activity view added for Groups profile page, based on code by Jon Maul.
git-svn-id: http://code.elgg.org/elgg/trunk@5753 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r-- | mod/groups/views/default/groups/activity_latest.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mod/groups/views/default/groups/activity_latest.php b/mod/groups/views/default/groups/activity_latest.php new file mode 100644 index 000000000..c7cd48c3f --- /dev/null +++ b/mod/groups/views/default/groups/activity_latest.php @@ -0,0 +1,39 @@ +<?php +/** + * Groups latest activity + * + * @package Groups + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ +?> + +<h3><?php echo elgg_echo("activity"); ?></h3> +<?php + $owner = 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; + + $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; + +?> |