aboutsummaryrefslogtreecommitdiffstats
path: root/action.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-01-05 22:06:21 +0000
committerrvelices <rv-github@modusoptimus.com>2012-01-05 22:06:21 +0000
commit34717c1391166b847e4236cb3e519dfd7b0cbbd1 (patch)
treede9b7c278e78bcef1214d482cd292e9092e3a257 /action.php
parente64ab974df242b25ade46d9795294ae859060355 (diff)
feature 2548 multisize - improved picture.php display (original...) + code cleanup
git-svn-id: http://piwigo.org/svn/trunk@12855 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'action.php')
-rw-r--r--action.php18
1 files changed, 6 insertions, 12 deletions
diff --git a/action.php b/action.php
index e75f60aec..4099538d7 100644
--- a/action.php
+++ b/action.php
@@ -60,7 +60,7 @@ function do_error( $code, $str )
if (!isset($_GET['id'])
or !is_numeric($_GET['id'])
or !isset($_GET['part'])
- or !in_array($_GET['part'], array('t','e','i','h') ) )
+ or !in_array($_GET['part'], array('e','r') ) )
{
do_error(400, 'Invalid request - id/part');
}
@@ -102,21 +102,15 @@ include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
$file='';
switch ($_GET['part'])
{
- case 't':
- $file = get_thumbnail_path($element_info);
- break;
case 'e':
- $file = get_element_path($element_info);
- break;
- case 'i':
- $file = get_image_path($element_info);
- break;
- case 'h':
if ( $user['enabled_high']!='true' )
{
do_error(401, 'Access denied h');
}
- $file = get_high_path($element_info);
+ $file = get_element_path($element_info);
+ break;
+ case 'r':
+ $file = original_to_representative( get_element_path($element_info), $element_info['representative_ext'] );
break;
}
@@ -175,7 +169,7 @@ if (!isset($ctype))
$http_headers[] = 'Content-Type: '.$ctype;
-if (!isset($_GET['view']))
+if (isset($_GET['download']))
{
$http_headers[] = 'Content-Disposition: attachment; filename="'.$element_info['file'].'";';
$http_headers[] = 'Content-Transfer-Encoding: binary';