Ignore:
Timestamp:
Jun 28, 2012, 3:08:25 PM (8 years ago)
Author:
mistic100
Message:

[photo ....] add option to not use hyperlink

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ExtendedDescription/main.inc.php

    r16120 r16121  
    125125  $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_img_thumb("$1", "$2", "$3")';
    126126 
    127   // Balises [photo=xx.yy;SQ|TH|XXS|XS|S|M|L|XL|XXL]
    128   $patterns[] = '#\[photo=([\d\.]*);?(SQ|TH|XXS|XS|S|M|L|XL|XXL|)\]#ie';
    129   $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_photo_sized("$1", "$2")';
     127  // Balises [photo=xx.yy;SQ|TH|XXS|XS|S|M|L|XL|XXL;true|false]
     128  $patterns[] = '#\[photo=([\d\.]*);?(SQ|TH|XXS|XS|S|M|L|XL|XXL|);?(true|false|)\]#ie';
     129  $replacements[] = ($param == 'subcatify_category_description') ? '' : 'get_photo_sized("$1", "$2", "$3")';
    130130
    131131  // [random album=xx]
     
    372372
    373373// Return html code for a photo
    374 function get_photo_sized($elem_id, $size)
     374function get_photo_sized($elem_id, $size, $show_url)
    375375{
    376376  global $template;
     377 
     378  if (empty($size)) $size = 'M';
     379  if (empty($show_url)) $show_url = 'true';
    377380
    378381  list($image_id, $cat_id) = array_pad(explode(".",$elem_id), 2, "");
     
    390393    );
    391394   
    392   if (empty($size)) $size = 'M';
    393395  $deriv_type = $size_map[ strtoupper($size) ];
    394396
     
    434436    }
    435437
    436     return '<a href="'.$url.'">'.$template->parse('extended_description_content', true).'</a>';
     438    $content = $template->parse('extended_description_content', true);
     439    if (get_boolean($show_url))
     440    {
     441      return '<a href="'.$url.'">'.$content.'</a>';
     442    }
     443    else
     444    {
     445      return $content;
     446    }
    437447  }
    438448 
Note: See TracChangeset for help on using the changeset viewer.