From 10e5db3119afca7060a680517393518be3aa54ab Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 27 Jun 2008 15:20:33 +0000 Subject: Brought generic comments into Elgg core git-svn-id: https://code.elgg.org/elgg/trunk@1185 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/comments/add.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 actions/comments/add.php (limited to 'actions/comments/add.php') diff --git a/actions/comments/add.php b/actions/comments/add.php new file mode 100644 index 000000000..4f3d5eee8 --- /dev/null +++ b/actions/comments/add.php @@ -0,0 +1,41 @@ + + * @copyright Curverider Ltd 2008 + * @link http://elgg.org/ + */ + + // Make sure we're logged in; forward to the front page if not + if (!isloggedin()) forward(); + + // Get input + $entity_guid = (int) get_input('entity_guid'); + $comment_text = get_input('generic_comment'); + + // Let's see if we can get an entity with the specified GUID + if ($entity = get_entity($entity_guid)) { + + // If posting the comment was successful, say so + if ($entity->annotate('generic_comment',$comment_text,$entity->access_id, $_SESSION['guid'])) { + + system_message(elgg_echo("generic_comment:posted")); + + } else { + system_message(elgg_echo("generic_comment:failure")); + } + + } else { + + system_message(elgg_echo("generic_comment:notfound")); + + } + + // Forward to the + forward($entity->getURL()); + +?> \ No newline at end of file -- cgit v1.2.3