aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/river.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-16 12:35:43 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-16 12:35:43 +0000
commitcc76d0a9ecb840d071bfbba1cd66f503f9dc2142 (patch)
treee8387ea436b715da34a0de50f3ab9a70e5744933 /engine/lib/river.php
parentafe892810e6736739df91e6618399160690b606b (diff)
downloadelgg-cc76d0a9ecb840d071bfbba1cd66f503f9dc2142.tar.gz
elgg-cc76d0a9ecb840d071bfbba1cd66f503f9dc2142.tar.bz2
Closes #442: Requires schema upgrade. Side effect - friends activity rivers will be blanked.
git-svn-id: https://code.elgg.org/elgg/trunk@2267 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/river.php')
-rw-r--r--engine/lib/river.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 0952ad965..4db00d18c 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -158,7 +158,7 @@
function __get_river_from_log($by_user = "", $relationship = "", $limit = 10, $offset = 0)
{
global $CONFIG;
-
+
// Get all potential river events from available view
$river_events = array();
$river_views = elgg_view_tree('river');
@@ -200,7 +200,11 @@
if (($details['type']) && ($details['event'])) {
if ($n>0) $obj_query .= " or ";
- $obj_query .= "( sl.object_type='{$details['type']}' and sl.object_subtype='{$details['subtype']}' and sl.event='{$details['event']}' )";
+ $access = "";
+ if ($details['type']!='relationship')
+ $access = " and " . get_access_sql_suffix('sl');
+
+ $obj_query .= "( sl.object_type='{$details['type']}' and sl.object_subtype='{$details['subtype']}' and sl.event='{$details['event']}' $access )";
$n++;
}
@@ -220,7 +224,7 @@
}
$query = "SELECT sl.* from {$CONFIG->dbprefix}system_log sl $relationship_join where $user and $relationship_query ($obj_query) order by sl.time_created desc limit $offset, $limit";
-
+echo $query;
// fetch data from system log (needs optimisation)
return get_data($query);
}