Changeset 12705


Ignore:
Timestamp:
Dec 8, 2011, 5:19:34 PM (9 years ago)
Author:
patdenice
Message:

Check md5sum for thumbnail cache.
Compatibility with RV Thumbnails Scroller.

Location:
extensions/GThumb
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/GThumb/functions.inc.php

    r12691 r12705  
    4646      $cache_dir = $data['cache_path'];
    4747    }
    48     $file = $cache_dir.'/'.md5($picture['path']).'.'.$picture['tn_ext'];
     48    $file = $cache_dir.'/'.md5($picture['path'].(!empty($picture['md5sum']) ? $picture['md5sum'] : '')).'.'.$picture['tn_ext'];
    4949
    5050    if (!is_dir($cache_dir))
  • extensions/GThumb/js/gthumb.js

    r12696 r12705  
    1919  build: function (selector) {
    2020
     21    this.t = new Array;
    2122    this.selector = selector;
    22     jQuery(selector+' img').each(function() {
     23    jQuery(selector+' img.thumbnail').each(function() {
    2324      id = parseInt(this.id.substring(2));
    2425      width = parseInt(jQuery(this).attr('width'));
  • extensions/GThumb/main.inc.php

    r12678 r12705  
    1919
    2020add_event_handler('loc_begin_index', 'GThumb_init', 60);
     21add_event_handler('loc_end_index_thumbnails', 'process_GThumb', 50, 2);
    2122add_event_handler('ws_add_methods', 'add_gthumb_thumbnails_method');
    2223add_event_handler('get_admin_plugin_menu_links', 'GThumb_admin_menu');
     
    3132  $page['nb_image_page'] = $conf['GThumb']['nb_image_page'];
    3233
    33   add_event_handler('loc_end_index_thumbnails', 'process_GThumb', 50, 2);
    34 
    3534  if (is_dir(GTHUMB_CACHE_DIR) and !is_dir(GTHUMB_CACHE_DIR.'/'.$conf['GThumb']['height']))
    3635  {
     
    4443{
    4544  global $template, $conf;
     45
     46  if (isset($_GET['rvts']))
     47  {
     48    $conf['GThumb']['big_thumb'] = false;
     49  }
    4650
    4751  $template->set_filename( 'index_thumbnails', realpath(GTHUMB_PATH.'template/gthumb.tpl'));
     
    137141
    138142  $new_height = $size == 'small' ? $conf['GThumb']['height'] : $conf['GThumb']['height'] * 2 + $conf['GThumb']['margin'];
    139   $file = GTHUMB_CACHE_DIR.'/'.$new_height.'/'.md5($picture['path']).'.'.$picture['tn_ext'];
     143  $file = GTHUMB_CACHE_DIR.'/'.$new_height.'/'.md5($picture['path'].(!empty($picture['md5sum']) ? $picture['md5sum'] : '')).'.'.$picture['tn_ext'];
    140144
    141145  if (file_exists($file))
  • extensions/GThumb/maintain.inc.php

    r12678 r12705  
    2222}
    2323
     24function plugin_activate($plugin_id, $version)
     25{
     26  if (in_array($version, array('2.3.a', '2.3.b')))
     27  {
     28    include_once(PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/functions.inc.php');
     29    gtdeltree(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'GThumb');
     30  }
     31}
     32
    2433?>
  • extensions/GThumb/template/gthumb.tpl

    r12696 r12705  
    2525
    2626GThumb.build('#thumbnails');
     27$(window).bind('RVTS_loaded', function() {ldelim} GThumb.build('#thumbnails'); });
    2728{/footer_script}
    2829
Note: See TracChangeset for help on using the changeset viewer.