aboutsummaryrefslogtreecommitdiff
path: root/thumbnail.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-03-21 15:57:48 +0000
committerCash Costello <cash.costello@gmail.com>2009-03-21 15:57:48 +0000
commit450b57bc95f405aebb1dc110bafc1b5def5041f4 (patch)
treecb3d05153bd49f4753aafa0becc3f3435fada021 /thumbnail.php
parent8b474ce9723b7d717c65415149de947fbedceeba (diff)
downloadelgg-450b57bc95f405aebb1dc110bafc1b5def5041f4.tar.gz
elgg-450b57bc95f405aebb1dc110bafc1b5def5041f4.tar.bz2
code cleanup
Diffstat (limited to 'thumbnail.php')
-rw-r--r--thumbnail.php60
1 files changed, 28 insertions, 32 deletions
diff --git a/thumbnail.php b/thumbnail.php
index 0e6142cbb..b4c745ae2 100644
--- a/thumbnail.php
+++ b/thumbnail.php
@@ -1,46 +1,42 @@
<?php
/**
- * Elgg file thumbnail
+ * Tidypics Thumbnail
*
- * @package ElggFile
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008
- * @link http://elgg.com/
*/
// Get engine
- require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+ include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
// Get file GUID
- $file_guid = (int) get_input('file_guid',0);
+ $file_guid = (int) get_input('file_guid',0);
// Get file thumbnail size
- $size = get_input('size','small');
- if ($size != 'small') {
- $size = 'large';
- }
+ $size = get_input('size','small');
+ if ($size != 'small') {
+ $size = 'large';
+ }
// Get file entity
- if ($file = get_entity($file_guid)) {
- if ($file->getSubtype() == "image") {
- // Get file thumbnail
- if ($size == "small") {
- $thumbfile = $file->smallthumb;
- } else {
- $thumbfile = $file->largethumb;
- }
+ if ($file = get_entity($file_guid)) {
+ if ($file->getSubtype() == "image") {
+ // Get file thumbnail
+ if ($size == "small") {
+ $thumbfile = $file->smallthumb;
+ } else {
+ $thumbfile = $file->largethumb;
+ }
- // Grab the file
- if ($thumbfile && !empty($thumbfile)) {
- $readfile = new ElggFile();
- $readfile->owner_guid = $file->owner_guid;
- $readfile->setFilename($thumbfile);
- //$mime = $file->getMimeType();
- $contents = $readfile->grabFile();
- }
- } //end subtype comparison
- } //end get_entity
+ // Grab the file
+ if ($thumbfile && !empty($thumbfile)) {
+ $readfile = new ElggFile();
+ $readfile->owner_guid = $file->owner_guid;
+ $readfile->setFilename($thumbfile);
+ //$mime = $file->getMimeType();
+ $contents = $readfile->grabFile();
+ }
+ } //end subtype comparison
+ } //end get_entity
// Open error image if file was not found
if (!isset($contents) || is_null($contents) || $file->getSubtype()!='image') {
@@ -49,7 +45,7 @@
} //end of default error image
// Return the thumbnail and exit
- header("Content-type: image");
- echo $contents;
- exit;
+ header("Content-type: image");
+ echo $contents;
+ exit;
?> \ No newline at end of file