From 361bff59658e6119b76e7ff31cd67c6054c93c8f Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 18 Jul 2008 18:23:50 +0000 Subject: Moved container_guid to entities, modified a bunch of functions. git-svn-id: https://code.elgg.org/elgg/trunk@1473 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/objects.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'engine/lib/objects.php') diff --git a/engine/lib/objects.php b/engine/lib/objects.php index 2067fe5c2..d2f90bdfd 100644 --- a/engine/lib/objects.php +++ b/engine/lib/objects.php @@ -259,18 +259,15 @@ * * @param int $guid The guid of the entity you're creating (as obtained by create_entity) * @param string $title The title of the object - * @param string $description The object's description - * @param int $container_guid The object's container guid (defaults to the current logged in user) + * @param string $description The object's description */ - function create_object_entity($guid, $title, $description, $container_guid = 0) + function create_object_entity($guid, $title, $description) { global $CONFIG; $guid = (int)$guid; $title = sanitise_string($title); $description = sanitise_string($description); - $container_guid = (int)$container_guid; - if (!$container_guid) $container_guid = $_SESSION['guid']; $row = get_entity_as_row($guid); @@ -278,7 +275,7 @@ { // Core entities row exists and we have access to it if ($exists = get_data_row("select guid from {$CONFIG->dbprefix}objects_entity where guid = {$guid}")) { - $result = update_data("UPDATE {$CONFIG->dbprefix}objects_entity set title='$title', description='$description', container_guid=$container_guid where guid=$guid"); + $result = update_data("UPDATE {$CONFIG->dbprefix}objects_entity set title='$title', description='$description' where guid=$guid"); if ($result!=false) { // Update succeeded, continue @@ -294,7 +291,7 @@ { // Update failed, attempt an insert. - $result = insert_data("INSERT into {$CONFIG->dbprefix}objects_entity (guid, container_guid, title, description) values ($guid, $container_guid, '$title','$description')"); + $result = insert_data("INSERT into {$CONFIG->dbprefix}objects_entity (guid, title, description) values ($guid, '$title','$description')"); if ($result!==false) { $entity = get_entity($guid); if (trigger_elgg_event('create',$entity->type,$entity)) { -- cgit v1.2.3