wwwroot;
if (($annotation instanceof ElggAnnotation)) {
$file = $annotation->getEntity();
$url = $file->getURL();
if ($annoff > 0) {
$url .= "?annoff={$annoff}";
}
}
if (($file instanceof ElggEntity) && ($file->getType() == 'object') && ($file->getSubtype() == 'file')) {
$group = $file->getContainerEntity();
}
if (($annotation instanceof ElggAnnotation) && file && ($group instanceof ElggGroup) && !empty($value)) {
$query = "INSERT INTO {$CONFIG->dbprefix}koolielu_subcomments (entity_guid, comment_id, owner_guid, value, time_created) VALUES ({$file->guid}, {$annotation->id}, {$owner_guid}, '{$value}', {$time_created})";
$inserted_id = insert_data($query);
if ($inserted_id) {
/*translation:Comment added.*/
system_message(elgg_echo("koolielu:subcomment:added"));
} else {
/*translation:Comment could not be added.*/
register_error(elgg_echo("koolielu:subcomment:not:added"));
}
} else {
/*translation:Comment could not be added. Some values missing.*/
register_error(elgg_echo("koolielu:subcomment:not:added:err"));
}
forward($url);
?>