1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Gallery default template fits recent changes

This commit is contained in:
secretr
2012-08-23 12:41:37 +00:00
parent 39c783ed39
commit 9d61b37214
2 changed files with 12 additions and 14 deletions

View File

@@ -47,12 +47,12 @@ class gallery_shortcodes extends e_shortcode
* thumburl - return only the URL of the destination image (large one)
* thumbsrc - url to the thumb, as it's written in the src attribute of the image
* imageurl - full path to the destination image (no proxy)
* actualPreview - large preview will use the original size of the image (if available!), prefs will be ignored
* actualPreview - large preview will use the original path to the image (no proxy)
*/
function sc_gallery_thumb($parm='')
{
$tp = e107::getParser();
$parms = eHelper::scParams($parm);
$parms = eHelper::scParams($parm);
$w = vartrue($parms['w']) ? $parms['w'] : 190;
$h = vartrue($parms['h']) ? $parms['h'] : 150;
@@ -63,23 +63,21 @@ class gallery_shortcodes extends e_shortcode
$pop_w = vartrue(e107::getPlugPref('gallery','pop_w'),1024);
$pop_h = vartrue(e107::getPlugPref('gallery','pop_h'),768);
if(isset($parm['actualPreview']) && !empty($this->var['media_dimensions']))
$attFull = 'w='.$pop_w.'&h='.$pop_h.'&x=1';
$srcFull = $tp->thumbUrl($this->var['media_url'], $attFull);
if(isset($parm['actualPreview']))
{
list($pop_w, $pop_w) = array_map('trim', explode('x', $this->var['media_dimensions']));
$srcFull = $tp->replaceConstants($this->var['media_url'], 'full');
}
$attFull = 'w='.$pop_w.'&h='.$pop_h.'&x=1';
// echo "<br /><br />".$attFull;
if(isset($parms['thumburl'])) return $tp->thumbUrl($this->var['media_url'], $attFull);
if(isset($parms['thumburl'])) return $srcFull;
elseif(isset($parms['thumbsrc'])) return $tp->thumbUrl($this->var['media_url'],$att);
elseif(isset($parms['imageurl'])) return $tp->replaceConstants($this->var['media_url'], 'full');
$caption = $tp->toAttribute($this->var['media_caption']) ;
$caption .= ($this->downloadable) ? " <a class='e-tip smalltext' title='Right-click > Save Link As' href='".$tp->thumbUrl($this->var['media_url'], $attFull)."'>Download</a>" : "";
$text = "<a class='".$class."' title=\"".$caption."\" href='".$tp->thumbUrl($this->var['media_url'], $attFull)."' rel='{$rel}' >";
$caption = $tp->toAttribute($this->var['media_caption']) ;
$caption .= ($this->downloadable) ? " <a class='e-tip smalltext' title='Right-click > Save Link As' href='".$srcFull."'>Download</a>" : "";
$text = "<a class='".$class."' title=\"".$caption."\" href='".$srcFull."' rel='{$rel}' >";
$text .= "<img class='".$class."' src='".$tp->thumbUrl($this->var['media_url'],$att)."' alt='' />";
$text .= "</a>";

View File

@@ -65,7 +65,7 @@ $GALLERY_TEMPLATE['SLIDESHOW_WRAPPER'] = '
';
$GALLERY_TEMPLATE['SLIDESHOW_SLIDE_ITEM'] = '<span class="gallery-slide-item">{GALLERY_THUMB=aw=150&ah=120}</span>';
$GALLERY_TEMPLATE['SLIDESHOW_SLIDE_ITEM'] = '<span class="gallery-slide-item">{GALLERY_THUMB=w=150&h=120}</span>';