aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-14 16:52:56 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-14 16:52:56 +0000
commit41424c427d0c9639243ac93682366f280f23c5b0 (patch)
treee1cea5d413338ec19de6f90b896bc0902f4075e8 /engine
parentcf860946249b508fd4e811b233ed618b3d21c8e7 (diff)
downloadelgg-41424c427d0c9639243ac93682366f280f23c5b0.tar.gz
elgg-41424c427d0c9639243ac93682366f280f23c5b0.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Get and set annotations seem to be working git-svn-id: https://code.elgg.org/elgg/trunk@229 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/annotations.php7
-rw-r--r--engine/lib/entities.php2
2 files changed, 5 insertions, 4 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 5c1fb35bf..5d0ba2215 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -171,7 +171,7 @@
{
global $CONFIG;
- $entity_guid = (int)$entity_id;
+ $entity_guid = (int)$entity_guid;
$name = sanitise_string(trim($name));
$value = sanitise_string(trim($value));
$value_type = detect_annotation_valuetype($value, sanitise_string(trim($value_type)));
@@ -238,7 +238,7 @@
* @param int $offset
* @param string $order_by
*/
- function get_annotations($entity_guid = 0, $entity_type = "", $entity_subtype = "", $name = "", $value = "", $owner_guid = 0, $limit = 10, $offset = 0,$order_by = "a.created desc")
+ function get_annotations($entity_guid = 0, $entity_type = "", $entity_subtype = "", $name = "", $value = "", $owner_guid = 0, $limit = 10, $offset = 0, $order_by = "a.time_created desc")
{
global $CONFIG;
@@ -250,13 +250,14 @@
$owner_guid = (int)$owner_guid;
$limit = (int)$limit;
$offset = (int)$offset;
+ $order_by = sanitise_string($order_by);
$access = get_access_list();
$where = array();
if ($entity_guid != 0)
- $where[] = "a.guid=$entity_guid";
+ $where[] = "a.entity_guid=$entity_guid";
if ($entity_type != "")
$where[] = "e.type='$entity_type'";
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 6956924cc..ca3f795f3 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -157,7 +157,7 @@
*/
function getAnnotations($name, $limit = 50, $offset = 0)
{
- get_annotations($this->getGUID(), "", "", $name, "", "", 0, $limit, $offset);
+ return get_annotations($this->getGUID(), "", "", $name, "", 0, $limit, $offset);
}
/**