Dotclear


Ignore:
Timestamp:
08/11/11 19:35:09 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
default
Message:

Fixes #1271

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/public/lib.tpl.context.php

    r478 r678  
    342342     public static function EntryFirstImageHelper($size,$with_category,$class="") 
    343343     { 
    344           if (!preg_match('/^sq|t|s|m|o$/',$size)) { 
     344          global $core, $_ctx; 
     345           
     346          if (!$core->media) $core->media = new dcMedia($core); 
     347          $sizes = implode('|',array_keys($core->media->thumb_sizes)).'|o'; 
     348          if (!preg_match('/^'.$sizes.'$/',$size)) { 
    345349               $size = 's'; 
    346350          } 
    347            
    348           global $core, $_ctx; 
    349351           
    350352          $p_url = $core->blog->settings->system->public_url; 
     
    400402     private static function ContentFirstImageLookup($root,$img,$size) 
    401403     { 
     404          global $core; 
     405           
    402406          # Get base name and extension 
    403407          $info = path::info($img); 
    404408          $base = $info['base']; 
    405409           
    406           if (preg_match('/^\.(.+)_(sq|t|s|m)$/',$base,$m)) { 
     410          if (!$core->media) $core->media = new dcMedia($core); 
     411          $sizes = implode('|',array_keys($core->media->thumb_sizes)); 
     412          if (preg_match('/^\.(.+)_('.$sizes.')$/',$base,$m)) { 
    407413               $base = $m[1]; 
    408414          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map