wwwroot . "pg/file/" . $_SESSION['user']->username); exit; } $result = false; $container_guid = $file->container_guid; $container = get_entity($container_guid); if ($file->canEdit()) { $file->access_id = $access_id; $file->title = $title; $file->description = $desc; // Save tags $tags = explode(",", $tags); $file->tags = $tags; if ($container instanceof ElggGroup) { $pubtime = get_input("pubtime"); if ($pubtime) { $pubstamp = dateIntoTimestamp($pubtime); if ($pubstamp >= strtotime(date("d-m-Y"))) { $file->pubtime = $pubtime; $file->future_acl = $access_id; $file->access_id = 0; } else { /*translation:Selected publish date is less than today. Provided date ignored.*/ register_error(elgg_echo("koolielu:community:file:pubtime_less_than_today")); } } else { $file->clearMetadata("pubtime"); $file->clearMetadata("future_acl"); } } $result = $file->save(); } if ($result) system_message(elgg_echo("file:saved")); else register_error(elgg_echo("file:uploadfailed")); forward($CONFIG->wwwroot . "pg/file/" . $container->username); ?>