aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-11 11:08:39 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-11 11:08:39 +0000
commitbe6535c536471feae1c16299d3d8121c9feabd5b (patch)
tree29ce114154a0710d2ec6f8889e25e127bd3a83c8 /engine/lib/metadata.php
parent1ad8a0f51959a7bcbf6e2f77e9f40f0d2f80bf64 (diff)
downloadelgg-be6535c536471feae1c16299d3d8121c9feabd5b.tar.gz
elgg-be6535c536471feae1c16299d3d8121c9feabd5b.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Added metadata/metastrings tag stuff. Lorks. git-svn-id: https://code.elgg.org/elgg/trunk@151 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 56bb83990..105001535 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -136,8 +136,7 @@
return 'tag';
}
-
-
+
/**
* Create a new metadata object, or update an existing one.
*
@@ -177,6 +176,11 @@
}
else
{
+ // Add the metastring
+ $value = add_metastring($value);
+ if (!$value) return false;
+
+ // If ok then add it
$id = insert_data("INSERT into {$CONFIG->dbprefix}metadata (object_id, object_type, name, value, value_type, owner_id, created, access_id) VALUES ($object_id,'$object_type','$name','$value','$value_type', $owner_id, $time, $access_id)");
}
@@ -209,6 +213,12 @@
$access = get_access_list();
+
+ // Add the metastring
+ $value = add_metastring($value);
+ if (!$value) return false;
+
+ // If ok then add it
return update_data("UPDATE {$CONFIG->dbprefix}metadata set value='$value', value_type='$value_type', access_id=$access_id, owner_id=$owner_id where id=$id and name='$name' and (access_id in {$access} or (access_id = 0 and owner_id = {$_SESSION['id']}))");
}