Dotclear


Ignore:
Timestamp:
10/29/12 17:52:42 (13 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add cat_only attribute (search in category description only) for {{tpl:EntryFirstImage}}. fixes #499

Location:
inc/public
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/public/class.dc.template.php

    r930 r937  
    16231623     no_tag    (1|0)     #IMPLIED  -- Return image URL without HTML tag (default 0) 
    16241624     content_only   (1|0)          #IMPLIED  -- Search in content entry only, not in excerpt (default 0) 
     1625     cat_only  (1|0)          #IMPLIED  -- Search in category description only (default 0) 
    16251626     > 
    16261627     */ 
     
    16321633          $no_tag = !empty($attr['no_tag']) ? 1 : 0; 
    16331634          $content_only = !empty($attr['content_only']) ? 1 : 0; 
     1635          $cat_only = !empty($attr['cat_only']) ? 1 : 0; 
    16341636           
    16351637          return "<?php echo context::EntryFirstImageHelper('".addslashes($size)."',".$with_category.",'".addslashes($class)."',". 
    1636                $no_tag.",".$content_only."); ?>"; 
     1638               $no_tag.",".$content_only.",".$cat_only."); ?>"; 
    16371639     } 
    16381640      
  • inc/public/lib.tpl.context.php

    r930 r937  
    351351          return preg_replace(array_keys($GLOBALS['__smilies']),array_values($GLOBALS['__smilies']),$str); 
    352352     } 
    353       
     353 
    354354     # First post image helpers 
    355      public static function EntryFirstImageHelper($size,$with_category,$class="",$no_tag=false,$content_only=false) 
     355     public static function EntryFirstImageHelper($size,$with_category,$class="",$no_tag=false,$content_only=false,$cat_only=false) 
    356356     { 
    357357          global $core, $_ctx; 
     
    373373           
    374374          # We first look in post content 
    375           if ($_ctx->posts) 
     375          if (!$cat_only && $_ctx->posts) 
    376376          { 
    377377               $subject = ($content_only ? '' : $_ctx->posts->post_excerpt_xhtml).$_ctx->posts->post_content_xhtml; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map