aboutsummaryrefslogtreecommitdiff
path: root/actions/videolist
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-02-25 01:38:29 +0100
committerSem <sembrestels@riseup.net>2012-02-25 01:38:29 +0100
commit8ccd45aa77d290906fd42dcf5520a434303d4f68 (patch)
treef1cb3ccc39ce4e8a4ebafb68e414c0c963790dc6 /actions/videolist
parent3a948fa46583e2419388d0c04e910f5d69721d3e (diff)
downloadelgg-8ccd45aa77d290906fd42dcf5520a434303d4f68.tar.gz
elgg-8ccd45aa77d290906fd42dcf5520a434303d4f68.tar.bz2
Saving thumbnails in server and serving them secure.
Diffstat (limited to 'actions/videolist')
-rw-r--r--actions/videolist/edit.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/actions/videolist/edit.php b/actions/videolist/edit.php
index 6670ceadb..be566de7e 100644
--- a/actions/videolist/edit.php
+++ b/actions/videolist/edit.php
@@ -71,6 +71,18 @@ $video->container_guid = $container_guid;
if ($video->save()) {
elgg_clear_sticky_form('videolist');
+
+ // Let's save the thumbnail in the data folder
+ $thumbnail = file_get_contents($video->thumbnail);
+ if ($thumbnail) {
+ $prefix = "videolist/" . $video->guid;
+ $filehandler = new ElggFile();
+ $filehandler->owner_guid = $video->owner_guid;
+ $filehandler->setFilename($prefix . ".jpg");
+ $filehandler->open("write");
+ $filehandler->write($thumbnail);
+ $filehandler->close();
+ }
system_message(elgg_echo('videolist:saved'));