1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 09:04:38 +02:00

Fixes #1732 Image preview on download.

This commit is contained in:
Cameron
2018-08-06 13:07:13 -07:00
parent e2460e0b3a
commit 07a2efbdcf
2 changed files with 41 additions and 28 deletions

View File

@@ -5194,16 +5194,23 @@ class e_form
$parms['pre'] = rtrim($parms['legacyPath'],'/').'/';
}
// return print_a($thparms,true);
$src = $tp->replaceConstants(vartrue($parms['pre']).$value, 'abs');
// $thsrc = $tp->thumbUrl(vartrue($parms['pre']).$value, $thparms, varset($parms['thumb_urlraw']));
if(!empty($value[0]) && $value[0] === '{') // full path to convert.
{
$src = $tp->replaceConstants($value, 'abs');
}
else // legacy link without {e_XXX} path. eg. downloads thumbs.
{
$src = $tp->replaceConstants(vartrue($parms['pre']).$value, 'abs');
}
$alt = basename($src);
// $ttl = '<img src="'.$thsrc.'" alt="'.$alt.'" class="thumbnail e-thumb" />';
$thparms['alt'] = $alt;
$thparms['class'] = "thumbnail e-thumb";
e107::getDebug()->log($value);
$ttl = $tp->toImage($value, $thparms);