diff options
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/annotations.php | 2 | ||||
-rw-r--r-- | engine/lib/river2.php | 18 |
2 files changed, 7 insertions, 13 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 49ffc7840..028c33006 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -191,7 +191,7 @@ if ($result!==false) { $obj = get_annotation($result); if (trigger_elgg_event('create', 'annotation', $obj)) { - return true; + return $result; } else { delete_annotation($result); } diff --git a/engine/lib/river2.php b/engine/lib/river2.php index 1a982e6a4..510ec7b8c 100644 --- a/engine/lib/river2.php +++ b/engine/lib/river2.php @@ -23,14 +23,8 @@ * @param int $posted The UNIX epoch timestamp of the river item (default: now) * @return true|false Depending on success */ - function add_to_river( - $view, - $action_type, - $subject_guid, - $object_guid, - $access_id = "", - $posted = 0 - ) { + function add_to_river($view,$action_type,$subject_guid,$object_guid,$access_id = "",$posted = 0, $annotation_id = 0) + { // Sanitise variables if (!elgg_view_exists($view)) return false; @@ -39,10 +33,9 @@ if (empty($action_type)) return false; if ($posted == 0) $posted = time(); if ($access_id === "") $access_id = $object->access_id; - + $annotation_id = (int)$annotation_id; $type = $object->getType(); $subtype = $object->getSubtype(); - $action_type = sanitise_string($action_type); // Load config @@ -57,7 +50,8 @@ " view = '{$view}', " . " subject_guid = {$subject_guid}, " . " object_guid = {$object_guid}, " . - " posted = {$posted} "); + " posted = {$posted}, " . + " annotation_id = {$annotation_id} "); } @@ -217,7 +211,7 @@ $whereclause = implode(' and ', $where); // Construct main SQL - $sql = "select id,type,subtype,action_type,access_id,view,subject_guid,object_guid,posted from {$CONFIG->dbprefix}river where {$whereclause} order by posted desc limit {$offset},{$limit}"; + $sql = "select id,type,subtype,action_type,access_id,view,subject_guid,object_guid,posted,annotation_id from {$CONFIG->dbprefix}river where {$whereclause} order by posted desc limit {$offset},{$limit}"; // Get data return get_data($sql); |