aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-09-21 14:50:23 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-09-21 14:50:23 +0000
commitf1ba6ec14130a5480653745b22de6a001112bddb (patch)
tree2ec0fba80900655965b1c6d88bf4aaa7c22e39a6 /engine
parent59f01de10c6a581c074889b96fbe4698ccd47309 (diff)
downloadelgg-f1ba6ec14130a5480653745b22de6a001112bddb.tar.gz
elgg-f1ba6ec14130a5480653745b22de6a001112bddb.tar.bz2
New river code added to allow user comment to be pulled out and displayed
git-svn-id: http://code.elgg.org/elgg/trunk@3490 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/annotations.php2
-rw-r--r--engine/lib/river2.php18
-rw-r--r--engine/schema/upgrades/2009091901.sql2
3 files changed, 9 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);
diff --git a/engine/schema/upgrades/2009091901.sql b/engine/schema/upgrades/2009091901.sql
new file mode 100644
index 000000000..7182c7f76
--- /dev/null
+++ b/engine/schema/upgrades/2009091901.sql
@@ -0,0 +1,2 @@
+-- add an additional column to the river table
+ALTER TABLE `prefix_river` ADD COLUMN `annotation_id` int(11) NOT NULL AFTER `posted`; \ No newline at end of file