From fa1f6d7454edcb8e30b9b0bdb14f1ec040546715 Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 6 Oct 2008 16:25:28 +0000 Subject: 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 --- views/default/river/relationship/friend/create.php | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 views/default/river/relationship/friend/create.php (limited to 'views/default/river/relationship') 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 @@ +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 "getURL()}\">{$performed_by->name} "; + + // Verb + echo elgg_echo('river:relationship:friend'); + + // user B + echo " getURL()}\">{$userb->name}"; + } + + break; + } + } + +?> \ No newline at end of file -- cgit v1.2.3