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 /views/default/river/relationship/friend | |
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 'views/default/river/relationship/friend')
-rw-r--r-- | views/default/river/relationship/friend/create.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php new file mode 100644 index 000000000..edbaf4213 --- /dev/null +++ b/views/default/river/relationship/friend/create.php @@ -0,0 +1,47 @@ +<?php + /** + * Elgg relationship create event. + * Display something in the river when a relationship is created. + * + * @package Elgg + * @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 'friend' : + case 'friends' : // 'friends' shouldn't be used, but just incase :) + + // Get second object + $userb = $object['object']; + + // Only users can be friends + if (($performed_by instanceof ElggUser) && ($userb instanceof ElggUser)) + { + // User A + echo "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> "; + + // Verb + echo elgg_echo('river:relationship:friend'); + + // user B + echo " <a href=\"{$userb->getURL()}\">{$userb->name}</a>"; + } + + break; + } + } + +?>
\ No newline at end of file |