aboutsummaryrefslogtreecommitdiff
path: root/mod/file
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
committerSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
commitcc544cfa2086e418318a899ffd550adfb744c7ba (patch)
tree6c04fbe2e3df67513aa76803cb8d05c105ba219b /mod/file
parente7d64510ebd823f186282e2b80780295bcca1b79 (diff)
parent68e4829ac0959d86c651e7ed6dc255c39694c8af (diff)
downloadelgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.gz
elgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.bz2
Merge Elgg 1.8.3.
Diffstat (limited to 'mod/file')
-rw-r--r--mod/file/actions/file/upload.php8
-rw-r--r--mod/file/start.php3
-rw-r--r--mod/file/views/default/file/specialcontent/image/default.php10
3 files changed, 14 insertions, 7 deletions
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php
index 3edc87952..5242cbda2 100644
--- a/mod/file/actions/file/upload.php
+++ b/mod/file/actions/file/upload.php
@@ -109,7 +109,9 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) {
// if image, we need to create thumbnails (this should be moved into a function)
if ($guid && $file->simpletype == "image") {
- $thumbnail = get_resized_image_from_existing_file($file->getFilenameOnFilestore(),60,60, true);
+ $file->icontime = time();
+
+ $thumbnail = get_resized_image_from_existing_file($file->getFilenameOnFilestore(), 60, 60, true);
if ($thumbnail) {
$thumb = new ElggFile();
$thumb->setMimeType($_FILES['upload']['type']);
@@ -123,7 +125,7 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) {
unset($thumbnail);
}
- $thumbsmall = get_resized_image_from_existing_file($file->getFilenameOnFilestore(),153,153, true);
+ $thumbsmall = get_resized_image_from_existing_file($file->getFilenameOnFilestore(), 153, 153, true);
if ($thumbsmall) {
$thumb->setFilename($prefix."smallthumb".$filestorename);
$thumb->open("write");
@@ -133,7 +135,7 @@ if (isset($_FILES['upload']['name']) && !empty($_FILES['upload']['name'])) {
unset($thumbsmall);
}
- $thumblarge = get_resized_image_from_existing_file($file->getFilenameOnFilestore(),600,600, false);
+ $thumblarge = get_resized_image_from_existing_file($file->getFilenameOnFilestore(), 600, 600, false);
if ($thumblarge) {
$thumb->setFilename($prefix."largethumb".$filestorename);
$thumb->open("write");
diff --git a/mod/file/start.php b/mod/file/start.php
index 3e1ae169d..ad88469c8 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -349,7 +349,8 @@ function file_icon_url_override($hook, $type, $returnvalue, $params) {
// thumbnails get first priority
if ($file->thumbnail) {
- return "mod/file/thumbnail.php?file_guid=$file->guid&size=$size";
+ $ts = (int)$file->icontime;
+ return "mod/file/thumbnail.php?file_guid=$file->guid&size=$size&icontime=$ts";
}
$mapping = array(
diff --git a/mod/file/views/default/file/specialcontent/image/default.php b/mod/file/views/default/file/specialcontent/image/default.php
index fbd994a0b..431ac9f4f 100644
--- a/mod/file/views/default/file/specialcontent/image/default.php
+++ b/mod/file/views/default/file/specialcontent/image/default.php
@@ -1,13 +1,17 @@
<?php
/**
* Display an image
+ *
+ * @uses $vars['entity']
*/
-$image_url = elgg_get_site_url() . "mod/file/thumbnail.php?file_guid={$vars['entity']->getGUID()}&size=large";
+$file = $vars['entity'];
+
+$image_url = $file->getIconURL('large');
$image_url = elgg_format_url($image_url);
-$download_url = elgg_get_site_url() . "mod/file/download.php?file_guid={$vars['entity']->getGUID()}";
+$download_url = elgg_get_site_url() . "file/download/{$file->getGUID()}";
-if ($vars['full_view'] && $smallthumb = $vars['entity']->smallthumb) {
+if ($vars['full_view']) {
echo <<<HTML
<div class="file-photo">
<a href="$download_url"><img class="elgg-photo" src="$image_url" /></a>