Changeset 31245


Ignore:
Timestamp:
Jul 20, 2015, 1:45:59 AM (9 years ago)
Author:
SergeD
Message:

version 1.0.18 - refer to changelog for more details

Location:
extensions/GDThumb
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/GDThumb/admin.php

    r31060 r31245  
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44
    5 function delete_gdthumb_cache($height) {
    6   $pattern = '#.*-cu_s9999x'.$height.'\.[a-zA-Z0-9]{3,4}$#';
    7   if ($contents = @opendir(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR)):
     5function int_delete_gdthumb_cache($pattern) {
     6  if ($contents = @opendir(PHPWG_ROOT_PATH . PWG_DERIVATIVE_DIR)):
    87    while (($node = readdir($contents)) !== false):
    98      if ($node != '.'
    109          and $node != '..'
    11           and is_dir(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$node)):
    12         clear_derivative_cache_rec(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$node, $pattern);
     10          and is_dir(PHPWG_ROOT_PATH . PWG_DERIVATIVE_DIR . $node)):
     11        clear_derivative_cache_rec(PHPWG_ROOT_PATH . PWG_DERIVATIVE_DIR . $node, $pattern);
    1312      endif;
    1413    endwhile;
     
    1615  endif;
    1716}
     17
     18function delete_gdthumb_cache($height) {
     19  int_delete_gdthumb_cache('#.*-cu_s9999x' . $height . '\.[a-zA-Z0-9]{3,4}$#');
     20  int_delete_gdthumb_cache('#.*-cu_s' . $height . 'x9999\.[a-zA-Z0-9]{3,4}$#');
     21}
     22
     23global $template, $conf, $page;
     24
     25load_language('plugin.lang', GDTHUMB_PATH);
     26include(dirname(__FILE__).'/config_default.inc.php');
     27$params = $conf['gdThumb'];
    1828
    1929if (isset($_GET['getMissingDerivative'])) {
     
    4353      if ($src_image->is_mimetype())
    4454        continue;
    45       $derivative = new DerivativeImage(ImageStdParams::get_custom(9999, $conf['gdThumb']['height']), $src_image);
     55      if (($params['method'] == "slide") || ($params['method'] == "square")):
     56        $derivative = new DerivativeImage(ImageStdParams::get_custom($params['height'], 9999), $src_image);
     57      else:
     58        $derivative = new DerivativeImage(ImageStdParams::get_custom(9999, $params['height']), $src_image);
     59      endif;
    4660      if (@filemtime($derivative->get_path())===false) {
    4761        $urls[] = $derivative->get_url().$uid;
     
    6478}
    6579
    66 global $template, $conf, $page;
    67 
    68 load_language('plugin.lang', GDTHUMB_PATH);
    69 include(dirname(__FILE__).'/config_default.inc.php');
    70 $params = $conf['gdThumb'];
    71 
    7280// Delete cache
    7381if (isset($_POST['cachedelete'])) {
    7482  check_pwg_token();
    75   delete_gdthumb_cache($conf['gdThumb']['height']);
    76   delete_gdthumb_cache($conf['gdThumb']['height'] * 2 + $conf['gdThumb']['margin']);
     83  delete_gdthumb_cache($params['height']);
     84  delete_gdthumb_cache($params['height'] * 2 + $params['margin']);
    7785  redirect('admin.php?page=plugin-GDThumb');
    7886}
     
    92100  endif;
    93101
    94   $big_thumb = !empty($_POST['big_thumb']);
     102  $big_thumb        = !empty($_POST['big_thumb']);
     103  $big_thumb_noinpw = !empty($_POST['big_thumb_noinpw']);
     104  $thumb_animate    = !empty($_POST['thumb_animate']);
     105  $thumb_mode_album = $_POST['thumb_mode_album'];
     106  $thumb_mode_photo = $_POST['thumb_mode_photo'];
     107
     108  if ($method == "slide"):
     109    if ($big_thumb):
     110      $big_thumb = false;
     111      array_push($page['warnings'], l10n('Big thumb cannot be used in Slide mode. Disabled'));
     112    endif;
     113    if ($thumb_animate):
     114      $thumb_animate = false;
     115      array_push($page['warnings'], l10n('Thumb animation cannot be used in Slide mode. Disabled'));
     116    endif;
     117
     118    if (($thumb_mode_album == "overlay-ex") || ($thumb_mode_album == "overlay") || ($thumb_mode_album == "top") || ($thumb_mode_album == "bottom")):
     119      $thumb_mode_album = "bottom_static";
     120      array_push($page['warnings'], l10n('This Thumb mode cannot be used in Slide mode. Changed to default'));
     121    endif;
     122
     123    if (($thumb_mode_photo == "overlay-ex") || ($thumb_mode_photo == "overlay") || ($thumb_mode_photo == "top") || ($thumb_mode_photo == "bottom")):
     124      $thumb_mode_photo = "bottom_static";
     125      array_push($page['warnings'], l10n('This Thumb mode cannot be used in Slide mode. Changed to default'));
     126    endif;
     127  endif;
     128
     129  if (($big_thumb_noinpw) && (!$big_thumb)):
     130    $big_thumb_noinpw = false;
     131  endif;
     132
    95133  $params  = array(
    96134      'height'          => $_POST['height']
     
    98136    , 'nb_image_page'   => $_POST['nb_image_page']
    99137    , 'big_thumb'       => $big_thumb
    100     , 'big_thumb_noinpw'=> !empty($_POST['big_thumb_noinpw'])
     138    , 'big_thumb_noinpw'=> $big_thumb_noinpw
    101139    , 'cache_big_thumb' => !empty($_POST['cache_big_thumb'])
    102140    , 'normalize_title' => $normalize
    103141    , 'method'          => $method
    104     , 'thumb_mode_album'=> $_POST['thumb_mode_album']
    105     , 'thumb_mode_photo'=> $_POST['thumb_mode_photo']
     142    , 'thumb_mode_album'=> $thumb_mode_album
     143    , 'thumb_mode_photo'=> $thumb_mode_photo
    106144    , 'thumb_metamode'  => $_POST['thumb_metamode']
    107145    , 'no_wordwrap'     => !empty($_POST['no_wordwrap'])
    108     , 'thumb_animate'   => !empty($_POST['thumb_animate'])
     146    , 'thumb_animate'   => $thumb_animate
    109147  );
    110148
    111149  if (!is_numeric($params['height'])) {
    112     array_push($page['errors'], 'Thumbnails max height must be an integer.');
     150    array_push($page['errors'], l10n('Thumbnails max height must be an integer'));
    113151  }
    114152  if (!is_numeric($params['margin'])) {
    115     array_push($page['errors'], 'Margin between thumbnails must be an integer.');
     153    array_push($page['errors'], l10n('Margin between thumbnails must be an integer'));
    116154  }
    117155  if (!is_numeric($params['nb_image_page'])) {
    118     array_push($page['errors'], 'Number of photos per page must be an integer.');
     156    array_push($page['errors'], l10n('Number of photos per page must be an integer'));
    119157  }
    120158
     
    127165
    128166  if (empty($page['errors'])) {
    129     $query = '
    130   UPDATE ' . CONFIG_TABLE . '
    131     SET value="' . addslashes(serialize($params)) . '"
    132     WHERE param="gdThumb"
    133     LIMIT 1';
    134     pwg_query($query);
    135    
     167    conf_update_param('gdThumb', $params);
    136168    array_push($page['infos'], l10n('Information data registered in database'));
    137169  }
  • extensions/GDThumb/changelog.txt

    r31134 r31245  
    2626
    2727=== Changelog ===
     28version 1.0.18
     29+ ADMIN: style improvements
     30+ ADMIN: Experimental: New option for Thumbnail mode - "slide" - Square thumb with standard static Overlay (bottom/top)
     31+ ADMIN: Changed to use standard PWG persistance method for settings
     32+ Improved handling of derivatives
     33- Fixed issue with Photo thumb metadata not including Visits and Rating metadata
     34- Translation improvements. New languages: NO, TR, GR, PT
     35
    2836version 1.0.17
    2937+ All language translations are deprecated to allow full reset. en_UK folder now includes full set of translation resources
  • extensions/GDThumb/css/gdthumb.css

    r31060 r31245  
    1 ul.thumbnails { overflow: hidden; }
     1ul.thumbnails { overflow: hidden; background: inherit; }
    22
    3 ul.thumbnails .gdthumb   { position: relative; overflow: hidden; float: left; display: inline; background: none !important; }
     3ul.thumbnails .gdthumb   { position: relative; overflow: hidden; float: left; display: inline; background: inherit !important; }
    44ul.thumbnails .gdthumb a { position: absolute; z-index:0; }
    55
     
    99ul.thumbnails .gdthumb.animate:hover img { transform: scale(1.5,1.5) rotate(10deg); -ms-transform: scale(1.5,1.5) rotate(10deg); -webkit-transform: scale(1.5,1.5) rotate(10deg); -o-transform: scale(1.5,1.5) rotate(10deg); -moz-transform: scale(1.5,1.5) rotate(10deg); }
    1010
    11 ul.thumbnails .gdthumb .thumbLegend    { position: absolute; z-index: 1; height: 5em; left:0; right:0; padding:5px 0; width:100%; background:rgba(0,0,0,0.7); text-align:center; overflow:hidden; color:#aaa; padding-left: 4px; padding-right: 4px; }
     11ul.thumbnails .gdthumb .thumbLegend { position: absolute; z-index: 1; height: 5em; left:0; right:0; padding:5px 0; width:100%; background:rgba(0,0,0,0.7); text-align:center; overflow:hidden; color:#aaa; padding-left: 4px; padding-right: 4px; }
     12ul.thumbnails .gdthumb.slide .thumbLegend { background: inherit; height: auto; }
    1213
    1314ul.thumbnails .thumbLegend .thumbName  { display:block; color:#eee; }
     
    4950ul.thumbnails .gdthumb .overlay-ex.thumbLegend .thumbInfo .glyphicon { padding-top: 3px; font-size: 17px; }
    5051
     52ul.thumbnails.nowrap .gdthumb .thumbLegend { white-space: nowrap; overflow: hidden; height: auto; }
    5153
    52 ul.thumbnails.nowrap .gdthumb .thumbLegend { white-space: nowrap; overflow: hidden; height: auto; }
     54body.theme-whitehawk .gdthumb.slide { border: 1px solid #000; }
     55body.theme-whitehawk .gdthumb.slide .thumbLegend.bottom_static { background: #FFF; color: #555; }
     56body.theme-whitehawk .gdthumb.slide .thumbLegend.bottom_static .thumbTitle { color: #555; }
     57body.theme-whitehawk .gdthumb.slide .thumbLegend.bottom_static .thumbName { color: #555; }
  • extensions/GDThumb/js/gdthumb.js

    r31060 r31245  
    6464      GDThumb.big_thumb.crop   = GDThumb.big_thumb.height;
    6565      GDThumb.max_height = thumb_width;
    66     }
     66    } else if (GDThumb.method == 'slide') {
     67      var main_width = jQuery('ul.thumbnails').width();
     68      var max_col_count = Math.floor(main_width / GDThumb.max_height);
     69      var thumb_width   = Math.floor(main_width / max_col_count) - GDThumb.margin;
     70      GDThumb.max_height = thumb_width;
     71    }
    6772
    6873    GDThumb.t = new Array;
     
    7176      height = parseInt(jQuery(this).attr('height'));
    7277      th = {index: index, width: width, height: height, real_width: width, real_height: height};
     78
    7379      if (GDThumb.check_pv) {
    7480        var ratio = th.width / th.height;
    7581        GDThumb.big_thumb_block = (ratio > 2.2) || (ratio < 0.455);
    7682      }
    77       if ((GDThumb.method == 'square') && (th.height != th.width)) {
     83
     84      if (((GDThumb.method == 'square') || (GDThumb.method == 'slide')) && (th.height != th.width)) {
     85        th.width  = GDThumb.max_height;
    7886        th.height = GDThumb.max_height;
    79         th.width  = GDThumb.max_height;
    8087        th.crop   = GDThumb.max_height;
    8188      } else if (height < GDThumb.max_height) {
     
    110117    var best_size = {width: 1, height: 1};
    111118
    112     if (GDThumb.method == 'square') {
     119    if (GDThumb.method == 'slide') {
     120      best_size.width  = GDThumb.max_height;
     121      best_size.height = GDThumb.max_height;
     122
     123      GDThumb.resize(first_thumb, GDThumb.t[0].real_width, GDThumb.t[0].real_height, GDThumb.t[0].width, GDThumb.t[0].height, false);
     124    } else if (GDThumb.method == 'square') {
    113125      if (GDThumb.big_thumb != null) {
    114126        best_size.width = GDThumb.big_thumb.width;
     
    215227        for (j=0;j<thumb_process.length;j++) {
    216228
    217           if (GDThumb.method == 'square') {
     229          if ((GDThumb.method == 'square') || (GDThumb.method == 'slide')) {
    218230            new_width  = GDThumb.max_height;
    219231            new_height = GDThumb.max_height;
     
    254266
    255267  resize: function(thumb, width, height, new_width, new_height, is_big) {
    256     if ((!is_big) && (GDThumb.method == 'square')) {
     268
     269    use_crop = true;
     270    if (GDThumb.method == 'slide') {
     271      use_crop = false;
    257272      thumb.css({height: '', width: ''});
    258273      new_width = new_height;
     
    268283      height_crop = Math.round((real_height - new_height) / 2);
    269284      width_crop = Math.round((real_width - new_height) / 2);
     285      thumb.css({
     286        height: real_height+'px',
     287        width: real_width+'px'
     288      });
     289    } else if ((!is_big) && (GDThumb.method == 'square')) {
     290      thumb.css({height: '', width: ''});
     291      new_width = new_height;
     292
     293      if (width < height) {
     294        real_height = Math.round(height * new_width / width);
     295        real_width  = new_width;
     296      } else {
     297        real_height = new_width;
     298        real_width  = Math.round(width * new_height / height);
     299      }
     300
     301      height_crop = Math.round((real_height - new_height) / 2);
     302      width_crop = Math.round((real_width - new_width) / 2);
    270303      thumb.css({
    271304        height: real_height+'px',
     
    298331
    299332    thumb.parents('li').css({ height: new_height+'px', width: new_width+'px' });
    300     thumb.parent('a').css({ clip: 'rect('+height_crop+'px, '+(new_width+width_crop)+'px, '+(new_height+height_crop)+'px, '+width_crop+'px)', top: -height_crop+'px', left: -width_crop+'px' });
     333    if (use_crop) {
     334      thumb.parent('a').css({ clip: 'rect('+height_crop+'px, '+(new_width+width_crop)+'px, '+(new_height+height_crop)+'px, '+width_crop+'px)', top: -height_crop+'px', left: -width_crop+'px' });
     335    } else {
     336      thumb.parent('a').css({ top: -height_crop+'px', left: -width_crop+'px' });
     337    }
    301338  }
    302339}
  • extensions/GDThumb/language/en_UK/plugin.lang.php

    r31147 r31245  
    66$lang['Block for Panoramic Photo Page'] = 'Block for Panoramic Photo Page';
    77$lang['Cache have been generated'] = 'Cache have been generated';
    8 $lang['Cache Informations'] = 'Cache Information';
     8$lang['Cache Informations'] = 'Cache Informations';
    99$lang['Cache the big thumbnails (recommended)'] = 'Cache the big thumbnails (recommended)';
    1010$lang['Changelog'] = 'Changelog';
     
    3434$lang['Prevent word wrap'] = 'Prevent word wrap';
    3535$lang['Purge thumbnails cache'] = 'Purge thumbnails cache';
    36 $lang['Scale thumbnails'] = 'Scale thumbnails';
     36$lang['Thumbnail Mode'] = 'Thumbnail Mode';
    3737$lang['Show thumbnails caption'] = 'Show thumbnails caption';
    3838$lang['Square'] = 'Square';
     
    4444$lang['Use Description if Set'] = 'Use Description if Set';
    4545$lang['Vertical'] = 'Vertical';
    46  
     46$lang['Slide'] = 'Slide';
     47$lang['%d visit'] = '%d visit';
     48$lang['%d visits'] = '%d visits';
     49$lang['Big thumb cannot be used in Slide mode. Disabled'] = 'Big thumb cannot be used in Slide mode. Disabled';
     50$lang['Margin between thumbnails must be an integer'] = 'Margin between thumbnails must be an integer';
     51$lang['Number of photos per page must be an integer'] = 'Number of photos per page must be an integer';
     52$lang['Rating:'] = 'Rating:';
     53$lang['This Thumb mode cannot be used in Slide mode. Changed to default'] = 'This Thumb mode cannot be used in Slide mode. Changed to default';
     54$lang['Thumb animation cannot be used in Slide mode. Disabled'] = 'Thumb animation cannot be used in Slide mode. Disabled';
     55$lang['Thumbnails max height must be an integer'] = 'Thumbnails max height must be an integer';
     56
     57?>
  • extensions/GDThumb/main.inc.php

    r31134 r31245  
    22/*
    33Plugin Name: gdThumb
    4 Version: 1.0.17
     4Version: 1.0.18
    55Description: Apply Masonry style to album or image thumbs
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=771
     
    1919// | Plugin constants                                               |
    2020// +-----------------------------------------------------------------------+
    21 define('GDTHUMB_VERSION', '1.0.17');
     21define('GDTHUMB_VERSION', '1.0.18');
    2222define('GDTHUMB_ID',      basename(dirname(__FILE__)));
    2323define('GDTHUMB_PATH' ,   PHPWG_PLUGINS_PATH . GDTHUMB_ID . '/');
     
    2828if (!isset($conf['gdThumb'])):
    2929  include(dirname(__FILE__).'/config_default.inc.php');
    30 
    31   $query = '
    32 INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment)
    33 VALUES ("gdThumb" , "'.addslashes(serialize($config_default)).'" , "GDThumb plugin parameters");';
    34   pwg_query($query);
     30  conf_update_param('gdThumb', $config_default);
    3531  load_conf_from_db();
    3632endif;
     
    113109  $template->set_filename( 'index_thumbnails', dirname(__FILE__) . '/template/gdthumb_thumb.tpl');
    114110  $template->assign('GDThumb', $confTemp);
    115   $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height']));
     111  if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")):
     112    $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom($confTemp['height'], 9999));
     113  else:
     114    $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height']));
     115  endif;
    116116
    117117  if ($confTemp['big_thumb'] and !empty($tpl_vars[0])):
    118     $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']);
     118    if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")):
     119      $derivative_params = ImageStdParams::get_custom(2 * $confTemp['height'] + $confTemp['margin'], 9999);
     120    else:
     121      $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']);
     122    endif;
    119123    $template->assign('GDThumb_big', new DerivativeImage($derivative_params, $tpl_vars[0]['src_image']));
    120124  endif;
     
    132136  $template->set_filename( 'index_category_thumbnails', dirname(__FILE__) . '/template/gdthumb_cat.tpl');
    133137  $template->assign('GDThumb', $confTemp);
    134   $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height']));
     138  if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")):
     139    $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom($confTemp['height'], 9999));
     140  else:
     141    $template->assign('GDThumb_derivative_params', ImageStdParams::get_custom(9999, $confTemp['height']));
     142  endif;
    135143
    136144  if ($confTemp['big_thumb'] and !empty($tpl_vars[0])):
    137145    $id = $tpl_vars[0]["representative_picture_id"];
    138146    if (($id) && ($rep = $tpl_vars[0]["representative"])):
    139       $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']);
     147      if (($confTemp['method'] == "slide") || ($confTemp['method'] == "square")):
     148        $derivative_params = ImageStdParams::get_custom(2 * $confTemp['height'] + $confTemp['margin'], 9999);
     149      else:
     150        $derivative_params = ImageStdParams::get_custom(9999, 2 * $confTemp['height'] + $confTemp['margin']);
     151      endif;
    140152      $template->assign('GDThumb_big', new DerivativeImage($derivative_params, $rep['src_image']));
    141153    endif;
  • extensions/GDThumb/template/admin.tpl

    r31060 r31245  
    2424      <label for="direction">{'Masonry Type'|@translate}</label>
    2525    </li>
     26    <li>
     27      <select id="method" name="method" >
     28        <option {if $METHOD == 'crop'}selected="selected"{/if} value="crop">{'Crop (Default)'|@translate}</option>
     29        <option {if $METHOD == 'resize'}selected="selected"{/if} value="resize">{'Resize'|@translate}</option>
     30        <option {if $METHOD == 'square'}selected="selected"{/if} value="square">{'Square'|@translate}</option>
     31        <option {if $METHOD == 'slide'}selected="selected"{/if} value="slide">{'Slide'|@translate}</option>
     32      </select>
     33      <label for="method">{'Thumbnail Mode'|@translate}</label>
     34    </li>
    2635    <li><input id="height" type="text" size="2" maxlength="3" name="height" value="{$HEIGHT}"><label for="height">{'Thumbnails max height'|@translate}&nbsp;(px)</label></li>
    2736    <li><input id="margin" type="text" size="2" maxlength="3" name="margin" value="{$MARGIN}"><label for="margin">{'Margin between thumbnails'|@translate}&nbsp;px</label></li>
     
    3140    <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label><span class="graphicalCheckbox {if $BIG_THUMB_NOINPW}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="big_thumb_noinpw" id="big_thumb_noinpw" type="checkbox" value="1" {if $BIG_THUMB_NOINPW}checked="checked"{/if}>{'Block for Panoramic Photo Page'|@translate} (x2.2+)</label></li>
    3241    <li><label><span class="graphicalCheckbox {if $CACHE_BIG_THUMB}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="cache_big_thumb" id="cache_big_thumb" type="checkbox" value="1" {if $CACHE_BIG_THUMB}checked="checked"{/if}>{'Cache the big thumbnails (recommended)'|@translate}</label></li>
     42    <li><label><span class="graphicalCheckbox {if $THUMB_ANIMATE}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="thumb_animate" id="thumb_animate" type="checkbox" value="1" {if $THUMB_ANIMATE}checked="checked"{/if}>{'Animate thumbnail on hover'|@translate}</label></li>
    3343    <li>
    3444      <select id="normalize_title" name="normalize_title" >
     
    4050    </li>
    4151    <li><label><span class="graphicalCheckbox {if $NO_WORDWRAP}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="no_wordwrap" id="no_wordwrap" type="checkbox" value="1" {if $NO_WORDWRAP}checked="checked"{/if}>{'Prevent word wrap'|@translate}</label></li>
    42     <li>
    43       <select id="method" name="method" >
    44         <option {if $METHOD == 'crop'}selected="selected"{/if} value="crop">{'Crop (Default)'|@translate}</option>
    45         <option {if $METHOD == 'resize'}selected="selected"{/if} value="resize">{'Resize'|@translate}</option>
    46         <option {if $METHOD == 'square'}selected="selected"{/if} value="square">{'Square'|@translate}</option>
    47       </select>
    48       <label for="method">{'Scale thumbnails'|@translate}</label>
    49     </li>
    5052    <li>
    5153      <select id="thumb_mode_album" name="thumb_mode_album" >
     
    8486      <label for="thumb_metamode">{'Metadata Display Mode'|@translate}</label>
    8587    </li>
    86     <li><label><span class="graphicalCheckbox {if $THUMB_ANIMATE}icon-check{else}icon-check-empty{/if}">&nbsp;</span><input name="thumb_animate" id="thumb_animate" type="checkbox" value="1" {if $THUMB_ANIMATE}checked="checked"{/if}>{'Animate thumbnail on hover'|@translate}</label></li>
    8788  </ul>
    8889</fieldset>
     
    9192  <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
    9293  <input type="submit" name="submit" value="{'Submit'|@translate}">
    93   <input type="submit" name="cachedelete" id="cachedelete" value="{'Purge thumbnails cache'|@translate}" title="{'Delete images in GDThumb cache.'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');">
     94  <input type="button" name="cachedelete" id="cachedelete" value="{'Purge thumbnails cache'|@translate}" title="{'Delete images in GDThumb cache.'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');">
    9495  <input type="button" name="cachebuild" id="cachebuild" value="{'Pre-cache thumbnails'|@translate}" title="{'Finds images that have not been cached and creates the cached version.'|@translate}" onclick="jQuery.gdThumb_start();">
    9596</p>
  • extensions/GDThumb/template/gdthumb_cat.tpl

    r31134 r31245  
    77{assign var=derivative value=$pwg->derivative($GDThumb_derivative_params, $cat.representative.src_image)}
    88
    9   <li class="gdthumb{if $GDThumb.thumb_animate} animate{/if}">
     9  <li class="gdthumb{if $GDThumb.thumb_animate} animate{/if} {$GDThumb.method}">
    1010    {if $GDThumb.thumb_mode_album !== "hide" }
    1111    <span class="thumbLegend {$GDThumb.thumb_mode_album}">
  • extensions/GDThumb/template/gdthumb_thumb.tpl

    r31134 r31245  
    66  {* {$thumbnails|print_r} *}
    77
    8 <li class="gdthumb{if $GDThumb.thumb_animate} animate{/if}">
     8<li class="gdthumb{if $GDThumb.thumb_animate} animate{/if} {$GDThumb.method}">
    99  {if $GDThumb.thumb_mode_photo !== "hide" }
    1010  <span class="thumbLegend {$GDThumb.thumb_mode_photo}">
     
    4242    {elseif $GDThumb.thumb_metamode !== "hide"}
    4343      {if isset($thumbnail.NB_COMMENTS)}
    44       <span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments">
    45         {$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}
    46       </span>
     44      <span class="{if 0==$thumbnail.NB_COMMENTS}zero {/if}nb-comments">{$pwg->l10n_dec('%d comment', '%d comments',$thumbnail.NB_COMMENTS)}</span>
    4745      {/if}
    4846      {if isset($thumbnail.NB_COMMENTS) && isset($thumbnail.NB_HITS)} - {/if}
    4947      {if isset($thumbnail.NB_HITS)}
    50       <span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits">
    51         {$pwg->l10n_dec('%d hit', '%d hits',$thumbnail.NB_HITS)}
    52       </span>
     48      <span class="{if 0==$thumbnail.NB_HITS}zero {/if}nb-hits">{$pwg->l10n_dec('%d visit', '%d visits',$thumbnail.NB_HITS)}</span>
     49      {elseif isset($thumbnail.hit)}
     50      <span class="{if 0==$thumbnail.hit}zero {/if}nb-hits">{$pwg->l10n_dec('%d visit', '%d visits',$thumbnail.hit)}</span>
     51      {/if}
     52      {if isset($thumbnail.rating_score)}
     53      <span class="{if 0==$thumbnail.rating_score}zero {/if}rating">, {'Rating:'|@translate} {$thumbnail.rating_score}</span>
    5354      {/if}
    5455    {/if}
Note: See TracChangeset for help on using the changeset viewer.