diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-06 16:25:28 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-10-06 16:25:28 +0000 |
commit | fa1f6d7454edcb8e30b9b0bdb14f1ec040546715 (patch) | |
tree | 55b0d3c6228234fea73c280455d4e9054f05143a /mod/groups/views/default/river/relationship/member | |
parent | becc619dfb30eae5dfd5b21ded8a3f5324571398 (diff) | |
download | elgg-fa1f6d7454edcb8e30b9b0bdb14f1ec040546715.tar.gz elgg-fa1f6d7454edcb8e30b9b0bdb14f1ec040546715.tar.bz2 |
Closes #402 and #407 : Right! Finally nailed this fscking issue to the wall (hopefully).
Modified system log to hold extra information about the class being stored, this lets us pull only the required rows from the event log.
This drastically simplifies and speeds up the query.
Requires: Database upgrade.
Outstanding issues: Query is using filesort despite using correct index. Still much faster than the last method!
git-svn-id: https://code.elgg.org/elgg/trunk@2194 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default/river/relationship/member')
-rw-r--r-- | mod/groups/views/default/river/relationship/member/create.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mod/groups/views/default/river/relationship/member/create.php b/mod/groups/views/default/river/relationship/member/create.php new file mode 100644 index 000000000..df80f3588 --- /dev/null +++ b/mod/groups/views/default/river/relationship/member/create.php @@ -0,0 +1,40 @@ +<?php + /** + * Elgg relationship create event for groups + * Display something in the river when a group is joined + * + * @package ElggGroups + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd + * @copyright Curverider Ltd 2008 + * @link http://elgg.com/ + */ + + $statement = $vars['statement']; + + $performed_by = $statement->getSubject(); + $event = $statement->getEvent(); + $object = $statement->getObject(); + + if (is_array($object)) + { + switch ($object['relationship']) + { + // Friending + case 'member' : + $user = $object['subject']; + $group = $object['object']; + + if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) + { + echo "<a href=\"{$user->getURL()}\">{$user->name}</a> "; + echo elgg_echo("groups:river:member"); + echo " '<a href=\"{$group->getURL()}\">{$group->name}</a>'"; + } + + break; + } + } + + +?>
\ No newline at end of file |